COMMAND ISSUE.
#1

FOUND PROBLEM:
It turned out that wid was returning 4?
I changed wid to weapon id and it returns fine.
If anyone would know why this happens, I would appreciate it!


So im using SSCANF and ZCMD

I've been using one command and it wouldn't work.
So I copied a command that worked and changed it to behave like the other command.

This is the command that works:
pawn Код:
CMD:test(playerid, params[])
{
        new giveplayerid, string[128];
        if(sscanf(params, "d", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GRAD1, "USAGE: /test [playerid]");
        format(string, sizeof(string), "You typed %d", giveplayerid);
        SendClientMessageEx(playerid, COLOR_YELLOW, string);
        return 1;
}
And here is the command that doesn't work.

pawn Код:
CMD:atest(playerid, params[])
{
    new wid, string[128];
    if(sscanf(params, "d", wid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /test [number]");
    format(string, sizeof(string), "You typed %d", wid);
    SendClientMessageEx(playerid, COLOR_YELLOW, string);
    return 1;
}
Is there anything different in any of them?
The first one was copied from a working command and I built inside it and the second is the one that doesnt work.
What could be making this happen?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)