Quote:
Originally Posted by Opah
if i was u i would on the command that sets aDuty[playerid] == 1 write
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; }
for the on radar thing if u want that all players don't appear on the radar but only if they have aDuty[playerid] == 1
then
pawn Код:
#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; }
|
Very bad idea to loop through all players under OnPlayerUpdate.