Multiple parameter help (sscanf)
#1

pawn Код:
CMD:wear( playerid, params[] )
{
    /*
        Slot 0 - Hats, caps.
    */

   
    if( strcmp( params, "policecap", false ) == 0 )
    {
        if( plStats [ playerid ] [ HasAPoliceCap ] == 1 )
        {
            SetPlayerAttachedObject( playerid, 0, 18636, 2 );
            EditAttachedObject( playerid, 0 );
        }
        else return ShowPlayerErrorMessage( playerid, "You don't have a \"Police Cap\"!" );
    }
    if( strcmp( params, "beret", false ) == 0 )
    {
        new
            colour [ 32 ];
               
        strdel( params, 0, 5 );
        if( sscanf( params, "s[32]", colour ) )
            return SendClientMessage( playerid, Colour_RankOrange, "HELP: "#Int_White"/wear beret [ colour (red, black, blue, army) ]" );
               
        if( strcmp( colour, "red", false ) == 0 )
        {
            SetPlayerAttachedObject( playerid, 0, 18922, 2 );
            EditAttachedObject( playerid, 0 );
        }
        else return ShowPlayerErrorMessage( playerid, "Invalid colour!" );
    }
    return true;
}
I had this working a while ago, problem is, now it's not lol. The problem is located in the 'beret' part of this, and I'm assuming has something to do with my strdel. Any ideas?
Reply


Messages In This Thread
Multiple parameter help (sscanf) - by 2KY - 30.09.2012, 17:02
Re: Multiple parameter help (sscanf) - by mamorunl - 30.09.2012, 17:55

Forum Jump:


Users browsing this thread: 1 Guest(s)