IsPlayerConnected usefull?
#4

IsPlayerConnected is useful for certain situations. It's not necessary in a script a script however because this:

pawn Код:
if( !IsPlayerConnected( playerid ) )
is basically the same as:

pawn Код:
if( playerid == INVALID_PLAYER_ID )
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 Код:
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;      
}
Reply


Messages In This Thread
IsPlayerConnected usefull? - by rt-2 - 14.06.2011, 10:56
Re: IsPlayerConnected usefull? - by Danny - 14.06.2011, 10:58
Re: IsPlayerConnected usefull? - by rt-2 - 14.06.2011, 11:02
Re: IsPlayerConnected usefull? - by Cyanide - 14.06.2011, 12:57
Re: IsPlayerConnected usefull? - by rt-2 - 14.06.2011, 14:23

Forum Jump:


Users browsing this thread: 1 Guest(s)