sscanf command problem
#1

Hey, I'm experiencing some problems with my /v [other thing] command using sccanf.
So ofcourse the reason I'm here is that I'm seeking help with it.

Code:
pawn Код:
dcmd_v(playerid, params[])
{
    new choice[20];
    if(sscanf(params,"s[20]",choice))
    {
        SendClientMessage(playerid,COLOR_YELLOW,"Usage: /v [action]");
        SendClientMessage(playerid,COLOR_YELLOW,"Actions: buy - get");
        return 1;
    }
    else
    {
        if(equal(params,"buy"))
        {
            new id;
            if(sscanf(params,"s[20]i",choice,id)) return SendClientMessage(playerid,COLOR_YELLOW,"Usage: /v buy [modelid] to get more information");
            else
            {
//Taken this out for it to look more smooth
            }
        }
        else if(equal(params,"get"))
        {
            new id;
            if(sscanf(params,"s[20]i",choice,id)) return SendClientMessage(playerid,COLOR_YELLOW,"Usage: /v get [1-3]");
            else
            {
             //Taken this out for it to look more smooth
            }
        }
    }
    return 1;
}
Okay so what the problem is that, /v works, /v buy shows the return sendclientmessage, but if I do the /v buy and a modelid so for example

/v buy 401

It does nothing.

Exactly the same for /v get
works with /v get shows the return, but if I do /v get 1 it doesn't do the thing it's supposed to do

It can't be the code inside any of them as far as I know, it worked when I only had /v buy but today I started scripting the /v get and that's when it happen that I had to change everything and now I've come across this which I'm unable to fix myself.
Reply


Messages In This Thread
sscanf command problem - by oliverrud - 12.02.2011, 18:55
Re: sscanf command problem - by Hiddos - 12.02.2011, 18:57
Re: sscanf command problem - by oliverrud - 12.02.2011, 19:02
Re: sscanf command problem - by Gh0sT_ - 13.02.2011, 02:15
Re: sscanf command problem - by oliverrud - 13.02.2011, 02:23
Re: sscanf command problem - by Unknown123 - 13.02.2011, 02:36
Respuesta: sscanf command problem - by Chιrι - 13.02.2011, 02:58
Re: sscanf command problem - by Hal - 13.02.2011, 03:03
Re: Respuesta: sscanf command problem - by oliverrud - 13.02.2011, 11:18
Re: sscanf command problem - by JaTochNietDan - 13.02.2011, 18:21

Forum Jump:


Users browsing this thread: 2 Guest(s)