SA-MP Forums Archive
Admin commands. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Admin commands. (/showthread.php?tid=320991)



Admin commands. - Blunt - 25.02.2012

Can someone help me with some admin commands, I'm using ZCMD for faster, less laggy processing.

I need the /kick, /goto, /gethere and /ban commands.

If someone could do this for me, i'd be hugely greatful.

THANK YOU.



Re: Admin commands. - JhnzRep - 25.02.2012

pawn Код:
cmd(goto, playerid, params[])
{
    new ID, Float:X, Float:Y, Float:Z; // So we save the positions in floats.
    if(sscanf(params,"u", ID)) return SendClientMessage(playerid, -1, "/goto [playerid]");
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You are not an admin"); //Change IsPlayerAdmin to your admin system.
    GetPlayerPos(ID, X, Y, Z);
    SetPlayerPos(playerid, X+1, Y, Z);
    return 1;
}
pawn Код:
cmd(kick, playerid, params[])
{
    new ID;
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You are not an admin");
    if(sscanf(params,"u", ID)) return SendClientMessage(playerid, -1, "/kick [ID]");
    Kick(ID);
    return 1;
}
From this you should be able to learn how to make /ban and /gethere.

Also IsPlayerAdmin checks if a player is a rcon admin, so change it to your admin system.


Re: Admin commands. - Smally - 25.02.2012

It's
pawn Код:
CMD:goto(playerid,params[])

//not
CMD(goto,playerid,params[])



Re: Admin commands. - emokidx - 25.02.2012

pawn Код:
CMD:commandname(playerid, params[])
COMMAND:commandname(playerid, params[])
CMD(commandname,playerid, params[])
COMMAND(commandname,playerid, params[])
these four can be used as far as i know.