14.06.2011, 12:57
IsPlayerConnected is useful for certain situations. It's not necessary in a script a script however because this:
is basically the same as:
A example situation involving when checking a player is connected method is the code below (I just wrote it up for this post, this code is not tested)
pawn Код:
if( !IsPlayerConnected( playerid ) )
pawn Код:
if( playerid == INVALID_PLAYER_ID )
pawn Код:
CMD:slap( playerid, params[ ] )
{
static
s_int
;
if( sscanf( params, "r", s_int ) )
return false;
if( s_int == INVALID_PLAYER_ID )
return false;
static
Float:s_pos[3]
;
GetPlayerPos( s_int, s_pos[0], s_pos[1], s_pos[2] );
SetPlayerPos( s_int, s_pos[0], s_pos[1], s_pos[2] + 10 );
return true;
}