12.02.2011, 18:55
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:
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.
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;
}
/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.