20.12.2015, 07:56
this is my oban code but i need is player admin other admin cant use oban on him.
PHP код:
CMD:oban(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] ==10 || IsPlayerAdmin(playerid))
{
new targetname[24], filestring[79], adminname[MAX_PLAYER_NAME];
if(sscanf(params, "s[24]", targetname)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /oban [Player's Name]");
format(filestring, sizeof(filestring), "/Asystem/Users/%s.ini", targetname);
if(!fexist(filestring)) return SendClientMessage(playerid, COLOR_RED, "[Error]: The player name you have chosen was not found in our system.");
else
{
GetPlayerName(playerid, adminname, sizeof(adminname));
new INI:File = INI_Open(filestring);
INI_SetTag(File, "data");
INI_WriteInt(File, "Ban", 1);
INI_Close(File);
new done[128];
format(done, sizeof(done), "[BAN] Admin %s (id:%d) Offlinebanned %s from server.", adminname, playerid, targetname);
SendClientMessageToAll(COLOR_RED, done);
return 1;
}
}
else return SendClientMessage(playerid,COLOR_RED,"You do not have permission to use this command!");
}