Quote:
Originally Posted by Chaosxk
Just because i like to make things shorter.
PHP Code:
param2++;
effect = param2;
Action_Effect(client);
instead of different if else statements in your MenuHandler1.
Also you might need to do some valid client checks to make sure you don't error out with invalid client call stack errors. Here's a stock that i use to check if the client is valid.
PHP Code:
stock bool:IsValidClient(iClient, bool:bReplay = true) {
if(iClient <= 0 || iClient > MaxClients)
return false;
if(!IsClientInGame(iClient))
return false;
if(bReplay && (IsClientSourceTV(iClient) || IsClientReplay(iClient)))
return false;
return true;
}
So for example in OnTakeDamage, before all your code starts, you would do something like
PHP Code:
if(IsValidClient(client)
{
//blah blah
}
Same with sm_armor and sm_reset.
Else you might end up with something like:
Client index 0 isinvalid
|
don't give people bad advice, if a client's entity is hooked by something like ontakedamage a fail stock like isvalidclient will always return true, since their entity will be in game for as long as they are hooked. When they disconnect the hook will be removed.
__________________