A simple Help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: A simple Help (
/showthread.php?tid=245298)
A simple Help -
Ironboy - 30.03.2011
Hello!
Can anybody tell me how to convert this strcmp command to zcmd?
Here is the code below
pawn Код:
if(strcmp(cmd, "/dance", true) == 0) {
new tmp[256];
new D_STYLE;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp) || strlen(tmp) > 2) {
SendClientMessage(playerid,0xFF0000FF,"USAGE: /dance [style 1-4]");
return 1;}
D_STYLE = strval(tmp);
if(D_STYLE < 1 || D_STYLE > 4) {
SendClientMessage(playerid,0xFF0000FF,"USAGE: /dance [style 1-4]");
return 1;}
if(D_STYLE == 1) {
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE1);
} else if(D_STYLE == 2) {
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE2);
} else if(D_STYLE == 3) {
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE3);
} else if(D_STYLE == 4) {
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE4);
}
return 1;}
Re: A simple Help -
admantis - 30.03.2011
Your identantion is a pure piece of shit and crap, but here is it.
pawn Код:
COMMAND:dance(playerid, params[]) {
new dance_style;
if (sscanf(params, "i", dance_style)) {
SendClientMessage(playerid,0xFF0000FF,"USAGE: /dance [style 1-4]");
return 1;}
if(dance_style < 1 || dance_style > 4) {
SendClientMessage(playerid,0xFF0000FF,"USAGE: /dance [style 1-4]");
return 1;}
if(dance_style == 1) {
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE1);
} else if(dance_style == 2) {
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE2);
} else if(dance_style == 3) {
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE3);
} else if(dance_style == 4) {
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE4);
}
return 1;}
Re: A simple Help -
Ironboy - 30.03.2011
ok thx its fixed