Help with YCMD and SSCANF!
#1

Hello, I want a command like this:

pawn Код:
YCMD:sell(playerid, params[], pHELPS)
{
    new Fun[12];

    if(sscanf(params, "s[12]", Fun))
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "USE: /sell [drug/medicament]");
        return 1;
    }
    if(!strcmp(Fun, "drug"))
    {
        new qnt, vlr;

        if(sscanf(params, "dd", qnt, vlr))
        {
            SendClientMessage(playerid, 0xFFFFFFFF, "USE: /sell [drug] [amount] [price]");
            return 1;
        }
        SendPlayerMessage(playerid, 0xFFFFFFFF, "test %d - %d :D", qnt, vlr);
        return 1;
    }
    if(!strcmp(Fun, "medicament"))
    {
        new qnt, vlr;

        if(sscanf(params, "dd", qnt, vlr))
        {
            SendClientMessage(playerid, 0xFFFFFFFF, "USE: /sell [medicament] [amount] [price]");
            return 1;
        }
        SendPlayerMessage(playerid, 0xFFFFFFFF, "test %d - %d uhuuuu", qnt, vlr);
        return 1;
    }
    return 1;
}
However, the command I did above does not work. Could someone fix for me?

Thank you very much!
Reply


Messages In This Thread
Help with YCMD and SSCANF! - by SuperChock - 18.01.2014, 19:58
Re: Help with YCMD and SSCANF! - by Blademaster680 - 18.01.2014, 22:55
Re: Help with YCMD and SSCANF! - by SuperChock - 18.01.2014, 23:43
Re: Help with YCMD and SSCANF! - by Scrillex - 18.01.2014, 23:46
Re: Help with YCMD and SSCANF! - by SuperChock - 19.01.2014, 00:08

Forum Jump:


Users browsing this thread: 1 Guest(s)