Sub cmd sscanf
#1

Hi,

I had a problem with sscanf, warning about optional string. It's corrected : S(No Reason)[125]

But, my script don't work.

PHP код:
YCMD:admin(playeridparams[], help)
{
    new 
tmp[20],
        
nextParams[125]
    ;
    
    if( 
sscanf(params"s[25]S(No Reason)[125]"tmpnextParams) )
        return 
SendClientMessage(playerid, -1"{9DEB00}Usage: /admin [Choix]");
    else
    {
        if( !
strcmp(tmp"slap"true) )
        {
            new    
userid,
                
raison[50],
                
Float:POS[3]
            ;
            
            if( 
sscanf(nextParams"uS(No Reason)[50]"useridraison) )
                return 
SendClientMessage(playerid, -1"[Commande] /admin slap [ID/Partie du Nom] [Raison (facultatif)]");
            else
            {
                if( 
InvalidPlayerID(playeriduserid) ) return 1;
                
GetPlayerPos(useridPOS[0], POS[1], POS[2]);
                
SetPlayerPos(useridPOS[0], POS[1], POS[2]+5);
                if( 
strlen(raison) > 0)
                       
SendClientMessageToAllEx(-1"[ADMIN] L'admin %s a slap %s. Raison: %s"returnNameEx(playerid), returnNameEx(userid), raison);
                else
                    
SendClientMessageToAllEx(-1"[ADMIN] L'admin %s a slap %s."returnNameEx(playerid), returnNameEx(userid));
            }
        }
    }
    return 
1;

I write: /admin : ok : "/admin [choix]"
I write: /admin slap : not ok! : "Player not connected" (warning from InvalidPlayerID) ...

Help
Thanks
Reply


Messages In This Thread
Sub cmd sscanf - by Noliax8 - 27.12.2013, 13:31
Re: Sub cmd sscanf - by Hansrutger - 27.12.2013, 13:39
Re : Sub cmd sscanf - by Noliax8 - 27.12.2013, 13:58
Re: Sub cmd sscanf - by Hansrutger - 27.12.2013, 14:11
Re : Sub cmd sscanf - by Noliax8 - 27.12.2013, 14:14
Re: Sub cmd sscanf - by Hansrutger - 27.12.2013, 14:34
Re : Sub cmd sscanf - by Noliax8 - 27.12.2013, 14:42
Re: Re : Sub cmd sscanf - by Hansrutger - 27.12.2013, 14:52
Re : Sub cmd sscanf - by Noliax8 - 28.12.2013, 09:55
Re: Sub cmd sscanf - by newbie scripter - 28.12.2013, 11:51

Forum Jump:


Users browsing this thread: 1 Guest(s)