SA-MP Forums Archive
y_ini - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: y_ini (/showthread.php?tid=335740)



y_ini - Tomer!.$ - 19.04.2012

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;




Re: y_ini - Jonny5 - 19.04.2012

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

it explains it better than I ever could.


Re : y_ini - Tomer!.$ - 20.04.2012

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?


Re : y_ini - Tomer!.$ - 20.04.2012

Please help?


Re: y_ini - ReneG - 20.04.2012

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


Re : y_ini - Tomer!.$ - 20.04.2012

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


Re: y_ini - ReneG - 20.04.2012

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?


Re : y_ini - Tomer!.$ - 20.04.2012

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?


Re: y_ini - ReneG - 20.04.2012

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


Re : y_ini - Tomer!.$ - 20.04.2012

Alright I got it, thanks.