How do i read this...?
#1

How do I read information from a file starting at a certain line?
Sorry for having not posted any code.But how do i..
Reply
#2

Well, and we are meant to guess what saving system you are using?
Reply
#3

You can use "fread" to start at a position.But it will lag!!
EDIT:@Twizted,i'm using Y_INI
Reply
#4

pawn Код:
INI_Int("Score", pInfo[playerid][Score]); // integer
INI_String("Name", pInfo[playerid][Name]); // name
INI_Float("PosX", pInfo[playerid][pX]); // float
Note : you must have the tag of variable you want to read in ini file

Код:
Score: 505
Name: Marquis
Px: 998796126.241
like that
Reply
#5

Sorry for late reply.
OT:I have a command (/registeredplayers) which lists all players that have registered on the server within pages. 20 per page. There's about 166,666 registered players, and once the page count is on like 300 it takes a while to read the file. How could I start at a certain line to stop the delay?
Reply
#6

No other way then fseek I'm afraid, in combination with fgetchar. But then you'll be reading char-by-char which is inefficient as hell.
You should've converted to relational database years ago when you saw you're going to get lots of players registering... Why list it in-game anyways? Just get the filename and print it in a website or something...
Reply
#7

Thank you for your reply.I'll try doing something with it and let you know the results.I hope it works this time!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)