Need help with sscanf in cmd
#7

Quote:
Originally Posted by ******
Посмотреть сообщение
Use "s[10] " not "s[10]", otherwise sscanf will copy the whole of the input in to your "test" variable. Using only "s" in a specifier is completely wrong, and will be a warning in the future.
Thank you!

It work

PHP код:
CMD:test1(playerid,params[])
{
    new 
test[10];
    if(
sscanf(params,"s[10] ",test)) return SCM(playerid,-1,"USE: /test1");
    if(!
strcmp(test,"drugs",true))
    {
        
SCM(playerid,-1,"drugs");
        return 
true;
    }
    else if(!
strcmp(test,"mats",true))
    {
        new 
slot;
        if(
sscanf(params,"{s[10]}d",slot)) return SCM(playerid,-1,"USE: /test1 mats [1-5] 1");
        if(!(
<= slot <= 5)) return SCM(playerid,-1,"USE: /test1 mats [1-5] 2");
        
SCM(playerid,-1,"mats");
        return 
true;
    }
    return 
true;

Reply


Messages In This Thread
Need help with sscanf in cmd - by Reim - 12.09.2014, 01:59
Re: Need help with sscanf in cmd - by krytans - 12.09.2014, 02:35
Re: Need help with sscanf in cmd - by Reim - 12.09.2014, 02:48
Re: Need help with sscanf in cmd - by MikeEd - 12.09.2014, 03:57
Re: Need help with sscanf in cmd - by Reim - 12.09.2014, 04:05
Re: Need help with sscanf in cmd - by MikeEd - 12.09.2014, 04:12
Re: Need help with sscanf in cmd - by Reim - 12.09.2014, 15:23

Forum Jump:


Users browsing this thread: 2 Guest(s)