Restrict a command for admins
#1

Iam new to scripting and if I want to restrict a cmd for admins only on an RP server. Can you show me a tut?
Reply
#2

pawn Код:
if(strcmp(cmdtext, "/test", true) == 0)
{
     if(IsPlayerAdmin(playerid))
     {
        SendClientMessage(playerid,-1,"Hi, admin");
     }
     else
     {
        SendClientMessage(playerid,-1,"You're not an admin");
        return 0;
     }
     return 1;
}
Reply
#3

So I rePlace the "/test" with the cmd I want?
Reply
#4

@Fadel yes
Reply
#5

Thanks.. I will test it soon. Rep+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)