Basic File Problem
#1

Hey fellow scripters :P,
i got a basic wiki script for saving names one a .txt file
the code is:
Код:
	new string[30];
	new pname[24], File:ftw=fopen("names.txt", io_append);
  	GetPlayerName(playerid, pname, 24);
    format(string, 30, "%s\r\n", pname);
    fwrite(ftw, string);
  	fclose(ftw);
anywaiz im new to all this file stuff (hence me copyin the wiki) is there a way to have all the players name come on the .txt file without repeating its self cause now like when my npcs join each time i restart server they come up again in the file. I hope you guys understand.

Thanks
Ray

Reply
#2

No I don't understand what you want. Explain deeper?
Reply
#3

use io_write
Reply
#4

ok i was told according to wiki io_write overwrite things already in file. and io_append writes fine.
The problem is. in my text file i get this:
Код:
Ray
npc1
npc1
npc1
ray
craig
i get the name NPC1 and Ray so many time is because each time i host the server the npc connects and his name goes on the list. I want a code to fix my one so that if npc1 is already in the list pawno wont write npc1 again. Ill explain it better again if u want.
Thanks for all the help
Ray
Reply
#5

anyone please, sorry for the bumb but its been a couple of days .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)