25.12.2012, 10:54
Hey guys,
i made this cmd for Admins:
/makeadmin
Can someone make same for VIP?
my Enum:
Thanks.
i made this cmd for Admins:
/makeadmin
Код:
COMMAND:makeadmin(playerid, params[]) { new id; new AdminLevel2; if(IsPlayerConnected(id)) { if(PlayerInfo[playerid][AdminLevel] >= 5 || IsPlayerAdmin(playerid)) { if(!sscanf(params, "ui", id, AdminLevel2)) { if((AdminLevel2 >= 1 && AdminLevel2 <= 5) || AdminLevel2 == 0) { new string[64]; new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); GetPlayerName(id, PlayerName, sizeof(PlayerName)); format(string, sizeof(string), "%s Has Promoted you to Admin Level %d.", name, AdminLevel2); SendClientMessage(id, 0xD8D8D8FF, string); format(string, sizeof(string), "You Have promoted %s to Admin Level %d.",PlayerName, AdminLevel2); SendClientMessage(playerid, 0xD8D8D8FF, string); PlayerInfo[id][AdminLevel] = AdminLevel2; return 1; } else return SendClientMessage(playerid, 0xD8D8D8FF, "Levels: 1, 2, 3, 4 and 5."); } else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /makeadmin [PlayerId/PartOfName] [AdminLevel]"); } else return SendClientMessage(playerid, 0xD8D8D8FF, "You Need to Be RCON Admin to use this Command."); } else return SendClientMessage(playerid, 0xD8D8D8FF, "Player Is Not Connected"); }
my Enum:
Код:
enum pInfo { AdminLevel, VipLevel, Cash, Score, Color, Vw, Int, Warns, Prods, RepairOffer, } new PlayerInfo[MAX_PLAYERS][pInfo];