y-ini help - 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 help (
/showthread.php?tid=545487)
y-ini help -
Stoyanov - 08.11.2014
Can someone help me with this code:
Код:
new donate;
new file = ini_openFile("donate.ini");
if(ini_getInteger(file, inputtext) == 0)
{
if(donate == 1)
{
SendClientMessage(playerid,-1,"VIP Account activated");
return 1;
}
if(donate == 2)
{
SendClientMessage(playerid,-1,"Level UP to 1 point");
return 1;
}
if(donate == 3)
{
SendClientMessage(playerid,-1,"Phone Number changed for 4 symbols");
return 1;
}
ini_removeKey(file,inputtext);
SendClientMessage(playerid,-1,"Thank's for donate");
}
else
{
SendClientMessage(playerid,-1,"Wrong Code");
}
iniClose(file);
I can't make it with y-ini. : (
Re: y-ini help -
M4D - 08.11.2014
Explain more
what is your problem and what do you want to do with this system ?
Re: y-ini help -
Stoyanov - 08.11.2014
It doesn't want to read from the file. It's maked with mxINI system. I want to make it with Y\INI.
Re: y-ini help -
M4D - 08.11.2014
For create new ini file with Y_INI use "INI_Open".
and for load them make a function and use "INI_ParseFile".
Read ****** Tutorial about Y_INI:
https://sampforum.blast.hk/showthread.php?tid=175565
Re: y-ini help -
Stoyanov - 08.11.2014
I don't know how to do the things with the INI_ParseFile
Re: y-ini help -
M4D - 08.11.2014
you have to define new variables and load ini data into it.
for example i have a player ini file and i want to load player money to "PlayerMoney[playerid]" Variable.
"INI_ParseFile" need call a function. so we will make it
my.ini file content:
[data]
Money = 2000
pawn Код:
new PlayerMoney[MAX_PLAYERS]; //>defining the variable
//>creating function
forward MyFunction_data(playerid,name[],value[]);
public MyFunction_data(playerid,name[],value[])
{
INI_Int("Money",PlayerMoney[playerid]); //> Loading an integer (player money amount) from "Money" Value to PlayerMoney[playerid] variable
return 1;
}
INI_ParseFile("my.ini", "MyFunction_%s", .bExtra = true, .extra = playerid);
Re: y-ini help -
Stoyanov - 08.11.2014
hm... This is not the purpose of the system.
When u type /donate will show u a dialog. In this dialog u will type a code. If the code is right will give you a cash for example. If u try to enter the same code again should say the code is wrong. And i want make this system with 100-200 codes in file, but i don't know how to read the codes from the file.