Sscanf problem
#1

Hi, I have never use sscanf before and I've tried to convert a ZCMD command to strcmp but I've a problem with Sscanf:

pawn Код:
if(strcmp(cmd, "/gotodealership", true) == 0)
    {
        if(IsPlayerConnected(playerid))
            {
                if(!(PlayerInfo[playerid][pAdmin] > 3)) return SendClientMessage(playerid, COLOR_RED, "Vous n'avez pas accиs а cette commande!");
                new dealerid, msg[128];
                if(sscanf(cmd, "d", dealerid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /gotodealership [dealerid]");
                if(!IsValidDealership(dealerid)) return SendClientMessage(playerid, COLOR_RED, "Erreur!");
                SetPlayerPos(playerid, DealershipPos[dealerid][0], DealershipPos[dealerid][1], DealershipPos[dealerid][2]);
                format(msg, sizeof(msg), "Teleported to dealership id %d", dealerid);
                SendClientMessage(playerid, COLOR_WHITE, msg);
            }
        return 1;
    }
Here, no error in compil, but In Game, when I typed /gotodealership 1, that return me the usage, even if the syntax is correct, someone know why?

Thanks.
Reply


Messages In This Thread
Sscanf problem - by Sreadon - 11.12.2011, 19:50
Re: Sscanf problem - by Kingunit - 11.12.2011, 19:58
Re : Sscanf problem - by Sreadon - 11.12.2011, 20:10
Re: Sscanf problem - by Kingunit - 11.12.2011, 20:15
Re : Sscanf problem - by Sreadon - 11.12.2011, 20:18

Forum Jump:


Users browsing this thread: 2 Guest(s)