cmd /id error , I need Solution
#1

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
Reply
#2

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.
Reply
#3

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

how to update it ?
Reply
#5

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;
}

Reply
#6

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.
Reply
#7

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

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

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?
Reply
#10

That Sscanf Problem Update Plugin and INC File
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)