22.09.2016, 15:54
Hey. I'll try to answer.
You use IsPlayerAdmin(playerid), which allow only player connected with RCON to use your commande.
For your second question, I recommende to you to create a variable with different level, not with a boolean.
THere is an example because my english is pretty bad:
Код:
First of all, how would I be able to create a rcon command which will be used to promote and demote admins?
PHP код:
if(IsPlayerAdmin(playerid))
THere is an example because my english is pretty bad:
PHP код:
#define PLAYER 0
#define MODO 1
#define GMODO 2
#define ADMIN 3
CMD:goto(playerid, params[])
{
if(pAccount[playerid][pAdmin] < ADMIN) return 1;
// pAdmin is a integer which is storing admin lvl of the player even if the player is not an admin.
new target;
if(sscanf(params, "u", target)) return SCM(playerid, LBLUE, "/goto [playerid/name]");
if(!IsPlayerConnected(target))
return ErrorMsg(playerid, "This player isn't connected.");
new Float:x,
Float:y,
Float:z;
GetPlayerPos(target, x, y, z);
SetPlayerPos(playerid, x+1, y+1, z);
SetPlayerInterior(playerid, GetPlayerInterior(target));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(target));
return 1;
}