[help] Giving /kick access to only admins
#1

Hello i created the following command
PHP код:
CMD:kick(playerid,params[])
{
new 
id;
if(
sscanf(params"d"id))return SendClientMessage(playerid0xFFFFFFFF"How to use: '/kick [playerid]'");
else if(!
IsPlayerConnected(id))return SendClientMessage(playerid0xFF0000FF"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".
Reply
#2

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;
}
Reply
#3

Thanks u so much
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)