[help] Giving /kick access to only admins - 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: [help] Giving /kick access to only admins (
/showthread.php?tid=552442)
[help] Giving /kick access to only admins -
Arxalan - 24.12.2014
Hello i created the following command
PHP код:
CMD:kick(playerid,params[])
{
new id;
if(sscanf(params, "d", id))return SendClientMessage(playerid, 0xFFFFFFFF, "How to use: '/kick [playerid]'");
else if(!IsPlayerConnected(id))return SendClientMessage(playerid, 0xFF0000FF, "Invalid Player ID");
else
{
Kick(id);
}
return 1;
}
But i want that only admins (IsPlayerAdmin) can /kick players and if a simple user (not admin) try to use it get a message " You are not Admin".
Re: [help] Giving /kick access to only admins -
UltraScripter - 24.12.2014
pawn Код:
CMD:kick(playerid,params[])
{
new id;
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "You Are Not Admin!");
if(sscanf(params, "d", id))return SendClientMessage(playerid, 0xFFFFFFFF, "How to use: '/kick [playerid]'");
else if(!IsPlayerConnected(id))return SendClientMessage(playerid, 0xFF0000FF, "Invalid Player ID");
else
{
Kick(id);
}
return 1;
}
Re: [help] Giving /kick access to only admins -
Arxalan - 24.12.2014
Thanks u so much