Need help with sscanf in cmd
#4

I dont think this code works in any way, i've tried countless solutions and results are the same. So i'd suggest using a different method for this command. you could do something like this

pawn Код:
CMD:test1(playerid,params[])
{
    new item[10];
    if(sscanf(params,"s[10]", item)) return SendClientMessage(playerid, -1, "USE: /test1");
    if(!strcmp(params, "drugs"))
    {
        SendClientMessage(playerid,-1,"drugs OK");
    }
    return 1;
}
pawn Код:
CMD:mats(playerid,params[])
{
    new slot;
    if(sscanf(params,"i", slot)) return SendClientMessage(playerid, -1, "USE: /mats [1-2]");
    if(!strcmp(params, "1"))
    {
        SendClientMessage(playerid,-1,"mats 1 OK");
    }
    if(!strcmp(params, "2"))
    {
        SendClientMessage(playerid,-1,"mats 2 OK");
    }
    return 1;
}
Reply


Messages In This Thread
Need help with sscanf in cmd - by Reim - 12.09.2014, 01:59
Re: Need help with sscanf in cmd - by krytans - 12.09.2014, 02:35
Re: Need help with sscanf in cmd - by Reim - 12.09.2014, 02:48
Re: Need help with sscanf in cmd - by MikeEd - 12.09.2014, 03:57
Re: Need help with sscanf in cmd - by Reim - 12.09.2014, 04:05
Re: Need help with sscanf in cmd - by MikeEd - 12.09.2014, 04:12
Re: Need help with sscanf in cmd - by Reim - 12.09.2014, 15:23

Forum Jump:


Users browsing this thread: 1 Guest(s)