30.09.2018, 20:23
Hey everyone,i want to make line 33 in the PHP below to be seen only by admins,can anyone please help me?
PHP код:
CMD:makeadmin(playerid , params[])
{
GetPlayerName(playerid,name,sizeof(name));
format(iname, sizeof(iname),"%s.ini",name);
if(dini_Int(iname,"Admin")<5&&!IsPlayerAdmin(playerid))
{
SendClientMessage(playerid,COLOR_ORANGE,"Нямаш права за тази команда");
return 1;
}
new id, level;
if (sscanf(params, "ud", id, level)) SendClientMessage(playerid, 0xFF0000AA, "Използвай: \"/makeadmin <playerid> <level>\"");
else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
else
if(dini_Int(iname,"Admin")==5&&level>4)
{
SendClientMessage(playerid,COLOR_RED, "Максималното админ ниво,което админ 5 може да връчи е 4");
return 1;
}
{
new string[256];
GetPlayerName(id,name,sizeof(name));
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid,aname,sizeof(aname));
if(level == 0)
{
if(dini_Int(iname,"Admin")<5)
format(string, sizeof(string), "Администратор {63E5E7}%s премахна админските права на %s", aname,name);
SendClientMessageToAll(COLOR_RED, string);
}
else
if(level == 0)
format(string, sizeof(string), "Администратор {63E5E7}%s премахна админските права на %s", aname,name);
SendClientMessageToAll(COLOR_RED, string);
{
{
format(string, sizeof(string),"Администратор {63E5E7}%s направи %s админ с %d левъл права.{00FF00}Честито!",aname ,name, level);
}
format(iname, sizeof(iname),"%s.ini",name);
dini_IntSet(iname, "Admin", level);
SendClientMessageToAll(COLOR_RED, string);
return 1;
}
return 1;
}
}