Skin saving error
#7

PHP код:
enum user
{
    
pPass[129],
    
aLevel,
    
vLevel,
    
pCash,
    
pScore,
    
pKills,
    
pDeaths,
    
pHoldups,
    
pCrimes,
    
pFined,
    
pArrests,
    
pTakedowns,
    
pTickets,
    
pRope,
    
pPaintCan,
    
pScissors,
    
pKits,
    
vLock,
    
Helper,
    
hHelper,
    
pWarns,
    
pKicks,
    
pJoins,
    
pMaterials,
    
Banned,
    
jTime,
    
Float:pArmour,
    
Float:pHealth,
    
pWanted,
    
cTime,
    
pSkin
}
new 
PlayerInfo[MAX_PLAYERS][user]; 
PHP код:
stock SaveUserStats(playerid)
{
    if(
IsPlayerConnected(playerid) && IsLoggedIn{playerid} == 1)
    {
        new 
file[40];
        new 
score GetPlayerScore(playerid), cash GetPlayerCash(playerid), wanted GetPlayerWantedLevel(playerid), jail JailTime[playerid], cage CageTime[playerid];
        new 
Float:armourFloat:health;
        
GetPlayerHealth(playeridhealth);
        
GetPlayerArmour(playeridarmour);
        
PlayerInfo[playerid][pScore] = score;
        
PlayerInfo[playerid][pCash] = cash;
        
PlayerInfo[playerid][pWanted] = wanted;
        
PlayerInfo[playerid][pArmour] = armour;
        
PlayerInfo[playerid][pHealth] = armour;
        
PlayerInfo[playerid][jTime] = jail;
        
PlayerInfo[playerid][cTime] = cage;
        
GetPlayerArmour(playeridarmour);
        
format(filesizeof(file), USER_FILEGetName(playerid));
        new 
INI:ufile INI_Open(file);
        
INI_WriteString(ufile"pPass"PlayerInfo[playerid][pPass]);
        
INI_WriteInt(ufile"aLevel",PlayerInfo[playerid][aLevel]);
        
INI_WriteInt(ufile"vLevel",PlayerInfo[playerid][vLevel]);
        
INI_WriteInt(ufile"pCash"cash);
        
INI_WriteInt(ufile"pScore"score);
        
INI_WriteInt(ufile"pKills"PlayerInfo[playerid][pKills]);
        
INI_WriteInt(ufile"pDeaths"PlayerInfo[playerid][pDeaths]);
        
INI_WriteInt(ufile"pHoldups"PlayerInfo[playerid][pHoldups]);
        
INI_WriteInt(ufile"pCrimes"PlayerInfo[playerid][pCrimes]);
        
INI_WriteInt(ufile"pFined"PlayerInfo[playerid][pFined]);
        
INI_WriteInt(ufile"pArrests"PlayerInfo[playerid][pArrests]);
        
INI_WriteInt(ufile"pTakedowns"PlayerInfo[playerid][pTakedowns]);
        
INI_WriteInt(ufile"pTickets"PlayerInfo[playerid][pTickets]);
        
INI_WriteInt(ufile"pRope"PlayerInfo[playerid][pRope]);
        
INI_WriteInt(ufile"pPaintCan"PlayerInfo[playerid][pPaintCan]);
        
INI_WriteInt(ufile"pScissors"PlayerInfo[playerid][pScissors]);
        
INI_WriteInt(ufile"pKits"PlayerInfo[playerid][pKits]);
        
INI_WriteInt(ufile"vLock"PlayerInfo[playerid][vLock]);
        
INI_WriteInt(ufile"Helper"PlayerInfo[playerid][Helper]);
        
INI_WriteInt(ufile"hHelper"PlayerInfo[playerid][hHelper]);
        
INI_WriteInt(ufile"pWarns"PlayerInfo[playerid][pWarns]);
        
INI_WriteInt(ufile"pKicks"PlayerInfo[playerid][pKicks]);
        
INI_WriteInt(ufile"pJoins"PlayerInfo[playerid][pJoins]);
        
INI_WriteInt(ufile"pMaterials"PlayerInfo[playerid][pMaterials]);
        
INI_WriteInt(ufile"Banned"PlayerInfo[playerid][Banned]);
        
INI_WriteInt(ufile"jTime"jail);
        
INI_WriteFloat(ufile"pArmour"armour);
        
INI_WriteFloat(ufile"pHealth"health);
        
INI_WriteInt(ufile"pWanted"wanted);
        
INI_WriteInt(ufile"cTime"cage);
        
INI_WriteInt(ufile"pSkin"GetPlayerSkin(playerid));
        
INI_Close(ufile);
    }
    return 
1;

PHP код:
PlayerInfo[playerid][aLevel] = 0;
        
PlayerInfo[playerid][vLevel] = 0;
        
PlayerInfo[playerid][pCash] = 10000;
        
PlayerInfo[playerid][pScore] = 0;
        
PlayerInfo[playerid][pKills] = 0;
        
PlayerInfo[playerid][pDeaths] = 0;
        
PlayerInfo[playerid][pHoldups] = 0;
        
PlayerInfo[playerid][pCrimes] = 0;
        
PlayerInfo[playerid][pFined] = 0;
        
PlayerInfo[playerid][pArrests] = 0;
        
PlayerInfo[playerid][pTakedowns] = 0;
        
PlayerInfo[playerid][pTickets] = 0;
        
PlayerInfo[playerid][pRope] = 0;
        
PlayerInfo[playerid][pPaintCan] = 0;
        
PlayerInfo[playerid][pScissors] = 0;
        
PlayerInfo[playerid][pKits] = 0;
        
PlayerInfo[playerid][vLock] = 0;
        
PlayerInfo[playerid][Helper] = 0;
        
PlayerInfo[playerid][hHelper] = 0;
        
PlayerInfo[playerid][pWarns] = 0;
        
PlayerInfo[playerid][pKicks] = 0;
        
PlayerInfo[playerid][pJoins] = 1;
        
PlayerInfo[playerid][pArrests] = 0;
        
PlayerInfo[playerid][pMaterials] = 0;
        
PlayerInfo[playerid][Banned] = 0;
        
PlayerInfo[playerid][jTime] = 0;
        
PlayerInfo[playerid][pWanted] = 0;
        
PlayerInfo[playerid][pArmour] = 0.0;
        
PlayerInfo[playerid][pHealth] = 0.0;
        
PlayerInfo[playerid][cTime] = 0;
        
PlayerInfo[playerid][pSkin] = 0;


        new 
INI:ufile INI_Open(userfile);
        
INI_WriteInt(ufile"aLevel",PlayerInfo[playerid][aLevel]);
        
INI_WriteInt(ufile"vLevel",PlayerInfo[playerid][vLevel]);
        
INI_WriteInt(ufile"pCash"PlayerInfo[playerid][pCash]);
        
INI_WriteInt(ufile"pScore"PlayerInfo[playerid][pScore]);
        
INI_WriteInt(ufile"pKills"PlayerInfo[playerid][pKills]);
        
INI_WriteInt(ufile"pDeaths"PlayerInfo[playerid][pDeaths]);
        
INI_WriteInt(ufile"pHoldups"PlayerInfo[playerid][pHoldups]);
        
INI_WriteInt(ufile"pCrimes"PlayerInfo[playerid][pCrimes]);
        
INI_WriteInt(ufile"pFined"PlayerInfo[playerid][pFined]);
        
INI_WriteInt(ufile"pArrests"PlayerInfo[playerid][pArrests]);
        
INI_WriteInt(ufile"pTakedowns"PlayerInfo[playerid][pTakedowns]);
        
INI_WriteInt(ufile"pTickets"PlayerInfo[playerid][pTickets]);
        
INI_WriteInt(ufile"pRope"PlayerInfo[playerid][pRope]);
        
INI_WriteInt(ufile"pPaintCan"PlayerInfo[playerid][pPaintCan]);
        
INI_WriteInt(ufile"pScissors"PlayerInfo[playerid][pScissors]);
        
INI_WriteInt(ufile"pKits"PlayerInfo[playerid][pKits]);
        
INI_WriteInt(ufile"vLock"PlayerInfo[playerid][vLock]);
        
INI_WriteInt(ufile"Helper"PlayerInfo[playerid][Helper]);
        
INI_WriteInt(ufile"hHelper"PlayerInfo[playerid][hHelper]);
        
INI_WriteInt(ufile"pWarns"PlayerInfo[playerid][pWarns]);
        
INI_WriteInt(ufile"pKicks"PlayerInfo[playerid][pKicks]);
        
INI_WriteInt(ufile"pJoins"PlayerInfo[playerid][pJoins]);
        
INI_WriteInt(ufile"pMaterials"PlayerInfo[playerid][pMaterials]);
        
INI_WriteInt(ufile"Banned"PlayerInfo[playerid][Banned]);
        
INI_WriteInt(ufile"jTime"PlayerInfo[playerid][jTime]);
        
INI_WriteInt(ufile"pWanted"PlayerInfo[playerid][pWanted]);
        
INI_WriteFloat(ufile"pArmour"PlayerInfo[playerid][pArmour]);
        
INI_WriteFloat(ufile"pHealth"PlayerInfo[playerid][pHealth]);
        
INI_WriteInt(ufile"cTime"PlayerInfo[playerid][cTime]);
       
INI_WriteInt(ufile"pSkin"PlayerInfo[playerid][pSkin]);
        
INI_Close(ufile);

        
format(fstr,sizeof(fstr),"{FFFFFF}Welcome to  %s!\n\nYour not registered yet, please enter a password below to register:"GetName(playerid));
        
ShowPlayerDialog(playeridREGISTER_MENUDIALOG_STYLE_INPUT"{FFFFFF} Account Register"fstr"Register""Quit"); 
THIS LINE IS FOR FIRST TIME SPAWN , i mean, for new player reigster but whenever they choose a skin and click on spawn button they spawn with Cj skin cuz of this "PlayerInfo[playerid][pSkin] = 0;" . I don't know what to put here. Anyone help me?

PHP код:
public LoadUser_data(playeridname[], value[])
{
    
INI_String("pPass"PlayerInfo[playerid][pPass], 129);
    
INI_Int("aLevel"PlayerInfo[playerid][aLevel]);
    
INI_Int("vLevel"PlayerInfo[playerid][vLevel]);
    
INI_Int("pCash"PlayerInfo[playerid][pCash]);
    
INI_Int("pScore"PlayerInfo[playerid][pScore]);
    
INI_Int("pKills"PlayerInfo[playerid][pKills]);
    
INI_Int("pDeaths"PlayerInfo[playerid][pDeaths]);
    
INI_Int("pHoldups"PlayerInfo[playerid][pHoldups]);
    
INI_Int("pCrimes"PlayerInfo[playerid][pCrimes]);
    
INI_Int("pFined"PlayerInfo[playerid][pFined]);
    
INI_Int("pArrests"PlayerInfo[playerid][pArrests]);
    
INI_Int("pTakedowns"PlayerInfo[playerid][pTakedowns]);
    
INI_Int("pTickets"PlayerInfo[playerid][pTickets]);
    
INI_Int("pRope"PlayerInfo[playerid][pRope]);
    
INI_Int("pPaintCan"PlayerInfo[playerid][pPaintCan]);
    
INI_Int("pScissors"PlayerInfo[playerid][pScissors]);
    
INI_Int("pKits"PlayerInfo[playerid][pKits]);
    
INI_Int("vLock"PlayerInfo[playerid][vLock]);
    
INI_Int("Helper"PlayerInfo[playerid][Helper]);
    
INI_Int("hHelper"PlayerInfo[playerid][hHelper]);
    
INI_Int("pJoins"PlayerInfo[playerid][pJoins]);
    
INI_Int("pMaterials"PlayerInfo[playerid][pMaterials]);
    
INI_Int("pWarns"PlayerInfo[playerid][pWarns]);
    
INI_Int("pKicks"PlayerInfo[playerid][pKicks]);
    
INI_Int("Banned"PlayerInfo[playerid][Banned]);
    
INI_Int("jTime"PlayerInfo[playerid][jTime]);
    
INI_Float("pArmour"PlayerInfo[playerid][pArmour]);
    
INI_Float("pHealth"PlayerInfo[playerid][pHealth]);
    
INI_Int("pWanted"PlayerInfo[playerid][pWanted]);
    
INI_Int("cTime"PlayerInfo[playerid][cTime]);
INI_WriteInt(ufile"pSkin"PlayerInfo[playerid][pSkin]);
    return 
1;

here's my all code.
Reply


Messages In This Thread
Skin saving error - by STONEGOLD - 01.06.2015, 06:18
Re: Skin saving error - by SoFahim - 01.06.2015, 06:40
Re: Skin saving error - by STONEGOLD - 01.06.2015, 06:55
Re: Skin saving error - by Stanford - 01.06.2015, 09:48
Re: Skin saving error - by Bennyy - 01.06.2015, 10:10
Re: Skin saving error - by sscarface - 01.06.2015, 14:16
Re: Skin saving error - by STONEGOLD - 01.06.2015, 14:19
Re: Skin saving error - by Konstantinos - 01.06.2015, 14:28
Re: Skin saving error - by Bennyy - 01.06.2015, 14:44
Re: Skin saving error - by STONEGOLD - 01.06.2015, 15:27

Forum Jump:


Users browsing this thread: 1 Guest(s)