How to restrict a player from using a command ?
#2

Using a variable and 'if' statement.

Example:

pawn Код:
CMD:whatever(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF,"ERROR: You are not admin!");  //You can change IsPlayerAdmin to your variable
   //Your codes
   return 1;
}
IsPlayerAdmin is default sa-mp RCON administrator check. This will check if the player is an RCON administrator.
You need to create your own variable to make this, i prefer you should check some of admin scripts on this forums.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)