PDA

View Full Version : Restrict a command for admins


Fadel
06/04/2012, 05:06 AM
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?

Kitten
06/04/2012, 05:09 AM
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;
}

Fadel
06/04/2012, 05:12 AM
So I rePlace the "/test" with the cmd I want?

Kitten
06/04/2012, 05:13 AM
@Fadel yes

Fadel
06/04/2012, 05:14 AM
Thanks.. I will test it soon. Rep+