01.06.2012, 16:42
Place this in the OnPlayerConnect callback
Command using ZCMD
Glad to help.
Код:
if(PlayerInfo[playerid][pAdmin] >= 1) { PlayerInfo[playerid][pAdminDuty] = 0; }
Код:
CMD:aduty(playerid, params[]) { new pName[MAX_PLAYER_NAME]; new string[128]; if(PlayerInfo[playerid][pAdmin] >= 1) { if(PlayerInfo[playerid][pAdminDuty] == 1) { PlayerInfo[playerid][pAdminDuty] = 1; SetPVarInt(playerid, "LastSkin", GetPlayerSkin(playerid)); SetPlayerSkin(playerid, 294); SetPlayerColor(playerid, COLOR_LIGHTBLUE); GetPlayerName(playerid, pName, sizeof(pName)); format(string, sizeof(string), "** Administrator %s is now on admin duty. **", pName); for(new i = 0; i < MAX_PLAYERS; i++) { if(PlayerInfo[i][pAdmin] >= 1) { SendClientMessage(i, COLOR_YELLOW, string); } } } else if(PlayerInfo[playerid][pAdminDuty] == 0) { PlayerInfo[playerid][pAdminDuty] = 0; SetPlayerSkin(playerid, GetPVarInt(playerid, "LastSkin")); SetPlayerColor(playerid, COLOR_WHITE); GetPlayerName(playerid, pName, sizeof(pName)); format(string, sizeof(string), "** Administrator %s is now off admin duty. **", pName); for(new i = 0; i < MAX_PLAYERS; i++) { if(PlayerInfo[i][pAdmin] >= 1) { SendClientMessage(i, COLOR_YELLOW, string); } } } } else return SendClientMessage(playerid, COLOR_GREY, ".:: You are not authorized to use this feature ::."); return 1; }