How To >>>
#5

Let me try

pawn Код:
CMD:dance(playerid,params[])
{
    new dancestyle; //defining this so that it can be used below.

    // parse params to get which Id did player entered
    if(sscanf(params, "d", dancestyle)) {
        //Parameters Used With This Command. If None Are Specified, The Player Will Use Dance 3.
        return SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE3);
    }
    if(IsPlayerInAnyVehicle(playerid)) {
        //Vehicle Protection So That You Cannot Use This Animation While In A Vehicle.
        return SendClientMessage(playerid,-1,"You Cannot Use This Command In A Vehicle.");
    }

    // switch through inserted style
    // and assign action to variable
    switch (dancestyle) {
        case 1: {
            dancestyle = SPECIAL_ACTION_DANCE1;
        }
        case 2: {
            dancestyle = SPECIAL_ACTION_DANCE2;
        }
        case 3: {
            dancestyle = SPECIAL_ACTION_DANCE3;
        }
        case 4: {
            dancestyle = SPECIAL_ACTION_DANCE4;
        }
        default: {
            // In case that imported value is not listed show this
            return SendClientMessage(playerid, -1, "Wrong value");
        }
    }

    // set player special action with dancestyle variable
    SetPlayerSpecialAction(playerid, dancestyle);

    // show message
    SendClientMessage(playerid, -1,"You Are Now Dancing. Press Any Key To Stop.");

    return 1;
}
Reply


Messages In This Thread
How To >>> - by Seaf - 13.11.2014, 08:54
Re: How To >>> - by Banana_Ghost - 13.11.2014, 08:59
Re: How To >>> - by Seaf - 13.11.2014, 09:16
Re: How To >>> - by ZaBraNjeNi - 13.11.2014, 16:17
Re: How To >>> - by CoaPsyFactor - 13.11.2014, 18:50
Re: How To >>> - by AzaMx - 16.11.2014, 10:25

Forum Jump:


Users browsing this thread: 1 Guest(s)