AOD Color
#8

I fixed the color thingy, however the label never gets deleted when you toggle aod off.
current code :
Код:
CMD:aod(playerid) //Doesnt need params function
{
	if(pData[playerid][Admin] >=1)
	{
		if (aod[playerid] == 0) //Check if player is on duty
		{
			new Float:x,Float:y,Float:z;
			new Text3D:label = Create3DTextLabel("{ff387a}Admin On Duty!", 0xff387a,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,9999); //makes player godmode
			SetPlayerColor(playerid,0xFF387AFF);//set the color
			SendClientMessage(playerid,COLOR_WHITE,"{ff387a}[Admin]:{ffffff} 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
			aod[playerid] = 1; //Set player on duty
		}
		else if (aod[playerid] == 1) //Check if player is on duty
		{
  			new Float:x,Float:y,Float:z;
  			new Text3D:label = Create3DTextLabel("{ff387a}Admin On Duty!", 0xff387a,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
     		SetPlayerToTeamColour(playerid);
			SendClientMessage(playerid, COLOR_WHITE,"{ff387a}[Admin]:{ffffff} You are now off duty."); //send admin message he is off duty
			aod[playerid] = 0; //sets admin off duty
		}
 	}
	else SendClientMessage(playerid,COLOR_WHITE,"{ff0000}[Error]:{ffffff} You are not authorized to use this command."); //Error message to send to players who arent admins
	return 1;
}
Reply


Messages In This Thread
AOD Color - by yvoms - 10.01.2016, 19:50
Re: AOD Color - by AbyssMorgan - 10.01.2016, 19:59
Re: AOD Color - by Jefff - 10.01.2016, 20:04
Re: AOD Color - by yvoms - 10.01.2016, 20:38
Re: AOD Color - by yvoms - 10.01.2016, 21:03
Re: AOD Color - by Jefff - 10.01.2016, 21:05
Re: AOD Color - by yvoms - 10.01.2016, 21:19
Re: AOD Color - by yvoms - 10.01.2016, 23:08
Re: AOD Color - by PrO.GameR - 11.01.2016, 06:26
Re: AOD Color - by yvoms - 11.01.2016, 12:04

Forum Jump:


Users browsing this thread: 1 Guest(s)