Question about ZCMD & SSCANF
#7

Quote:
Originally Posted by MeDaKewlDude
Посмотреть сообщение
you would need to do it like this"
pawn Код:
CMD:give(playerid,params[])
{
    if(!strcmp(params,"cash ",true,5))//5 is the length of "cash "
    {
        new ID,amount;
        if(sscanf(params[5],"dd",ID,amount))//make sure you have [(the length of "cash ")] after params
        {
            return SendClientMessage(playerid,0xFFAA00AA,"Usage: /give Cash (player ID) (Amount)");
        }
        //code here
        return 1;
    }
    if(!strcmp(params,"keys ",true,5))//5 is the length of "keys "
    {
        new ID;
        if(sscanf(params[5],"d",ID))"dd"//make sure you have [(the length of "keys ")] after params
        {
            return SendClientMessage(playerid,0xFFAA00AA,"Usage: /give Keys (player ID)");
        }
        //code here
        return 1;
    }
    return 0;
}
Thanks for the help! +REP
Reply


Messages In This Thread
Question about ZCMD & SSCANF - by ddnbb - 11.08.2012, 19:23
Re: Question about ZCMD & SSCANF - by leonardo1434 - 11.08.2012, 19:38
Re: Question about ZCMD & SSCANF - by ddnbb - 11.08.2012, 19:49
Re: Question about ZCMD & SSCANF - by leonardo1434 - 11.08.2012, 19:56
Re: Question about ZCMD & SSCANF - by FalconX - 11.08.2012, 19:56
Re: Question about ZCMD & SSCANF - by MeDaKewlDude - 11.08.2012, 20:04
Re: Question about ZCMD & SSCANF - by ddnbb - 11.08.2012, 20:29

Forum Jump:


Users browsing this thread: 1 Guest(s)