04.10.2009, 16:11
Hey i need a hand, I want to code a /setlevel command, I have this but it doesn't work heres what i have:
Heres the errors
C:\Users\user\Desktop\SAMP Server\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(43 : error 017: undefined symbol "tmp"
C:\Users\user\Desktop\SAMP Server\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(43 : error 017: undefined symbol "idx"
C:\Users\user\Desktop\SAMP Server\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(439) : error 017: undefined symbol "tmp"
C:\Users\user\Desktop\SAMP Server\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(444) : error 017: undefined symbol "ReturnUser"
C:\Users\user\Desktop\SAMP Server\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(445) : error 017: undefined symbol "tmp"
C:\Users\user\Desktop\SAMP Server\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(445) : error 017: undefined symbol "idx"
C:\Users\user\Desktop\SAMP Server\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(446) : warning 219: local variable "level" shadows a variable at a preceding level
C:\Users\user\Desktop\SAMP Server\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(446) : error 017: undefined symbol "tmp"
C:\Users\user\Desktop\SAMP Server\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(451) : error 017: undefined symbol "giveplayername"
C:\Users\user\Desktop\SAMP Server\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(451) : error 017: undefined symbol "giveplayername"
C:\Users\user\Desktop\SAMP Server\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(451) : error 029: invalid expression, assumed zero
C:\Users\user\Desktop\SAMP Server\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(451) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
11 Errors.
Код:
dcmd_setlevel(playerid,params[]) { if (level[playerid] >= 5) { tmp = strtok(params, idx); if(!strlen(tmp)) { SendClientMessage(playerid, orange, "Error: /setlevel [playerid] [level 1-5]"); return 1; } new giveplayerid = ReturnUser(tmp, playerid); tmp = strtok(params, idx); new level = strval(tmp); if(giveplayerid != INVALID_PLAYER_ID) { if (level >= 0) { GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername)); GetPlayerName(playerid, sendername, sizeof(sendername)); printf("ADMIN: %s made %s a level %d admin.", sendername, giveplayername, level); format(string, sizeof(string), "You are now an administrator level %d thanks to %s.", level, sendername); SendClientMessage(giveplayerid, blue, string); format(string, sizeof(string), "Administrator %s has given %s an Admin Level. [Level: %d]", sendername,giveplayername,level); SendClientMessageToAdmins(orange, string, 1); level[giveplayerid] = level; format(string, sizeof(string), "You have given %s level %d admin.", giveplayername,AccountInfo[giveplayerid][AdminLevel]); SendClientMessage(playerid, blue, string); } else return SendClientMessage(playerid, RED, "You need to set a player above level 0."); } else if(giveplayerid == INVALID_PLAYER_ID) { format(string, sizeof(string), "%i is not an active player.", giveplayerid); SendClientMessage(playerid, RED, string); } } else SendClientMessage(playerid, RED, "Error: You need to be a administrator to use this command"); return 1; }
C:\Users\user\Desktop\SAMP Server\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(43 : error 017: undefined symbol "tmp"
C:\Users\user\Desktop\SAMP Server\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(43 : error 017: undefined symbol "idx"
C:\Users\user\Desktop\SAMP Server\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(439) : error 017: undefined symbol "tmp"
C:\Users\user\Desktop\SAMP Server\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(444) : error 017: undefined symbol "ReturnUser"
C:\Users\user\Desktop\SAMP Server\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(445) : error 017: undefined symbol "tmp"
C:\Users\user\Desktop\SAMP Server\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(445) : error 017: undefined symbol "idx"
C:\Users\user\Desktop\SAMP Server\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(446) : warning 219: local variable "level" shadows a variable at a preceding level
C:\Users\user\Desktop\SAMP Server\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(446) : error 017: undefined symbol "tmp"
C:\Users\user\Desktop\SAMP Server\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(451) : error 017: undefined symbol "giveplayername"
C:\Users\user\Desktop\SAMP Server\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(451) : error 017: undefined symbol "giveplayername"
C:\Users\user\Desktop\SAMP Server\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(451) : error 029: invalid expression, assumed zero
C:\Users\user\Desktop\SAMP Server\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(451) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
11 Errors.