22.02.2015, 07:06
Help me I Trying To Making Own Administrator System I Need Setlevel Command And I already done to make register/login
new PlayerInfo[MAX_PLAYERS][Extra];
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
CMD:setlevel( playerid, cmdtext[] ) {
new targetid,
adminlevel,
string[128],
targetname[MAX_PLAYER_NAME],
playername[MAX_PLAYER_NAME];
GetPlayerName(targetid, targetname, sizeof(targetname));
GetPlayerName(playerid, playername, sizeof(playername));
if(PlayerInfo[playerid][Admin] < 6) // or whatever admin level you want
return SendClientMessage(playerid, COLOR_RED, "SERVER: You can't use this command.");
if(sscanf(cmdtext, "ud", targetid, adminlevel))
return SendClientMessage(playerid, COLOR_RED, "USAGE: /setlevel [playerid] [adminlevel]");
if(PlayerInfo[targetid][Admin] <= adminlevel) {
format(string, sizeof(string), "* You have promoted %s to Admin Level %d.", targetname);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string, "* You have been promoted by %s to Admin Level %d.", playername, adminlevel);
SendClientMessage(targetid, COLOR_YELLOW, string);
}
if(PlayerInfo[targetid][Admin] > adminlevel ) {
format(string, sizeof(string), "You demoted %s to Admin Level %d.", targetname);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), "* You have been demoted by %s to Admin Level %d.", playername, adminlevel);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
return 1;
}