14.07.2012, 18:54
How do I make it so if an admin has "aDuty[playerid] == 1" then the admins marker shows in lime (COLOR_LIME) to all the players?
if(IsPlayerAdmin(playerid))
{
SetPlayerColor(playerid, COLOR_LIME);
return 1:
}
If player is rcon admin then his name color and icon color will be lime color
pawn Код:
|
new admincolor;
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/adutyon", true))
{
if(IsPlayerAdmin(playerid) == 0) return SendClientMessage(playerid,COLOR_RED,"You can't use this command !");
aDuty[playerid] == 1
admincolor = GetPlayerColor(playerid);
SetPlayerColor(playerid,COLOR_LIME);
return 1;
}
if(!strcmp(cmdtext, "/adutyoff", true))
{
if(IsPlayerAdmin(playerid) == 0) return SendClientMessage(playerid,COLOR_RED,"You can't use this command !");
aDuty[playerid] == 0
SetPlayerColor(playerid,admincolor);
return 1;
}
return 0;
}
#define invisible 0xFFFFFF00
public OnPlayerUpdate(playerid)
{
for(new i=0; i<MAXPLAYERS; i++)
{
if(aDuty[playerid] == 0){SetPlayerMarkerForPlayer(playerid, i, GetPlayerColor(playerid) & invisible);}
else{SetPlayerMarkerForPlayer(playerid, i, COLOR_LIME & COLOR_LIME);}
}
return 1;
}
if i was u i would on the command that sets aDuty[playerid] == 1 write
pawn Код:
then pawn Код:
|
Thanks, where do I place this, OnGameModeInIt?
Also, does this show me on the map so other players can see where I am? |
public OnPlayerConnect(playerid)
ShowPlayerMarkers(PLAYER_MARKERS_MODE_GLOBAL)
public OnGameModeInit()