SA-MP Forums Archive
/aduty - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /aduty (/showthread.php?tid=315489)



/aduty - DannySnoopy - 03.02.2012

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;
    }



Re: /aduty - MP2 - 03.02.2012

Show the declaration of PlayerInfo and AdminDuty.


Re: /aduty - DannySnoopy - 03.02.2012

Never mind found the problem and fixed it.