SA-MP Forums Archive
sscanf2 ID blockage problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: sscanf2 ID blockage problem (/showthread.php?tid=340901)



sscanf2 ID blockage problem - admantis - 09.05.2012

Hey guys,
I've got this command:
pawn Код:
CMD:pm( playerid, params[] )
{
    if( PlayerInfo[playerid][Muted] == 1) return ShowErrorMessage( playerid, "You are muted and can't speak." );
   
    new sendTo, pmText[128];

    if ( sscanf( params, "us[128]", sendTo, pmText ) )
        return ShowSyntaxMessage( playerid, "/pm [playerid] [message]" );

    if ( !IsPlayerConnected( sendTo ) )
        return ShowErrorMessage( playerid, "That player is not connected." );

    if ( IsPlayerNPC ( sendTo ) )
        return ShowErrorMessage( playerid, "You can't do this to NPC players." );
If I try to PM an offline players, it will tell me that the player is not connected, however, certain ID's (to be more specific ID 5) even if online, will also report the player is not connected.
How can I prevent this to happen?


Re: sscanf2 ID blockage problem - Darklom - 09.05.2012

Simply: You PM ID 5 and it says the player is offline which isn't. It only occurs to ID 5