24.03.2009, 18:10
I have gamemode GodFather, but i did copy code this admin on duty from Los Angeles RP source...
COMPILER ERROR:
Код:
//-------------------------------[admin duty]---------------------------------------------------------------- if(!strcmp(cmdtext, "/aod", true)) // By Ellis { if(IsPlayerConnected(playerid)) { if(gPlayerLogged[playerid] == 0) { SendClientMessage(playerid, COLOR_GREY, " You need to login first !"); return 1; } if(PlayerInfo[playerid][pAdmin] > 0) { if(AdminDuty[playerid] == 0) { AdminDuty[playerid] = 1; SetPlayerArmour(playerid, 999); SetPlayerHealth(playerid, 999); SetPlayerColor(playerid,TEAM_VAGOS_COLOR); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "Teade: [ID:%d]%s on admin duty.", playerid, sendername); ABroadCast(COLOR_YELLOW,string,1); if(PlayerInfo[playerid][pAdmin] >= 1337) { for(new i = 0; i < sizeof(CarInfo); i++) { SetVehicleParamsForPlayer(i,playerid,0,0); } } return 1; } else if(AdminDuty[playerid] == 1) { AdminDuty[playerid] = 0; SetPlayerArmour(playerid, 0); SetPlayerHealth(playerid, 100); SetPlayerColor(playerid,TEAM_HIT_COLOR); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "Teade: [ID:%d]%s off admin duty.", playerid, sendername); ABroadCast(COLOR_YELLOW,string,1); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, " You're not the admin !"); return 1; } } return 1; }
Код:
C:\Documents and Settings\Owner\Desktop\sa-mp server\gamemodes\gf.pwn(8179) : error 017: undefined symbol "AdminDuty" C:\Documents and Settings\Owner\Desktop\sa-mp server\gamemodes\gf.pwn(8179) : warning 215: expression has no effect C:\Documents and Settings\Owner\Desktop\sa-mp server\gamemodes\gf.pwn(8179) : error 001: expected token: ";", but found "]" C:\Documents and Settings\Owner\Desktop\sa-mp server\gamemodes\gf.pwn(8179) : error 029: invalid expression, assumed zero C:\Documents and Settings\Owner\Desktop\sa-mp server\gamemodes\gf.pwn(8179) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.