AOD Color
#3

pawn Код:
new Text3D:aod[MAX_PLAYERS];

// connect
aod[playerid] = Text3D:INVALID_3DTEXT_ID;

// disconnect
if(aod[playerid] != Text3D:INVALID_3DTEXT_ID)
{
    Delete3DTextLabel(aod[playerid]);
    aod[playerid] = Text3D:INVALID_3DTEXT_ID;
}

CMD:aod(playerid) //Doesnt need params function
{
    if(pData[playerid][Admin] < 1) SendClientMessage(playerid,COLOR_WHITE,"{ff0000}[Error]:{ffffff} You are not authorized to use this command."); //Error message to send to players who arent admins
    else
    {
        if(aod[playerid] == Text3D:INVALID_3DTEXT_ID) //Check if player is on duty
        {
            aod[playerid] = Create3DTextLabel("Admin On Duty!", 0xFF387AFF, 0.0, 0.0, 0.0, 40.0, 0, 0); //Creates 3d text label at player position
            SetPlayerHealth(playerid,999999.0); //makes player godmode
            SetPlayerColor(playerid,0xFF387AFF); //set admin colour red
            SendClientMessage(playerid,COLOR_WHITE,"You are now on duty!"); //Tell admin he is now on duty
            Attach3DTextLabelToPlayer(aod[playerid],playerid,0.0,0.0,0.7); //attach 3d text label made before to player
        }
        else //Check if player is on duty
        {
            Delete3DTextLabel(aod[playerid]); //Delete 3d text label saying "Admin On Duty!"
            SetPlayerHealth(playerid,100.0); //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] = Text3D:INVALID_3DTEXT_ID; //sets admin off duty
        }
    }
    return 1;
}
aod must be per player so you need MAX_PLAYERS array
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)