View Single Post
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