Dance command
#1

I want to make a dance command in"zcmd"
this is the code but it have some errors
pawn Код:
CMD:dance(playerid,params[]) {
          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;}
I think you guys can fix it easily and i am a beginner, plz fix it
Reply
#2

post the errors
Reply
#3

pawn Код:
C:\Documents and Settings\Ironboy\Desktop\0.3c package\SATDM v13 Latest\gamemodes\SATDM.pwn(26614) : error 017: undefined symbol "cmdtext"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#4

Change:
pawn Код:
tmp = strtok(cmdtext, idx);
To this:
pawn Код:
tmp = strtok(params, idx);
Reply
#5

now it shows like this
pawn Код:
C:\Documents and Settings\Ironboy\Desktop\0.3c package\SATDM v13 Latest\gamemodes\SATDM.pwn(26614) : error 017: undefined symbol "idx"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#6

Add this
pawn Код:
new idx;
Reply
#7

ok ty Fj0rtizFredde
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)