SA-MP Forums Archive
Pulling names from a 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: Pulling names from a txt file (/showthread.php?tid=192573)



Pulling names from a txt file - -Rebel Son- - 23.11.2010

I wanted to ask if this is even possible, Have a text file in the scriptfiles, with usernames in it. that are pulled.

say you had a function to give people a variable like.. .Tacos. ok, so you want to give only certain people tacos, so you put their name in a text file before server launch, then, then function is called witch pulls THOSE names, and gives them tacos.

anyone know how to do this? or am i just a brainstormer?


Re: Pulling names from a txt file - randomkid88 - 23.11.2010

Yes, this is possible. You can put them into a text file, and read the contents with fread. You then store this information and can do whatever you want with it.


Re: Pulling names from a txt file - Rac3r - 23.11.2010

Brainstormer lol

Look in the file.inc file (include folder), that'll help.