15.02.2012, 07:11
I tried to make setadmin command but i have these errors.
Here is the code:
I have include zcmd but still these errors.
Код:
C:\Documents and Settings\user\Desktop\server samp\gamemodes\testserver.pwn(1611) : error 029: invalid expression, assumed zero C:\Documents and Settings\user\Desktop\server samp\gamemodes\testserver.pwn(1611) : error 017: undefined symbol "cmd_setadmin" C:\Documents and Settings\user\Desktop\server samp\gamemodes\testserver.pwn(1611) : error 029: invalid expression, assumed zero C:\Documents and Settings\user\Desktop\server samp\gamemodes\testserver.pwn(1611) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
Код:
CMD:setadmin(playerid, params[]) { if(!IsPlayerAdmin(playerid))return 0; if(sscanf(params,"ui",ID,levels)) return SendClientMessage(playerid, COLOR, ""RED"USAGE:/setadmin [ID] [Level 1-5]"); if(levels > 5) return SendClientMessage(playerid, COLOR_SEAGREEN,"LEVELS AVAILABLE 1-4!"); if(!IsPlayerConnected(ID))return SendClientMessage(playerid, COLOR,""RED"That user is not connected."); if(PlayerInfo[ID][pAdmin] == levels) return SendClientMessage(playerid, COLOR, ""RED"[Warning]:That person is already admin!"); GetPlayerName(playerid,Nam, MAX_PLAYER_NAME); GetPlayerName(ID,tname,MAX_PLAYER_NAME); if(levels == 0) { format(string, sizeof(string),""GREEN"%s has given you Admin level %d.",Nam,levels); SendClientMessage(ID, COLOR,string); format(str, sizeof(str),""GREEN"You have given %s Admin level %d!",tname,levels); SendClientMessage(playerid, COLOR,string); PlayerInfo[ID][pAdmin] = levels; return 1; } format(string, sizeof(string),""GREEN"%s has given you Admin level %d.",Nam,levels); SendClientMessage(ID, COLOR,string); format(string, sizeof(string),""GREEN"You have given %s Admin level %d!",tname,levels); SendClientMessage(playerid, COLOR,string); PlayerInfo[ID][pAdmin] = levels; return 1; }