Quote:
Originally Posted by DJEarthQuake
Code:
/*
punish_slap(id, Float:punishPercentage)
{
for (new slapCnt = 1; slapCnt <= floatround(3.0 * punishPercentage, floatround_ceil); slapCnt++)
user_slap(id, 0);
}
*/
punish_slap(id, Float:punishPercentage){
for (new slapCnt = 1; slapCnt <= floatround(3.0 * punishPercentage, floatround_ceil); slapCnt++)
if(!is_user_bot(id) && is_user_alive(id) && is_user_connected(id))
{
user_slap(id, 0);
}
}
|
If you are checking that the player is alive, there is no need to check that it is connected.
Syntax
native is_user_alive(index);
Description
Returns if the client is alive.
Note
This will never return true if a client is not connected. If you need
to know whether a client is alive, an additional call to
is_user_connected() is unnecessary.
Return
1 if client is alive, 0 otherwise
__________________