18.03.2012, 18:28
Hmm i got 5 errors
there is the ERRORS
Код:
CMD:makeadmin(playerid, params[]) { new cmd[256]; new index; cmd = strtok(cmdtext, index); if(!strcmp(cmd, "/makeadmin", true)) { if(IsPlayerAdmin(playerid) || aLevel[playerid] == 2) // You must be RCon logged or aLevel 2 to make someone an admin { new param1[256]; param1 = strtok(cmdtext, index); new param2[256]; param2 = strtok(cmdtext, index); new player = strval(param1); new level = strval(param2); if(!IsPlayerConnected(player)) return 0; if(level < 0 || level > 2) return 0; aLevel[player] = level; SendClientMessage(playerid, 0x00FF00FF, "You have made this player an admin."); SendClientMessage(player, 0x00FF00FF, "You are now an admin."); return 1; } } } stock strtok(const string[], &index) { new length = strlen(string); while ((index < length) && (string[index] <= ' ')) { index++; } new offset = index; new result[20]; while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1))) { result[index - offset] = string[index]; index++; } result[index - offset] = EOS; return result; }
Код:
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(8) : error 017: undefined symbol "MAX_PLAYERS" C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(8) : error 009: invalid array size (negative, zero or out of bounds) C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(795) : error 017: undefined symbol "cmdtext" C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(802) : error 017: undefined symbol "cmdtext" C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(804) : error 017: undefined symbol "cmdtext" C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(794) : warning 203: symbol is never used: "index" C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(794 -- 818) : warning 209: function "cmd_makeadmin" should return a value Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.