Y_INI loops while loading.. Help!
#1

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
Reply
#2

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;
}
Reply
#3

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
Reply
#4

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

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 ...
Reply
#6

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
Reply
#7

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)