SA-MP Forums Archive
cmd /id error , I need Solution - 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: cmd /id error , I need Solution (/showthread.php?tid=460997)



cmd /id error , I need Solution - Ivander - 31.08.2013

Hello.

Yesterday i tested a RP GM on my Hosting and Reach 6Player ++.
And i Got some bug on cmd id. I dont know how to fix it
Hopefull you can Help me solve this...

Ok Lets go to point

if i do /id 0-5 its work , no problem
but if i do /id 6-999 it will shown Player ID 0.
and if i do cuff , slap , kick , jail , any cmd to ID 6-999 , player ID 0 will got it (Jail , slap etc)
And ID 6-999 will got nothing. So i cant RP with them and cuff or another CMD to ID 6-999

Any Solution of this problem ?
Please Reply , Sorry for bad English


Re: cmd /id error , I need Solution - Skribblez - 31.08.2013

If you're not yet using sscanf by ******, then I suggest you start using it. There's a specifier for usernames or player IDs which is "u", for example:

pawn Код:
command(id, playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        new id;
       
        if(sscanf(params, "u", id))
            return SendClientMessage(playerid, -1, "SYNTAX: /id [playerid/PartOfName]");
           
        if(IsPlayerConnected(id))
        {
            SendClientMessage(playerid, -1, "Player is online");
        }
        else SendClientMessage(playerid, -1, "Player is not connected!");
    }
    return 1;
}
From the example, I used ZCMD and as you can see the specifier "u" detects either the player's partial name or id.


Re: cmd /id error , I need Solution - Emmet_ - 31.08.2013

It's an issue with the version of sscanf you're using. Update the plugins and that should fix the issue.


Re: cmd /id error , I need Solution - Ivander - 31.08.2013

how to update it ?


Re: cmd /id error , I need Solution - Ivander - 31.08.2013

Im bit confused. this my CMD:ID
This is Correct or Something wrong with this
Quote:

CMD:id(playerid, params[])
{
new string[128], giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /id [playerid]");

if(IsPlayerConnected(giveplayerid))
{
format(string, sizeof(string), "(ID: %d) - (Name: %s) - (Level: %d) - (Ping: %d)", giveplayerid, GetPlayerNameEx(giveplayerid), PlayerInfo[giveplayerid][pLevel], GetPlayerPing(giveplayerid));
SendClientMessageEx(playerid, COLOR_WHITE, string);
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
}
return 1;
}




Re: cmd /id error , I need Solution - Skribblez - 31.08.2013

I don't see anything wrong with your script. Try updating your sscanf, link below:

https://sampforum.blast.hk/showthread.php?tid=120356 - just download the latest one and replace it with what you currently have.


Re: cmd /id error , I need Solution - mahardika - 31.08.2013

Quote:
Originally Posted by Ivander
Посмотреть сообщение
how to update it ?
https://sampforum.blast.hk/showthread.php?tid=120356 here you friend


Re: cmd /id error , I need Solution - Ivander - 31.08.2013

Why after i download NPC Modes and Source Windows .dll
I got this problem http://prntscr.com/1ogc61
Any Solution ?


Re: cmd /id error , I need Solution - mahardika - 31.08.2013

Quote:
Originally Posted by Ivander
Посмотреть сообщение
Why after i download NPC Modes and Source Windows .dll
I got this problem http://prntscr.com/1ogc61
Any Solution ?
where you copy that file?


Re: cmd /id error , I need Solution - viveka27 - 31.08.2013

That Sscanf Problem Update Plugin and INC File