SA-MP Forums Archive
Y_INI loops while loading.. 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 loops while loading.. Help! (/showthread.php?tid=503646)



Y_INI loops while loading.. Help! - blackeagle1122 - 30.03.2014

Hi,
pawn Код:
forward public loadpass(playerid, name[], value[]);
public loadpass(playerid, name[], value[])
{
    INI_Int("password_hash",Parola[playerid]);
    SendClientMessage(playerid,COLOR_LIGHTBLUE,"Password loaded.");
    return 1;
}

CMD:load(playerid, params[])
{
    new fname[64];
    format(fname,sizeof(fname),"save/%s.dudb.sav",udb_encode(GetName(playerid)));
    if(fexist(fname)) INI_ParseFile(fname, "loadpass", .bExtra = true, .extra = playerid);
    return 1;
}
When I type "/load" It sends 15 times "Password loaded" message. What is the wrong ? I could'nt find it


Re: Y_INI loops while loading.. Help! - RenovanZ - 30.03.2014

I dont know what kind of problem is it. But try this:

pawn Код:
forward loadpass(playerid, name[], value[]);
public loadpass(playerid, name[], value[])
{
    INI_Int("password_hash",Parola[playerid]);
    SendClientMessage(playerid,COLOR_LIGHTBLUE,"Password loaded.");
    return 1;
}



Re: Y_INI loops while loading.. Help! - blackeagle1122 - 30.03.2014

Quote:
Originally Posted by Kiyozi_Mu
Посмотреть сообщение
I dont know what kind of problem is it. But try this:

pawn Код:
forward loadpass(playerid, name[], value[]);
public loadpass(playerid, name[], value[])
{
    INI_Int("password_hash",Parola[playerid]);
    SendClientMessage(playerid,COLOR_LIGHTBLUE,"Password loaded.");
    return 1;
}
Already tried, does'nt work


Re: Y_INI loops while loading.. Help! - biker122 - 30.03.2014

Try to put
pawn Код:
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Password loaded.");
on CMD:load(playerid,params[])


Re: Y_INI loops while loading.. Help! - blackeagle1122 - 30.03.2014

Quote:
Originally Posted by biker122
Посмотреть сообщение
Try to put
pawn Код:
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Password loaded.");
on CMD:load(playerid,params[])
It works but It still calls 15 times and can cause lag ...


Re: Y_INI loops while loading.. Help! - blackeagle1122 - 30.03.2014

Quote:
Originally Posted by ******
Посмотреть сообщение
The callback is called once for EVERY key in the file, in your case you must have (at least) 15 keys.
Thank you so much ******. I posted it as an example, normally I have 15 keys in my files. Solved thanks


Re: Y_INI loops while loading.. Help! - blackeagle1122 - 30.03.2014

Quote:
Originally Posted by ******
Посмотреть сообщение
The callback is called once for EVERY key in the file, in your case you must have (at least) 15 keys.
I have another question ******,

When I try to load single key in a file, it loops 15-16 times,

But when I try to load all keys in a file, it loops 4 times, is it a problem