Multiple SSCANF checks not working.
#4

Quote:
Originally Posted by KtotheYle
Посмотреть сообщение
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]");
"i" and "d" are exactly the same buddy.
it doesen't matter if it's 'd' or 'i' in pawn just like you said. That won't change a thing actually cuz both can deal with integers (well, 'i' can also be used for Hexadecimal or Octal integers)

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;
}
Reply


Messages In This Thread
Multiple SSCANF checks not working. - by zT KiNgKoNg - 07.01.2014, 13:59
Re: Multiple SSCANF checks not working. - by KtotheYle - 07.01.2014, 14:02
Re: Multiple SSCANF checks not working. - by zT KiNgKoNg - 07.01.2014, 14:05
Re: Multiple SSCANF checks not working. - by CutX - 07.01.2014, 14:21
Re: Multiple SSCANF checks not working. - by zT KiNgKoNg - 07.01.2014, 14:42
Re: Multiple SSCANF checks not working. - by zT KiNgKoNg - 07.01.2014, 14:57

Forum Jump:


Users browsing this thread: 1 Guest(s)