OK, lets break this down. The data in the table is in row formats. You will be retreiving the row that the certain player data is stored in. The line variable has the whole row, so we need to split it with sscanf because it will look something like this
Код:
[HiC]TheKiller|Password|5|5|5|5|192.168.2.1
Which is actually
Код:
User|Password|Kills|deaths|Score|money|Ip
Now we use sccanf with the delimiter p| because we are splitting at the |. Sccanf now splits the information into single variables. It's just easier having 2 variables instead of one.
pawn Код:
sscanf(line, "p|ssdddds", data[0], data[1], data2[0], data2[1], data2[2], data2[3], data[2]);
/*
p = showing the delimiter in the next character
| = Delimiter
s (data[0]) = Username, we may need that for something?
s (data[1]) = password, we may need that for something else?
d (data2[0]) = Kills (We set that into player variables later on)
d (data2[1]) = Deaths (We set that into a Pvar)
d (data2[2]) = Score (Sets player's score)
d (data2[3]) = Money (Sets players money)
s (data[2]) = Sets players IP in varaible.
*/
I'll update the tutorial later as some people may be confused with it.