05.05.2017, 02:59
Hi
I am trying to make an admin system
so i added a command called "/adminlevel" to set the admin level of player
but i am having problem
when i do the command it's just show the error syntex i mean correct usage.....
CODE:
I am trying to make an admin system
so i added a command called "/adminlevel" to set the admin level of player
but i am having problem
when i do the command it's just show the error syntex i mean correct usage.....
CODE:
Код:
CMD:adminlevel(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 3&& !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"You are not an admin.");
new targetid,level;
if(sscanf(params,"ui", targetid,level)) return SendClientMessage(playerid, COLOR_RED,"Correct usage: /adminlevel [PlayerID] [Level]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED,"That player is not connected to the server!");
if(level <4)
{
PlayerInfo[targetid][pAdmin] = level;
new msg[126],aname[MAX_PLAYER_NAME];
GetPlayerName(playerid,aname,sizeof(aname));
format(msg,sizeof(msg),"Admin ~r~%s ~w~Set You To Admin Level ~b~%i",aname,level);
GameTextForPlayer(playerid, msg, 5000, 5);
}
else
{
SendClientMessage(playerid, COLOR_RED,"Level Must Be Between 1-3");
}
return 1;
}

