28.10.2018, 22:24
Pawno stops working because you're missing a closing bracket } at the switch operator closing and a opening bracket { at the GetAdminRankName function opening.
This:
This:
pawn Код:
GetAdminRankName(playerid)
{
switch(PlayerInfo[id][pAdmin])
{
case 0:
{
return "Moderator"
}
case 1:
{
return "Game Administrator"
}
case 2:
{
return "Lead Administrator"
}
case 3:
{
return "Server Manager"
}
}
return 1;
}
CMD:makeadmin(playerid, params[])
{
new id, AdminLevel;
if(PlayerInfo[targetid][pAdmin] >= 3 || IsPlayerAdmin(playerid))
{
if(sscanf(params, "ui", id, AdminLevel))
return SendClientMessage(playerid, -1, "USAGE: /makeadmin [ID] [LEVEL 1-4]");
if(AdminLevel < 1 || AdminLevel > 4)
return SendClientMessage(playerid, COLOR_RED, "ERROR: Invalid Admin level");
if(!IsPlayerConnected(id))
return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected!");
SendClientMessageEx(playerid, COLOR_LAWNGREEN, "You've just been made: %s admin level: %i", ReturnName(id), GetAdminRankName);
SendClientMessageEx(targetid, COLOR_LAWNGREEN, "You've just been made admin level: %i by %s", GetAdminRankName, ReturnName(id));
PlayerInfo[id][pAdmin] = AdminLevel;
}
else return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not an Admin!");
return 1;
}