dcmd_dance(playerid,params[])
{
if(!strval(params)) return SendClientMessage(playerid, RED, "Usage: /dance 1-4");
switch(strval(params))
{
case 0: SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE1);
case 1: SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE2);
case 2: SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE3);
case 3: SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE4);
}
return 1;
}
|
Originally Posted by WolfeX
why dont u just get http://forum.sa-mp.com/index.php?topic=143623.0 it's better than u making cmds
|


dcmd_dance(playerid,params[])
{
if(!strval(params)) return SendClientMessage(playerid, RED, "Usage: /dance 1-4");
switch(strval(params))
{
case 0:
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE1);
}
case 1:
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE2);
}
case 2:
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE3);
}
case 3:
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE4);
}
return 1;
}
|
Originally Posted by [03
Garsino ]
Quote:
2) I don't feel like making multiple commands for /dance 1-4 when I could make it with a simple switch and case... 3) I got other commands like this that it not in that thread... |
dcmd_Dance(playerid,params[])
{
new Style=playerid;
if (sscanf(params,"d",Style))
{
SendClientMessage(playerid,MSGCOMM_COLOR, "Usage: \"/Dance <Style (1-4)>\"");
}
else
{
if(Style<0 || Style>4)
{
new string[64];
format(string,sizeof(string),"Dance Style %d not available. Usage: \"/Dance <Style (1-4)>\"",Style);
SendClientMessage(BailID,0xff5555ff,string);
return 1;
}
if (Style==1)
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE1);
return 1;
}
else if (Style==2)
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE2);
return 1;
}
else if (Style==3)
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE3);
return 1;
}
else if (Style==4)
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE4);
return 1;
}
}
return 1;
}
|
Originally Posted by [03
Garsino ]
Yeah, I used ZCMD but hard a hard time converting all my commands. |