#1

Well I didn't understand how can I load something from a file.
I made it so OnPlayerDisconnect it saves the player's score and it works fine.
But how can I do that OnPlayerConnect it takes the score's integer from the INI file?

PHP код:
public OnPlayerDisconnect(playeridreason)
{
    new
        
fileToWrite[] = "players.INC",
         
INI:iniFile INI_Open(fileToWrite), name[MAX_PLAYER_NAME], score GetPlayerScore(playerid);
    
GetPlayerName(playeridnamesizeof(name));
     
INI_SetTag(iniFile"Players Score");
      
INI_WriteInt(iniFilenamescore);
       
INI_Close(iniFile);
    return 
1;

Reply
#2

have you read ******'s tutorial on this?
https://sampforum.blast.hk/showthread.php?tid=244223

it explains it better than I ever could.
Reply
#3

Yeah but I didn't understand what function should I use intending to do it, I want to load a specific line since I only have one file which goes like:
[Player Name] = [Player Score]
And the list goes on.
So how can I do it?
Reply
#4

Please help?
Reply
#5

There is plenty of stuff on the wiki.

https://sampwiki.blast.hk/wiki/GetPlayerScore
https://sampwiki.blast.hk/wiki/GetPlayerName
https://sampwiki.blast.hk/wiki/GetPlayerMoney
Reply
#6

Well you probably didn't get me well, I asked how can I read a specific line from an INI file?
Reply
#7

By creating the function first of all, then calling it with INI_ParseFile. Did you catch any tutorial on this, or are you doing this on your own?
Reply
#8

I read the y_ini tutorial but I didn't get how can I take the second value of a specific line form an INI file and convert it to a variable?
Reply
#9

This tutorial shows you how to make a saving system with y_ini, plus a registration system with dialogs.
https://sampforum.blast.hk/showthread.php?tid=273088
Reply
#10

Alright I got it, thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)