INI help
#1

Well it saves the variables fine but there's something wrong on OnPlayerConnect because it don't convert the INI variables to the enum's variables correctly, so like I set my pScore to 20 and pAdmin to 1 in the INI file and when I log in it doesn't convert it to the enum's variables and it stays 0.
PHP код:
public OnPlayerConnect(playerid)
{
    
GameTextForPlayer(playerid"~w~Team Deathmatch",3000,1);
    
SetPlayerColor(playerid0xFFFFFF00);
    if(
gCriminals == && gSWAT 0)
    {
        new 
string[128], Name[MAX_PLAYER_NAME];
        
GetPlayerName(playeridNamesizeof(Name));
        
format(stringsizeof(string), "%s has logged in \n New round is starting up..."Name);
        
SendClientMessageToAll(COLOR_WHITEstring);
        
SetEveryoneToSpawn(playerid);
    }
    if(
fexist(UserPath(playerid)))
    {
         
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra true, .extra playerid);
        
SetPlayerScore(playeridPlayerInfo[playerid][pScore]);
    }
    return 
1;
}
stock LoadUser_data(playerid,name[],value[])
{
    
INI_Int("Score"PlayerInfo[playerid][pScore]);
    
INI_Int("Admin"PlayerInfo[playerid][pAdmin]);
}
stock UserPath(playerid)
{
    new 
string[128],playername[MAX_PLAYER_NAME];
    
GetPlayerName(playerid,playername,sizeof(playername));
    
format(string,sizeof(string),PATH,playername);
    return 
string;

Reply


Messages In This Thread
INI help - by Tomer!.$ - 21.04.2012, 15:01
Re : INI help - by Tomer!.$ - 21.04.2012, 17:30
Re: INI help - by Ainseri - 21.04.2012, 18:45
Re: INI help - by Tomer!.$ - 21.04.2012, 18:52
Re: INI help - by Ainseri - 21.04.2012, 18:55
Re: INI help - by Tomer!.$ - 22.04.2012, 12:51
Re: INI help - by Tomer!.$ - 22.04.2012, 14:05
Re: INI help - by Tomer!.$ - 22.04.2012, 15:46
Re: INI help - by Tomer!.$ - 22.04.2012, 17:47
Re: INI help - by Tomer!.$ - 23.04.2012, 12:25

Forum Jump:


Users browsing this thread: 3 Guest(s)