13.11.2014, 08:59
This Is Using ZCMD and sscanf.
pawn Код:
CMD:dance(playerid,params[])
{
new dancestyle; //defining this so that it can be used below.
if(sscanf(params, "d", dancestyle)) return SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE3); //Parameters Used With This Command. If None Are Specified, The Player Will Use Dance 3.
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,-1,"You Cannot Use This Command In A Vehicle."); //Vehicle Protection So That You Cannot Use This Animation While In A Vehicle.
else
{
if(dancestyle == 1) //Defining the different dance style options.
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE1);
SendClientMessage(playerid, -1,"You Are Now Dancing. Press Any Key To Stop.");
}
else if(dancestyle == 2)
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE2);
SendClientMessage(playerid, -1,"You Are Now Dancing. Press Any Key To Stop.");
}
else if(dancestyle == 3)
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE3);
SendClientMessage(playerid, -1,"You Are Now Dancing. Press Any Key To Stop.");
}
else if(dancestyle == 4)
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE4);
SendClientMessage(playerid, -1,"You Are Now Dancing. Press Any Key To Stop.");
}
}
return 1;
}