03.02.2012, 13:39
Well here's the problem
Line 160:
Line 163:
Line 174:
The whole command
Код:
C:\Users\User\Desktop\samp03dsvr_R2_win32\gamemodes\Danny.pwn(160) : error 033: array must be indexed (variable "AdminDuty") C:\Users\User\Desktop\samp03dsvr_R2_win32\gamemodes\Danny.pwn(163) : error 033: array must be indexed (variable "AdminDuty") C:\Users\User\Desktop\samp03dsvr_R2_win32\gamemodes\Danny.pwn(174) : error 033: array must be indexed (variable "AdminDuty")
Код:
if(PlayerInfo[playerid][AdminDuty] == 0)
Код:
PlayerInfo[playerid][AdminDuty] = 1;
Код:
PlayerInfo[playerid][AdminDuty] = 0;
Код:
if(strcmp(cmd, "/aduty", true) == 0) { GetPlayerName(playerid, AdminName, sizeof(playerid)); if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][AdminLevel] >= 1) { if(PlayerInfo[playerid][AdminDuty] == 0) { SetPlayerColor(playerid, COLOR_LIGHTBLUE); PlayerInfo[playerid][AdminDuty] = 1; SendClientMessage(playerid, COLOR_YELLOW, "You are now on-duty as an admin, Please do your best!."); SetPlayerHealth(playerid, 999); SetPlayerArmour(playerid, 999); format(string, sizeof(string), "%s is now on-duty as an admin.", AdminName); SendClientMessageToAll(COLOR_GREEN, string); return 1; } else { SetPlayerColor(playerid, COLOR_YELLOW); PlayerInfo[playerid][AdminDuty] = 0; SendClientMessage(playerid, COLOR_YELLOW, "You are not longer on-duty as admin, notice to /reports please!."); SetPlayerHealth(playerid, 100); SetPlayerArmour(playerid, 0); format(string, sizeof(string), "%s is no longer on-duty as admin.", AdminName); SendClientMessageToAll(COLOR_RED, string); return 1; } } else { SendClientMessage(playerid, COLOR_YELLOW, " you are not authorized to use that command!"); } } return 1; }