SA-MP Forums Archive
INI_Int --> filename putting problem - 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: INI_Int --> filename putting problem (/showthread.php?tid=438163)



INI_Int --> filename putting problem - HurtLocker - 18.05.2013

I want to drag some players' stats directly from the .ini file without using their enum. This is what ****** says in his y_ini presentation thread:
Quote:
Originally Posted by ******
Посмотреть сообщение
pawn Код:
INI:filename[tag](name[], value[])
{
    INI_Int("LEVEL", gLevel);
}
But I still can't make it work, I don't know how to place the player's .ini file in the line INI:filename[tag](name[], value[]) and the problem is the filename[tag] thing. To get the players name.ini file I use the well known stock copied from Kush's y_ini reg/log tutorial:
pawn Код:
stock UserPath(playerid)
{
    new string[128],playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    format(string,sizeof(string),PATH,playername);
    return string;
}
This is what I did and I know is crap:
pawn Код:
CMD:ytest(playerid, params[])
{
    new sc, str[50], n[200]=UserPath(playerid);
    INI:n[tag](name[], value[]);
    {
    INI_Int("Score", sc);
    }
    format(str, sizeof(str), "sdafsgssgf-->{FF0000}%d", sc);
    SendClientMessage(playerid, -1, str);
    return 1;
}



AW: INI_Int --> filename putting problem - HurtLocker - 19.05.2013

help


Re: INI_Int --> filename putting problem - zxc1 - 19.05.2013

pawn Код:
stock UserPath(playerid)
{
    new string[128],playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    format(string,sizeof(string),PATH,playername);
    return string;
}
The 'PATH' should be changed according to your script.
e.g /Accounts/%s.ini

Plus as far as I understood from ******'s tutorial, it should be:
pawn Код:
INI:filename[n](name[], value[])
EDIT: Another plus, I'm not so sure as I'm not familiar with YSI but I think you have to open the file first.


AW: Re: INI_Int --> filename putting problem - HurtLocker - 19.05.2013

The path is just fine to my needs, leeds directly to the .ini file, that's not my problem. The problem is I can't use the INI_Int function without using the public loaduser_data function which loads the enums with stats values.
Quote:
Originally Posted by zxc1
Посмотреть сообщение
pawn Код:
INI:filename[n](name[], value[])
And what do you mean with this? Try put a real example


Re: INI_Int --> filename putting problem - zxc1 - 19.05.2013

You are right about the UserPath, my mistake.
About the INI:filename the code I gave you is the code you should use according to YSI tutorial.


AW: INI_Int --> filename putting problem - HurtLocker - 19.05.2013

help


AW: INI_Int --> filename putting problem - HurtLocker - 19.05.2013

Vince help!


AW: INI_Int --> filename putting problem - HurtLocker - 20.05.2013

help


AW: INI_Int --> filename putting problem - HurtLocker - 20.05.2013

I don't use both. I just want to give directly to a variable the value from a line of .ini file. I use parsefile to full the enums with values but this has nothing to do with this. My problem is this line: INI:name[tag], I don't know what to put in name[tag].


AW: INI_Int --> filename putting problem - HurtLocker - 20.05.2013

Believe me I 've spent countless minutes reading exactly these 2 topics. Not to mention I have even bookmarked them.