Command
#1

How do you create a command so that only a certain person can use it, Like Sam_Hamilton.
Reply
#2

Are you using a Register System? if you are please tell us which you are using..

if not, then get one, because this would mean that name is not protected and anyone can log in with it, unless only a Certain ip can use it...
Reply
#3

I am using a Register/Login system, I just wanted to know how to make commands that a certain Name can Only use.
Reply
#4

pawn Код:
new name[24];
GetPlayerName(playerid, name, sizeof(name));
if(strcmp("YourName", name, true) == 0)
{
    //do stuff
}
Mowgli means that any player can join the server, using "YourName" and gain access to this function.
So to prevent that, we need to know if you have anything that checks, if a player is logged in or not.

Like so..
pawn Код:
if(strcmp("YourName", name, true) == 0 && PlayerInfo[playerid][LoggedIn] == 1)
{
Reply
#5

Thanks guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)