SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 13/01/2011, 05:07 PM   #1
blackwave
Gangsta
 
Join Date: Oct 2010
Location: Fortaleza, Brazil
Posts: 967
Reputation: 7
Default Y_INI reading (INI_LOAD) issue.

If anyone got this problem before, please tell me how to resolve. INI_Load is simply not processing:
pawn Code:
// ==================== TOP ===============================
#define PLAYER "system/%s.ini"
new playerfile[256];
// ===================== Command and reading structure =================
CMD:status(playerid,params[])
{
    format(playerfile,sizeof(playerfile),PLAYER,GetMyName(playerid)) && printf("PLAYERFILE: %s | playerfile: %s",PLAYER,playerfile);
    INI_Load(playerfile);
    print("the CMD:status has been processed . . . ");
    return 1;
}
INI:playerfile[](playerid, name[], value[])
{
   printf("%s has been loaded",playerfile);
   INI_String("Name", PlayerInfo[playerid], Name);
   INI_Int("Cash", PlayerInfo[playerid][Cash]);
   return 0;
}

I've also put the printf on the reading for check if that's processing. And printf isn't showing, means it's not processing. It's really weird. I've asked for ****** about the INI_String problem and I resolved myself, now. Even though, INI_Load isn't workin'. Hope can help me. It looks like a bug.
__________________






My youtube user: Click here
blackwave is offline  
Old 13/01/2011, 05:25 PM   #2
Finn
High-roller
 
Join Date: Jan 2008
Posts: 1,464
Reputation: 382
Default Re: Y_INI reading (INI_LOAD) issue.

What does it print in the console? Does the file exist?
Finn is offline  
Old 13/01/2011, 05:27 PM   #3
blackwave
Gangsta
 
Join Date: Oct 2010
Location: Fortaleza, Brazil
Posts: 967
Reputation: 7
Default Re: Y_INI reading (INI_LOAD) issue.

I had another command before. And put for print after each function.

GetPlayerName = print ( the_runner ) // My name
format = print ( the_runner.ini) // My file name

All worked perfectly.

Just doesn't loads this section:
pawn Code:
INI:playerfile[](playerid, name[], value[])
{
   printf("%s has been loaded",playerfile); // CUZ HERE HASN't PRINTED
   INI_String("Name", PlayerInfo[playerid], Name);
   INI_Int("Cash", PlayerInfo[playerid][Cash]);
   return 0;
}
__________________






My youtube user: Click here
blackwave is offline  
Old 13/01/2011, 05:33 PM   #4
Finn
High-roller
 
Join Date: Jan 2008
Posts: 1,464
Reputation: 382
Default Re: Y_INI reading (INI_LOAD) issue.

Oh, I know the problem.

pawn Code:
forward LoadOneUser(playerid, tag[], name[], value[]);
public LoadOneUser(playerid, tag[], name[], value[])
{
   printf("%s has been loaded",playerfile);
   INI_String("Name", PlayerInfo[playerid], Name);
   INI_Int("Cash", PlayerInfo[playerid][Cash]);
   return 0;
}

CMD:status(playerid,params[])
{
    format(playerfile,sizeof(playerfile),PLAYER,GetMyName(playerid)) && printf("PLAYERFILE: %s | playerfile: %s",PLAYER,playerfile);
    INI_ParseFile(playerfile, "LoadOneUser", .bExtra = true, .extra = playerid, .bPassTag = true);
    print("the CMD:status has been processed . . . ");
    return 1;
}
Finn is offline  
Old 13/01/2011, 05:42 PM   #5
blackwave
Gangsta
 
Join Date: Oct 2010
Location: Fortaleza, Brazil
Posts: 967
Reputation: 7
Default Re: Y_INI reading (INI_LOAD) issue.

It crashed. So, I edited the code and made it don't crash anymore. Even though it shows on the msg:
Code:
Name: | Cash: 0
While on the file:
Code:
Name = the_runner
Password = *****
Cash = 1000
Also printed 3 times: PRocessed here...

Actually code:
pawn Code:
CMD:status(playerid,params[])
{
    new string[128];
    format(playerfile,sizeof(playerfile),PLAYER,GetMyName(playerid)) && printf("PLAYERFILE: %s | playerfile: %s",PLAYER,playerfile);
    INI_ParseFile(playerfile, "LoadOneUser", .extra = playerid);
    print("the CMD:status has been processed . . . ");
    format(string,sizeof(string),"Name: %s | Cash: %i",PlayerInfo[playerid][Name],PlayerInfo[playerid][Cash]);
    Msg(playerid, color, string);
    return 1;
}
forward LoadOneUser(playerid, tag[], name[], value[]);
public LoadOneUser(playerid, tag[], name[], value[])
{
   printf("PRocessed here");
   INI_String("Name", PlayerInfo[playerid], Name);
   INI_Int("Cash", PlayerInfo[playerid][Cash]);
   return 0;
}
__________________






My youtube user: Click here
blackwave is offline  
Old 14/01/2011, 12:14 AM   #6
blackwave
Gangsta
 
Join Date: Oct 2010
Location: Fortaleza, Brazil
Posts: 967
Reputation: 7
Default Re: Y_INI reading (INI_LOAD) issue.

Resolved (: !
__________________






My youtube user: Click here

Last edited by blackwave; 14/01/2011 at 01:21 AM. Reason: Resolved
blackwave is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Y_INI annoyin' issue blackwave Help Archive 3 12/01/2011 03:26 PM
y_ini - reading something dosent work Lorenc_ Help Archive 2 11/01/2011 05:15 AM
y_ini Reading GiS Help Archive 10 09/01/2011 11:07 AM
Y_INI reading help armyoftwo Help Archive 9 03/01/2011 10:50 AM


All times are GMT. The time now is 11:47 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.