Gates and txt file
#1

Hello! Can anyone tell me how to make a script that reads playername from .txt file.I just want to make a gate that only opens for people who is written in that .txt file. I am beginner at scripting. Please help!
Reply
#2

put this in a command or somewhere so it gets called:
pawn Код:
new String[256],File:handle;
handle = fopen("playername.txt",io_append);
fread(handle,String);
fclose(handle);
and then somewhere this:
pawn Код:
if(strcmp(PlayerName(playerid),String,false){
//open gate
}
and then u just modify it an u're done.
Reply
#3

It don't work or i don't understand how to put it in.
I got 2 errors
Quote:

C:\SAMP\filterscripts\commands.pwn(169) : error 017: undefined symbol "PlayerName"
C:\SAMP\filterscripts\commands.pwn(1132) : error 030: compound statement not closed at the end of file (started at line 54)

Reply
#4

Help someone! PLEASE
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)