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



/aduty ZCMD - Blackazur - 25.12.2012

How to make an /aduty Command with ZCMD, so that the Admin is Invulnerable.


Re: /aduty ZCMD - `Lᴇᴏɴ - 25.12.2012

You need to post on 'scripting requests' ; Not make a thread related to this section.


Re: /aduty ZCMD - jNkk - 25.12.2012

pawn Code:
CMD:aduty(playerid, params[])
{
if(IsPlayerAdmin(playerid))
//if(PlayerInfo[playerid][pAdmin]>1)
{
SetPlayerHealth(playerid, 999);
}else{
SendClientMessage(playerid, RED, "you're not admin etc");
}
return 1;
}



Respuesta: /aduty ZCMD - Strier - 25.12.2012

Wrong


Re: /aduty ZCMD - TFreemen - 25.12.2012

Code:
enum pInfo
{       
     pAdmin,
     pAdminDuty,
};
new PlayerInfo[MAX_PLAYERS+1][pInfo];

CMD:aduty(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, -1, "This is an admin only command!");
	if(PlayerInfo[playerid][pAdminDuty] == 0)
	{

		SendClientMessage(playerid, COLOR_YELLOW, "You are now on administrative duty! ");
		PlayerInfo[playerid][pAdminDuty] = 1;
		SetPlayerHealth(playerid, 100000);
		SetPlayerArmour(playerid, 100000);
		new string[128];
		format(string, sizeof(string), "Administrator %s is now on Admin Duty! (/report for assistance)", GetPlayerNameEx(playerid));
		SendClientMessageToAllEx(COLOR_YELLOW, string);
	}
	else
	{
			SendClientMessageEx(playerid, COLOR_RED, "You are now off admin duty!");
			SetPlayerHealth(playerid, 100);
			SetPlayerArmour(playerid, 0);
			PlayerInfo[playerid][pAdminDuty] = 0;
	}
    return 1;
}
BTW don`t forget to define the colors


Re: /aduty ZCMD - Randy More - 25.12.2012

Quote:
Originally Posted by TFreemen
View Post
Code:
enum pInfo
{       
     pAdmin,
     pAdminDuty,
};

CMD:aduty(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, -1, "This is an admin only command!");
	if(PlayerInfo[playerid][pAdminDuty] == 0)
	{

		SendClientMessage(playerid, COLOR_YELLOW, "You are now on administrative duty! Remember to check /reports!");
		PlayerInfo[playerid][pAdminDuty] = 1;
		SetPlayerHealth(playerid, 100000);
		SetPlayerArmour(playerid, 100000);
		new string[128];
		format(string, sizeof(string), "Administrator %s is now on Admin Duty! (/report for assistance)", GetPlayerNameEx(playerid));
		SendClientMessageToAllEx(COLOR_YELLOW, string);
	}
	else
	{
			SendClientMessageEx(playerid, COLOR_RED, "You are now off admin duty!");
			SetPlayerHealth(playerid, 100);
			SetPlayerArmour(playerid, 0);
			PlayerInfo[playerid][pAdminDuty] = 0;
	}
    return 1;
}
Since you just made the whole thing, you forgot to add the variable of PlayerInfo.


Re: /aduty ZCMD - Konstantinos - 25.12.2012

Quote:
Originally Posted by Randy More
View Post
Since you just made the whole thing, you forgot to add the variable of PlayerInfo.
He didn't forget to add it, he just copied and pasted the command here, and since it's wrong section it's better to just describe him how to make the command. Not giving a finished command.


Re: /aduty ZCMD - TFreemen - 25.12.2012

Quote:
Originally Posted by Dwane
View Post
He didn't forget to add it, he just copied and pasted the command here, and since it's wrong section it's better to just describe him how to make the command. Not giving a finished command.
This CMD is made by me on my GM.Yes is copy paste but is made by me.


Re: /aduty ZCMD - Infinity90 - 25.12.2012

pawn Code:
//top of your script
new AdminStatus;

CMD:aduty(playerid,params[])
{
    if(IsPlayerAdmin(playerid))
    {
        if(!AdminStatus)
        {
        AdminStatus = 1;
        SetPlayerHealth(playerid,9999);
        }
        else
        {
        AdminStatus = 0;
        SetPlayerHealth(playerid,100);
        }
    }
    return 1;
}



Respuesta: /aduty ZCMD - Strier - 25.12.2012

pawn Code:
//Top
 new AdminDuty[MAX_PLAYERS_NAME];
 new Text3D:label[MAX_PLAYERS];

CMD:aduty(playerid,params[])
{
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ORANGE, "[*] You're not a level 1+ admin!");
    if(AdminDuty[playerid] == 1)
    {
        AdminDuty[playerid] = 0;
        SendClientMessage(playerid,COLOR_BLUE,"You are now off duty!");
        SpawnPlayer(playerid);
        new string[128], pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
        format(string, sizeof(string), "%s[%d] is now off duty!", pName, playerid);
        SendClientMessageToAll(COLOR_RED, string);
    }
    else
    {
        SendClientMessage(playerid,COLOR_ORANGE,"You are now a admin on duty !");
        SendClientMessage(playerid,COLOR_ORANGE,"You have set a label to you, it means that you ARE a admin so now is your playercolor LIGHTBLUE !");
        SendClientMessage(playerid,COLOR_ORANGE,"THIS MEANS TOO : YOU DON'T FIGHT AGAINST OTHER PLAYERS ! YOU'RE ON DUTY !!");
        label[playerid] = Create3DTextLabel("Admin On Duty! Do not attack!",0x008080FF,30.0,40.0,50.0,40.0,0);
        Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
        SetPlayerColor(playerid, 0xFFC0CBAA);
        ResetPlayerWeapons(playerid);
        GivePlayerWeapon(playerid,38,1000); GivePlayerWeapon(playerid,24,1000);
        GivePlayerWeapon(playerid,9,1);
        AdminDuty[playerid] = 1;
        SetPlayerSkin(playerid, 219);
        new string[128], pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
        format(string, sizeof(string), "%s[%d] is now on admin duty!", pName, playerid);
        SendClientMessageToAll(COLOR_RED, string);
    }
    return 1;
}
Off duty - On duty with a 3dtextlabel