07.10.2011, 14:22
pawn Код:
new bool:AdminDuty[MAX_PLAYERS];//global variable
if(strcmp(cmd, "/aduty", true) == 0)
{
if(IsPlayerAdmin(playerid))//put here your variable that defines who is admin
{
new name1[MAX_PLAYER_NAME];
GetPlayerName(playerid, name1, sizeof(name1));
if(!AdminDuty[playerid])
{
format(string, sizeof(string), "%s has went on admin duty.",name1);
SendClientMessageToAll(COLOR_GREEN, string);
adminduty[playerid] = Create3DTextLabel("{F81414}ADMIN DUTY", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(adminduty[playerid], playerid, 0.0, 0.0, 0.7);
SendClientMessage(playerid, COLOR_GREEN, "You're on admin duty. If you want to go off duty type /aoduty.");
AdminDuty[playerid] = true;
}
else
{
format(string, sizeof(string), "%s has went off admin duty.",name2);
Delete3DTextLabel(adminduty[playerid]);
AdminDuty[playerid] = false;
}
}
}
return 1;
}

