SA-MP Forums Archive
aduty command - 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 command (/showthread.php?tid=564759)



aduty command - Kursed - 23.02.2015

Код:
CMD:aduty(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, -1, "You are not authorized to use this command.");
	if(PlayerInfo[playerid][pAdminDuty] == 0)
	{

		SendClientMessageEx(playerid, COLOR_WHITE, ""LGHT_BLUE"[HLRP]: {FFFFFF}You are now on admin-duty. Your duty is to help others not yourselves (admin abuse).");
		PlayerInfo[playerid][pAdminDuty] = 1;
		SetPlayerHealth(playerid, 1);
		SetPlayerArmour(playerid, 100000);
		PlayerInfo[playerid][pChar] = GetPlayerSkin(playerid);

	}
	else
	{	SendClientMessageEx(playerid, COLOR_WHITE, ""LGHT_BLUE"[HLRP]: {FFFFFF}You are now off admin-duty. Resume roleplaying!");
		new string[128];
		SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);
		SetPlayerHealth(playerid, 100);
		SetPlayerArmour(playerid, 0);
		PlayerInfo[playerid][pAdminDuty] = 0;
	}
    return 1;
}
How do i add admin name, reset /stats/weapons/money to before he was on duty (doesnt save if he /givemoney to himself).



Код:
 if((PlayerInfo[playerid][pAdmin] > 4) && (PlayerInfo[playerid][pAdminDuty] == 0)) return SendClientMessage(playerid, COLOR_WHITE, "You must be on admin duty. ((/aduty))");
how to make it for players above admin lvl 4 doesnt need to be aduty? Thanks


Re: aduty command - -=Dar[K]Lord=- - 23.02.2015

Код:
CMD:aduty(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, -1, "You are not authorized to use this command.");
       if(PlayerInfo[playerid][pAdmin] <= 4)
       {
	if(PlayerInfo[playerid][pAdminDuty] == 0)
	{

		SendClientMessageEx(playerid, COLOR_WHITE, ""LGHT_BLUE"[HLRP]: {FFFFFF}You are now on admin-duty. Your duty is to help others not yourselves (admin abuse).");
		PlayerInfo[playerid][pAdminDuty] = 1;
		SetPlayerHealth(playerid, 1);
		SetPlayerArmour(playerid, 100000);
		PlayerInfo[playerid][pChar] = GetPlayerSkin(playerid);

	}
	else
	{	SendClientMessageEx(playerid, COLOR_WHITE, ""LGHT_BLUE"[HLRP]: {FFFFFF}You are now off admin-duty. Resume roleplaying!");
		new string[128];
		SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);
		SetPlayerHealth(playerid, 100);
		SetPlayerArmour(playerid, 0);
		PlayerInfo[playerid][pAdminDuty] = 0;
	}
    return 1;
}
else return SendClientMessage(playerid-1," You need not be on duty");
}
I didnt understand your first prob.... Tell me what exactly you want to do.


Re: aduty command - Abagail - 23.02.2015

I think you meant to do:

pawn Код:
if((PlayerInfo[playerid][pAdmin] <= 4) && (PlayerInfo[playerid][pAdminDuty] == 0)) return SendClientMessage(playerid, COLOR_WHITE, "You must be on admin duty. ((/aduty))");



Re: aduty command - Kursed - 23.02.2015

Quote:
Originally Posted by -=Dar[K]Lord=-
Посмотреть сообщение
Код:
CMD:aduty(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, -1, "You are not authorized to use this command.");
       if(PlayerInfo[playerid][pAdmin] <= 4)
       {
	if(PlayerInfo[playerid][pAdminDuty] == 0)
	{

		SendClientMessageEx(playerid, COLOR_WHITE, ""LGHT_BLUE"[HLRP]: {FFFFFF}You are now on admin-duty. Your duty is to help others not yourselves (admin abuse).");
		PlayerInfo[playerid][pAdminDuty] = 1;
		SetPlayerHealth(playerid, 1);
		SetPlayerArmour(playerid, 100000);
		PlayerInfo[playerid][pChar] = GetPlayerSkin(playerid);

	}
	else
	{	SendClientMessageEx(playerid, COLOR_WHITE, ""LGHT_BLUE"[HLRP]: {FFFFFF}You are now off admin-duty. Resume roleplaying!");
		new string[128];
		SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);
		SetPlayerHealth(playerid, 100);
		SetPlayerArmour(playerid, 0);
		PlayerInfo[playerid][pAdminDuty] = 0;
	}
    return 1;
}
else return SendClientMessage(playerid-1," You need not be on duty");
}
I didnt understand your first prob.... Tell me what exactly you want to do.
if he receieves money/weapons during aduty, its going to reset back to when is offduty.


Re: aduty command - NinjahZ - 23.02.2015

pawn Код:
CMD:aduty(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 2)
    {
        SendClientMessage(playerid, -1, "You are not authorized to use this command.");
    }
    else if(PlayerInfo[playerid][pAdmin] > 2)
    {
        if(PlayerInfo[playerid][pAdminDuty] == 0)
        {
            SendClientMessageEx(playerid, COLOR_WHITE, ""LGHT_BLUE"[HLRP]: {FFFFFF}You are now on admin-duty. Your duty is to help others not yourselves (admin abuse).");
            PlayerInfo[playerid][pAdminDuty] = 1;
            SetPlayerHealth(playerid, 1);
            SetPlayerArmour(playerid, 100000);
            PlayerInfo[playerid][pChar] = GetPlayerSkin(playerid);
        }
        else if(PlayerInfo[playerid][pAdminDuty] == 1)
        {
            SendClientMessageEx(playerid, COLOR_WHITE, ""LGHT_BLUE"[HLRP]: {FFFFFF}You are now off admin-duty. Resume roleplaying!");
            PlayerInfo[playerid][pAdminDuty] = 0;
            ResetPlayerWeapons(playerid);
            new string[128];
            SetPlayerHealth(playerid, 100);
            SetPlayerArmour(playerid, 0);
            SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);
        }
    }
    return 1;
}
You mean like this?


Re: aduty command - Kursed - 23.02.2015

Nah, they might have a weapon while off duty. Also their position resets.