05.12.2013, 13:17
Hi, I need some help with this admin command I made.
When I set myself like level 3, the server.exe stops working, anyone that can fix this for me?
When I set myself like level 3, the server.exe stops working, anyone that can fix this for me?
pawn Код:
CMD:setadmin(playerid, params[])
{
if(PlayerInfo[playerid][pAdminLevel] == 4)
{
new id, level;
if(sscanf(params, "ui", id, level)) return SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /setadmin <id> <level>");
if(level > 4) return SendClientMessage(playerid, COLOR_RED, "[SERVER]: Levels Available: 1-4!");
new file[64];
dini_IntSet(file, "Admin Level", PlayerInfo[id][pAdminLevel] = level);
SendClientMessage(id, COLOR_YELLOW, "[SERVER]: You have been promoted to Administrator - Ask your Owner about your level!");
SendClientMessage(playerid, COLOR_LIME, "[SERVER]: You have succesfully promoted %s to Administrator!");
}
else if(!IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_RED, "[SERVER]: That player is not connected!");
}
else if(PlayerInfo[playerid][pAdminLevel] <= 4)
{
SendClientMessage(playerid, COLOR_RED, "[SERVER]: You are not an Administrator or not high enough to perform this command!");
}
return 1;
}