[Question] Command
#1

Hey everyone out there.

I just have a simple question that i knew for a long time ago.
How can i create a command that only one person in game can use.
Based on the nick name the player have. ?
Reply
#2

Like checking if their admin level is high enough

you can make it with

pawn Код:
new ValidCommandNames {
"Chris_Donut",
"John_Deez",
"David_Nuts",
"Fuck_tard"
};
then use strcmp to check if playername is the same as one of the names in the validnames
Reply
#3

pawn Код:
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof pName);
if(!strcmp(pName,"<Name>",true))
BTW: Change that "true" to "false" if you want it to be case-sensitive.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)