[URGENT] Help with aduty
#1

My problem is that when i use /aduty then log off and forgot to be off duty and when i again join server and try to /aduty again it says that Administrator is now off duty. I mean to say that isn't there anything to do that if a On duty admin disconnects and he automatically goes offduty? Cuz when i log in and write /aduty to be off duty i get skin bug at that time.Any ideas?
Reply
#2

I Think check on ONPLAYERDISCONNECT ....


More Help contact in scripting contact me on ********.com/usamakhalid666
Reply
#3

Show the /aduty code:
Reply
#4

here it is
Код:
CMD:aduty(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 1)
	{
	    if(PlayerInfo[playerid][pAdminDuty] == 0)
	    {
			new playername[MAX_PLAYER_NAME];
			GetPlayerName(playerid, playername, sizeof(playername));
			new string[120];
			if(PlayerInfo[playerid][pAdminNameSet] == 0)
 			{
				return SendClientMessage(playerid, -1, "You must set your admin name before going on duty.( /aname )");
   			}
			// SetPlayerName(playerid, PlayerInfo[playerid][pAdminName]);
			SetPlayerName(playerid, PlayerInfo[playerid][pAdminName]);
			format(string, sizeof(string), "** Administrator %s is now on admin duty. (/report for assistance) **", GetPlayerNameEx(playerid));
			SendClientMessageToAllEx(COLOR_YELLOW, string);
			PlayerInfo[playerid][pAdminNameSet] = 1;
			PlayerInfo[playerid][pAdminDuty] = 1;
			SetPVarInt(playerid, "LastSkin", GetPlayerSkin(playerid));
			SetPlayerSkin(playerid, 294);
			SetPlayerHealth(playerid, 100000);
			SetPlayerArmour(playerid, 100000);
			

			format(string, sizeof(string), "users/%s.ini", playername);
			fremove(string);
			OnPlayerStatsUpdate(playerid);
			return 1;
		}
		else if(PlayerInfo[playerid][pAdminDuty] == 1)
	    {
			new playername[MAX_PLAYER_NAME];
			GetPlayerName(playerid, playername, sizeof(playername));
			new string[120];
			if(PlayerInfo[playerid][pNormalNameSet] == 0)
 			{
				return SendClientMessage(playerid, -1, "You must set your player name before going off duty.( /playername )");
   			}
			format(string, sizeof(string), "** Administrator %s is now off admin duty. **", GetPlayerNameEx(playerid));
			SendClientMessageToAllEx(COLOR_YELLOW, string);
			PlayerInfo[playerid][pNormalNameSet] = 1;
			PlayerInfo[playerid][pAdminDuty] = 0;
			SetPlayerSkin(playerid, GetPVarInt(playerid, "LastSkin"));
			SetPlayerHealth(playerid, 100);
			SetPlayerArmour(playerid, 100);

			format(string, sizeof(string), "users/%s.ini", playername);
			fremove(string);
			SetPlayerName(playerid, PlayerInfo[playerid][pNormalName]);
			OnPlayerStatsUpdate(playerid);

			return 1;
		}
	}
	return SendClientMessage(playerid, COLOR_GRAD2, NOTADMIN);
}
Reply
#5

Under OnplayerConnect

Код:
PlayerInfo[playerid][pAdminDuty] = 0;
Reply
#6

Not working
Reply
#7

maybe you get adminduty from db and not update db when exit
Reply
#8

So any fix?
Reply
#9

any fix?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)