/aduty
#1

Well here's the problem

Код:
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")
Line 160:
Код:
 if(PlayerInfo[playerid][AdminDuty] == 0)
Line 163:
Код:
 PlayerInfo[playerid][AdminDuty] = 1;
Line 174:
Код:
 PlayerInfo[playerid][AdminDuty] = 0;
The whole command

Код:
 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;
    }
Reply
#2

Show the declaration of PlayerInfo and AdminDuty.
Reply
#3

Never mind found the problem and fixed it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)