Admin Duty
#8

Quote:
Originally Posted by KyNe
Посмотреть сообщение
Код:
CMD:aduty(playerid,params[]) //Doesnt need params function
{
	if(PlayerInfo[playerid][Level] >=1 || IsPlayerAdmin(playerid)) //If you use rcon admin delete (PlayerInfo[playerid][pAdmin] >=1 ||
	{
		if (adminDuty[playerid] == 0) //Check if player is on duty
		{
			new Float:x,Float:y,Float:z;
			new Text3D:label = Create3DTextLabel("Admin On Duty!", COLOR_RED,x,y,z, 40.0, 0, 0); //Creates 3d text label at player position
			GetPlayerPos(playerid,x,y,z); //Looks for players position
			SetPlayerHealth(playerid,100000); //makes player godmode
			SetPlayerColor(playerid,COLOR_RED); //set admin colour red
			SetPlayerSkin(playerid,217); //set admin skin to 294
			GivePlayerWeapon(playerid,38,0);
			new string[128]; format(string, sizeof(string), "{FF0000} %s is now on Duty!", PlayerName2(playerid), params[0] ); //here you format string to send to players
			SendClientMessageToAll(COLOR_RED,string); //send string to players
			SendClientMessage(playerid,COLOR_BLUE,"You are now on duty!"); //Tell admin he is now on duty
			Attach3DTextLabelToPlayer(label,playerid,0.0, 0.0, 0.7); //attach 3d text label made before to player
			adminDuty[playerid] = 1; //Set player on duty
		}
		else if (adminDuty[playerid] == 1) //Check if player is on duty
		{
  			new Float:x,Float:y,Float:z;
  			new Text3D:label = Create3DTextLabel("Admin On Duty!", COLOR_RED,x,y,z, 40.0, 0, 0);
  			Delete3DTextLabel(label); //Delete 3d text label saying "Admin On Duty!"
  			SetPlayerHealth(playerid,100); //sets player health back to 100
			new string[128]; format(string, sizeof(string), "{FF0000} %s is now off Duty!", PlayerName2(playerid), params[0] ); //Format string to send to players
			SendClientMessageToAll(COLOR_RED,string); //send players string
			SendClientMessage(playerid,COLOR_BLUE,"You are now off duty!"); //send admin message he is off duty
			adminDuty[playerid] = 0; //sets admin off duty
			ForceClassSelection(playerid);
			SetPlayerHealth(playerid, 0);
		}
 	}
	else
		SendClientMessage(playerid,COLOR_RED,"You are not high level enough!"); //Error message to send to players who arent admins
	return 1;
}
done,but how to make this

when admin duty on,and admin use /kill

they will spawn with Default skin?

how to make they spawn with admin duty skin ( when admin duty on )?
Add into onplayerspawn:
if (adminDuty[playerid] == 1)
{
SetPlayerSkin(playerid, 294);
}
Reply


Messages In This Thread
Admin Duty - by KyNe - 19.12.2017, 07:58
Re: Admin Duty - by RogueDrifter - 19.12.2017, 08:21
Re: Admin Duty - by KyNe - 19.12.2017, 08:23
Re: Admin Duty - by RogueDrifter - 19.12.2017, 08:26
Re: Admin Duty - by KyNe - 19.12.2017, 08:58
Re: Admin Duty - by 0x88 - 19.12.2017, 09:00
Re: Admin Duty - by Argument - 19.12.2017, 10:10
Re: Admin Duty - by jasperschellekens - 19.12.2017, 10:27

Forum Jump:


Users browsing this thread: 2 Guest(s)