Player ID: 3 is not working
#1

Yeah, so i have simple cmds, for example: /burn < playerid >, /slap <playerid>, /AKill < playerid >

But, they don't work if i enter /burn 3

It works all up to 2

Any cmd on my script will throw out that error. Here are some simple cmds :

pawn Код:
CMD:burn(playerid,params[])
{
    if(GetPVarInt(playerid, "Level") >= 3)
    {
        new
            ID,
            Float:X,
            Float:Y,
            Float:Z;
        if(unformat(params,"r", ID)) return SendClientMessage(playerid, COLOR_RED, "* Usage: /Burn <PlayerID>");
        if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_RED, "* That user is not connected!");
        GetPlayerPos(ID, X, Y, Z);
        SendFMessage(ID, COLOR_LIGHTBLUE, "Admin: %s(%d) has burnt you!", pName(playerid), playerid);
        return CreateExplosion(X, Y, Z + 3, 1, 10);
    }
    else return AdminCmd(playerid, 3);
}
pawn Код:
CMD:pm(playerid, params[])
{
    new pID;
    if(sscanf(params, "rs[128]", pID, params)) return SendClientMessage(playerid, COLOR_RED, "* Usage: /PM < PlayerID > < Message >");
    if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "* That user is not connected!");

    SendFMessage(pID, COLOR_PEACHPUFF, "PM From: %s(%d) - %s", pName(playerid), playerid, params);
    SendFMessage(playerid, COLOR_PEACHPUFF, "PM Sent To: %s(%d) - %s", pName(pID), pID, params);
    return 1;
}
Yes, not even that pm cmd is working ( i also know that sscanf isn't needed to process those cmds, but who cares )
----------
Not sure what else i can show to simplify the problem. If y'all need any more pieces of code, ask!!
Reply
#2

What error are the commands throwing?
Try doing printf("%d", id); after using unformat or sscanf, and check if the detected ID number is correct.
Reply
#3

No errors on all my cmds, they just simply don't function on player id: 3

Ok, i didn't tested with id 3. I tested with id 1

Here are the results ( after typing the /pm cmd 5* times )

Код:
[20:18:24] 1
[20:18:33] 0
[20:18:37] 1
[20:18:40] 1
[20:18:56] 0
The 1 is the player that i tested it with. But why do i get 0 sometimes? Could it be my cmd processor?
Reply
#4

I'm not sure why you have:

pawn Код:
if(unformat(params,"r", ID)) return SendClientMessage(playerid, COLOR_RED, "* Usage: /Burn <PlayerID>");
You should use "u" as the variable for a playerid/name. That could be the problem...
Reply
#5

Bumpy Bump Bump!!

Код:
uUser name/id (bots and players)******, 0
qBot name/idShopBot, 27
rPlayer name/id******, 42
i see that 'u' and 'r' are almost the same, except 'u' also checks for bots

--------
Ok, don't know what else to do. Help!
Reply
#6

BUMP!


The message you have entered is too short. Please lengthen your message to at least 8 characters.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)