Need something like this ...
#1

Hello,

I'm trying to make a property-system, just to inprove my scripting skills. But i need something like this to read the interiors.txt file:

- Search the whole file for the given Unique interior id.

- Get all these information from the same line as the founded Unique id (interiorid, coords, virtualworld ect) and save it into variables.


Then i can make something that puts the player in the property

And yes, interiors.txt is that basic SA:MP interior-file.

Greetz,
Danny
Reply
#2

sscanf is your friend.
Reply
#3

Hmm, i only use sscanf for my DCMD commands. Can you give me an example of using this for filereading?
Reply
#4

File contains:
Код:
hello 123 456.765
You use sscanf to parse those:
pawn Код:
sscanf(filestring, "s[SIZEOF_STRING_GOES_HERE]if", string, number, floatnumber);
How can't you use sscanf in this if you're able to use it in your commands? There's no difference.
Reply
#5

Also here is another example:

File contains:
Код:
35|0.4|-6
And you use sscanf like this.
pawn Код:
sscanf( string, "p<|>ifi", integer, float, integer2 );
This goes the same for ','. Jut replace p<|> with p<,>
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)