SA-MP Forums Archive
Problems - 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: Problems (/showthread.php?tid=513794)



Problems - Madalyinn - 18.05.2014

If you give /aod /hod color disappears in 30 seconds after I could kill anyone with /aod /hod enabled.

pawn Код:
//-------------------------------------[AOD]-----------------
   if(strcmp(cmd, "/aod", true) == 0)
    {
        if (PlayerInfo[playerid][pAdmin] >= 1)
        {
            if(AdminDuty[playerid] == 1)
            {
                       GetPlayerName(playerid, sendername, sizeof(sendername));
                       format(string, sizeof(string), "[Admin Info]: Administrator %s [ID:%d] is now off duty.", sendername,playerid);
                       SendClientMessageToAll(0xFF5B5BFF,string);
                       AdminDuty[playerid] = 0;
                       SetPlayerHealth(playerid,100);
                       SetPlayerArmour(playerid,0);
                       SetPlayerToTeamColor(playerid);
            }
            else
            {
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "[Admin Info]: Administrator %s [ID:%d] is now on duty.",sendername,playerid);
                SendClientMessageToAll(0xFF5B5BFF,string);
                AdminDuty[playerid] = 1;
                SetPlayerHealth(playerid,9999);
                SetPlayerArmour(playerid,9999);
                SetPlayerColor(playerid,0xFF5B5BFF);
                RepairVehicle(GetPlayerVehicleID(playerid));
                for(new i = 0; i < MAX_PLAYERS; i ++)
                {
                    if(IsPlayerConnected(i))
                    {
                        SetPlayerMarkerForPlayer( i,playerid,0xFF5B5BFF );
                    }
                }
            }
        }
        else
        {
            SendClientMessage(playerid,COLOR_GREY,"You are not an Admin.");
        }
        return 1;
    }
//---------------------------------------[HOD]-----------------------------------------
     if(strcmp(cmd, "/hod", true) == 0)
    {
        if(PlayerInfo[playerid][pHelper] >= 1 && PlayerInfo[playerid][pHelper] <= 4)
        {
            if(HelperDuty[playerid] == 1)
            {
                       GetPlayerName(playerid, sendername, sizeof(sendername));
                       format(string, sizeof(string), "[Helper Info]: Helperul %s [ID:%d] is now off duty.", sendername,playerid);
                       SendClientMessageToAll(0xFF5B5BFF,string);
                       HelperDuty[playerid] = 0;
                       SetPlayerHealth(playerid,100);
                       SetPlayerArmour(playerid,0);
                       SetPlayerToTeamColor(playerid);

            }
            else
            {
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "[Helper Info]: Helper %s [ID:%d] is now on duty.",sendername,playerid);
                SendClientMessageToAll(0xFF5B5BFF,string);
                HelperDuty[playerid] = 1;
                SetPlayerHealth(playerid,100);
                SetPlayerArmour(playerid,100);
                SetPlayerColor(playerid,0xFF5B5BFF);
                RepairVehicle(GetPlayerVehicleID(playerid));
                for(new i = 0; i < MAX_PLAYERS; i ++)
                {
                    if(IsPlayerConnected(i))
                    {
                        SetPlayerMarkerForPlayer( i,playerid,0xFF5B5BFF );
                    }
                }
            }
        }
        else
        {
            SendClientMessage(playerid,COLOR_GREY,"You are not a Helper !");
        }
        return 1;
    }



Re: Problems - Ciandlah - 18.05.2014

Well, if it is disappearing then you must have a timer set that is disabling the status.


Re: Problems - Madalyinn - 18.05.2014

And how to find that timer?


Re: Problems - JFF - 18.05.2014

Check all the timers and see to which public they call then check what the public do

when u find a public that setplayercolor post it here


Re: Problems - Madalyinn - 18.05.2014

pawn Код:
if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1)
        {
        if(AdminDuty[playerid] == 1)
        SetPlayerColor(playerid,0xFF5B5BFF);
        if(HelperDuty[playerid] == 1)
        SetPlayerColor(playerid,0xFF5B5BFF);
        }

this?