Opening Gate based On name
#1

Hi all here,
I'm new in pawn scripting.
I've mapped my personal house in a server and i'd like to make automatic opening gate, but it must work only if I go there, so if PlayerName is the one i chose, Can it be made? If yes, how?
Thanks in advice
Reply
#2

If i'm right, you would need to use StrCmp() To compare the GetPlayerName string with the name you want to assign it too.
Click below for the link to these functions.
GetPlayerName
Strcmp
Reply
#3

This should work. This is what I use.
Put this in the beginning of the script your using this in.
PHP код:
new name[MAX_PLAYER_NAME];
GetPlayerName(playeridnamesizeof(name)); 
Then put this wherever you want it
PHP код:
if(strcmp(name"Name"true) == 0)
{


Reply
#4

Thanks! It works perfectly!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)