View Single Post
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 04-10-2012 , 09:17   Re: css throving knives
Reply With Quote #4

ya, I saw that possiblity, but didn't look through for the disconnect code to see if it got reset... just used the online compiler to make sure it would compile before I posted.

Here's the code suggested by thetwistedpanda so a new player doesn't glitch the plugin and get knives when they're not allowed to:
PHP Code:
public EventPlayerSpawn(Handle:event,const String:name[],bool:dontBroadcast) {

    if (
GetConVarBool(g_CVarEnable)) {
        new 
client GetClientOfUserId(GetEventInt(event"userid"));
        if (
GetClientTeam(client) == && CheckCommandAccess(client"allow_throwing_knives"ADMFLAG_CUSTOM1))
        {
            
g_iKnives[client] = GetConVarInt(g_CVarKnives);
        }
        else
        {
            
g_iKnives[client] = 0;
        }
    }

__________________
View my Plugins | Donate
TnTSCS is offline