SA-MP Forums Archive
Gates and txt file - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Gates and txt file (/showthread.php?tid=138953)



Gates and txt file - Frezz - 03.04.2010

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!


Re: Gates and txt file - Gamer_Z - 03.04.2010

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.


Re: Gates and txt file - Frezz - 03.04.2010

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)




Re: Gates and txt file - Frezz - 03.04.2010

Help someone! PLEASE