19.09.2012, 01:16
Hello,
I just started editing a gamemode with all of my thoughts, but I am trapped at making myself admin. In the script it says
for making someone admin, but as I type it /setstaff 0 5 it doesn't say anything. I've attached the whole script too including the specific command codes. If someone volunteers by helping will get a +rep. In scriptfiles > Users > Goldilox is my account, if someone adds this account to the head admin level please.
The command script:
Thanks for reading.
I just started editing a gamemode with all of my thoughts, but I am trapped at making myself admin. In the script it says
Code:
CMD:setstaff(playerid, params[])
The command script:
Code:
CMD:setstaff(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new Player, Level;
if (sscanf(params, "ui", Player, Level))
{
if(Level < 1)
{
SendClientMessage(playerid, COLOR_GREY, "Invalid staff level!");
}
else if(PlayerInfo[Player][pAdminLevel] >= 1)
{
SendClientMessage(playerid, COLOR_GREY, "Player is already an Admin or Mod!");
}
else if (Player == INVALID_PLAYER_ID)
{
SendClientMessage(playerid, COLOR_GREY, "Invalid player name or id entered!");
}
else
{
new string[256], file[256];
PlayerInfo[Player][pAdminLevel] = Level;
dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]);
format(string, sizeof(string), "You have been promoted to administration team by %s", GetPlayerNameEx(playerid));
SendClientMessage(Player, COLOR_GREEN, string);
format(string, sizeof(string), "You have promoted %s to level: %i", GetPlayerNameEx(Player), Level);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
}
return 1;
}

