13.01.2010, 14:17
Hey all,
I have a question regarding cuffing.
That are the errors I get, and this is the script I use:
And does anyone have a tutorial or something regarding formatting/indexing?
I'm still a noob, so don't go hard on me
Thanks.
I have a question regarding cuffing.
Код:
C:\Documents and Settings\Administrator\Mijn documenten\SAMP Server\gamemodes\SWAT.pwn(889) : error 017: undefined symbol "strtok" C:\Documents and Settings\Administrator\Mijn documenten\SAMP Server\gamemodes\SWAT.pwn(889) : error 033: array must be indexed (variable "cmd") C:\Documents and Settings\Administrator\Mijn documenten\SAMP Server\gamemodes\SWAT.pwn(890) : error 017: undefined symbol "strtok" C:\Documents and Settings\Administrator\Mijn documenten\SAMP Server\gamemodes\SWAT.pwn(890) : error 033: array must be indexed (variable "tmp") C:\Documents and Settings\Administrator\Mijn documenten\SAMP Server\gamemodes\SWAT.pwn(891) : error 001: expected token: ")", but found "return" C:\Documents and Settings\Administrator\Mijn documenten\SAMP Server\gamemodes\SWAT.pwn(893) : error 001: expected token: ";", but found "if" C:\Documents and Settings\Administrator\Mijn documenten\SAMP Server\gamemodes\SWAT.pwn(897) : error 017: undefined symbol "giveplayer" C:\Documents and Settings\Administrator\Mijn documenten\SAMP Server\gamemodes\SWAT.pwn(897) : error 017: undefined symbol "giveplayer" C:\Documents and Settings\Administrator\Mijn documenten\SAMP Server\gamemodes\SWAT.pwn(899) : error 001: expected token: ",", but found ";" C:\Documents and Settings\Administrator\Mijn documenten\SAMP Server\gamemodes\SWAT.pwn(1041) : warning 203: symbol is never used: "giveplayername" C:\Documents and Settings\Administrator\Mijn documenten\SAMP Server\gamemodes\SWAT.pwn(1041) : warning 203: symbol is never used: "idx" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 9 Errors.
Код:
(THESE ARE AT TOP OF SCRIPT) 29 new tmp[128]; 30 new idx; 31 new giveplayerid; 32 new giveplayername[MAX_PLAYER_NAME]; 33 new sendername[MAX_PLAYER_NAME]; 886 new cmd[30]; 887 if(strcmp(cmd, "/cuff", true) == 0) 888 { 889 cmd = strtok(cmdtext, idx); 890 tmp = strtok(cmdtext,idx); 891 if(!strlen(tmp) return SendClientMessage(playerid, white, "USAGE: /cuff playerid"); 892 giveplayerid = strval(tmp) 893 if(gTeam[playerid] == TEAM_SWAT) 894 { 895 if(gTeam[giveplayerid] == TEAM_SWAT) return SendClientMessage(playerid,white, "You can not cuff cops or SWAT."); 896 TogglePlayerControllable(giveplayerid,0); 897 format(tmp, sizeof(tmp),"You have cuffed %s", GetPlayerName(giveplayerid,giveplayer,sizeof(giveplayer)); 898 SendClientMessage(playerid,blue,tmp); 899 format(tmp, sizeof(tmp),"You have been cuffed by %s", GetPlayerName(playerid,sendername,sizeof(sendername)); 900 return 1; 901 } 902 return 1; 903 }
I'm still a noob, so don't go hard on me
Thanks.