07.01.2014, 14:21
Quote:
Have you tried using a "i" instead of a "d" in this line?
Код:
if(sscanf(params, "d", InviteID)) return SendClientMessage(playerid, COLOR_WHITE, "{C2A2DA}Usage{FFFFFF}: /company invite [playerid]"); |
you are scanning params 2 times.
First, you're saying that there should be a string after the "space" in the cmd
and then you're sayin' that there's a number at that same spot where you previously told sscanf that there's a string. Fuck logic
anyways, what you're trying to do is not possible, atleast the way you're trying to do it.
not sure which command-sys that is but i'll try giving you an example:
pawn Код:
COMMAND:company(playerid, params[], option[])
{
new s[6],x;
if(sscanf(params, "s[6]d",s,x)) return SendClientMessage(playerid,-1,"USAGE: /company [invite/kick] [ID]");
if(strcmp(s,"invite",true) == 0)//option is "invite"
{
//do some stuff here
return 1;
}
else if(strcmp(s,"kick",true) == 0)//option is "kick"
{
//do some stuff here
return 1;
}
else//if the option was INVALID
//do some stuff, like sending a msg sayin' unknown option or so
return 1;
}