Simple command problem
#2

Try this

pawn Код:
if (strcmp("/smoke", cmdtext, true) == 0)
    {
        if(pCriticallyInjured[playerid] == 1) return SendClientMessage(playerid, COLOR_ORANGE, "[ERROR:] Critically injured!");
        if(!IsPlayerInAnyVehicle(playerid))
        {
            new id;
            if(sscanf(cmdtext,"i",id)) return SendClientMessage(playerid,COLOR_USAGE,"[USAGE:] /smoke [1-3]");
            switch (id)
            {
                case '1': ApplyAnimation(playerid,"SMOKING", "M_smklean_loop", 4.0, 1, 0, 0, 0, 0);
                case '2': ApplyAnimation(playerid,"SMOKING", "F_smklean_loop", 4.0, 1, 0, 0, 0, 0);
                case '3': ApplyAnimation(playerid,"SMOKING", "M_smkstnd_loop", 4.0, 1, 0, 0, 0, 0);
                default: SendClientMessage(playerid,COLOR_USAGE,"[USAGE:] /smoke [1-3]");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_ORANGE, "[ERROR:] Not possible in a vehicle.");
        }
        return 1;
    }
You will need sscanf
Reply


Messages In This Thread
Simple command problem - by Makaveli93 - 03.08.2012, 15:36
Re: Simple command problem - by [MM]RoXoR[FS] - 03.08.2012, 15:43
Re: Simple command problem - by Makaveli93 - 03.08.2012, 15:46
Re: Simple command problem - by [MM]RoXoR[FS] - 03.08.2012, 15:56
Re: Simple command problem - by Makaveli93 - 03.08.2012, 15:59
Re: Simple command problem - by [MM]RoXoR[FS] - 03.08.2012, 16:36

Forum Jump:


Users browsing this thread: 1 Guest(s)