Detecting someone's name
#1

I want to make a command, /hgate, but I don't want everyone to be able to use it, how would I go about detecting someone's name?
Reply
#2

You can use strcmp to compare the players name and allowed name/s
Reply
#3

Quote:
Originally Posted by Macluawn
Посмотреть сообщение
You can use strcmp to compare the players name and allowed name/s
Er..could you show me how, please?
I'm a noob with strcmp.
Reply
#4

pawn Код:
new playername[MAX_PLAYERS]; //declares an array
GetPlayerName(playerid, playername, MAX_PLAYER_NAME); //gets the players name
if(!strcmp("ChangeMe", playername, false, strlen("ChangeMeToo"))) //compare
{
  //do something when the names match.
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)