06.03.2016, 13:02
Hi,
I'm making an admin filterscript, i made an /setadmin command to set players as an admin, but i need to know how to only allow RCON admins to set players as administrators.
My question is, does this command work with normal players(all) or with only RCON Administrators.
I need a script like this with zcmd to only allow RCON admins to use /setadmin.
I'm making an admin filterscript, i made an /setadmin command to set players as an admin, but i need to know how to only allow RCON admins to set players as administrators.
My question is, does this command work with normal players(all) or with only RCON Administrators.
I need a script like this with zcmd to only allow RCON admins to use /setadmin.
Code:
CMD:setadmin(playerid, params[])
{
new victimname[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], admlvl, id;
if(IsPlayerAdmin(playerid))
{
if (sscanf(params, "ui", id, admlvl)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /setadmin [id] [adminlevel]");
if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "[SYSTEM]: Player ID not found.");
if (admlvl > 10 || admlvl < 0) return SendClientMessage(playerid, COLOR_RED,"[SYSTEM]: Valid Admin Levels: 1-10!");
PlayerInfo[id][pAdminLevel] = admlvl;
GetPlayerName(id, victimname, sizeof(victimname));
GetPlayerName(playerid, adminname, sizeof(adminname));
new str[128];
format(str,128,"System: %s [ID %d] has set %s [ID %d] admin level to %i",adminname, playerid, victimname, id, admlvl);
SendClientMessage(playerid,COLOR_GREEN,str);
return 1;
}
else return SendClientMessage(playerid,COLOR_RED,"[SECURITY] You are not allowed to use this command!");
}



etadmin) then make sure to include zcmd and I'm not sure if you left it out on the pastebin, or if it wasn#t included but you also need to include a_samp.