rogeraabbccdd / Music-Kits

Allow player to use music kits in game
15 stars 4 forks source link

Version 1.8 #10

Closed crashzk closed 4 years ago

crashzk commented 4 years ago

CVAR sm_musickit_spawnmsg I used as the basis of this plugin: https://github.com/Franc1sco/Franug-Custom-Weapons-Menu/blob/fa88baac634ebab6857120eac05893dc498cf148/scripting/franug_cwm.sp#L144-L160

//Show Spawn Messege
public Action:PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
    // Get Client
    new client = GetClientOfUserId(GetEventInt(event, "userid"));

    if (GetClientTeam(client) == 1 && !IsPlayerAlive(client))
    {
    return;
    }

    // Check Convar & Spawnmsg
    if (GetConVarInt(cvarcwmspawnmsg) == 1)
    {   
        CPrintToChat(client," \x04[CW]\x01 %T","spawnmsg", client);
    }
}

I didn't get to test this feature myself, but so far without errors on the server console, and the players reported that the songs are working correctly.

I would be grateful if you could check out this new feature from CVAR.

rogeraabbccdd commented 4 years ago

Look good to me, thanks