gTeam saving
#3

You forgot to set gTeam to the team in the file at OnPlayerConnect

pawn Код:
enum {
    POLICE,
    POLICEE
}
stock gTeam[MAX_PLAYERS];
pawn Код:
public OnPlayerConnect(playerid)
{
    new file[128];      
    GetPlayerName(playerid, file, MAX_PLAYER_NAME);
    format(file, sizeof(file), saves, file);
    if(dini_Exists(file)) {
        gTeam[playerid] = dini_Int(file, "Team");
    } else {
        dini_Create(file);
        gTeam[playerid] = -1; //no team
    }
    return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new file[128];
    GetPlayerName(playerid, file, MAX_PLAYER_NAME);
    format(file, sizeof(file), saves, file);
    dini_IntSet(file, "Team", gTeam[playerid]);
    SaveStats(playerid);
    return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerTeam(playerid, gTeam[playerid]);
    SetPlayerToTeamColour(playerid);
    return 1;
}
Reply


Messages In This Thread
gTeam saving - by krisis32 - 17.06.2011, 13:03
Re: gTeam saving - by krisis32 - 17.06.2011, 15:25
AW: gTeam saving - by Nero_3D - 17.06.2011, 16:11
Re: gTeam saving - by krisis32 - 17.06.2011, 16:53
Re: gTeam saving - by DRIFT_HUNTER - 17.06.2011, 16:57
Re: gTeam saving - by Seven_of_Nine - 17.06.2011, 17:00
Re: gTeam saving - by krisis32 - 17.06.2011, 17:19

Forum Jump:


Users browsing this thread: 1 Guest(s)