14.09.2013, 22:54
Hi guys
I have problem with saving player stats... The problem is that the stats are messing up when i close my gamemode i have this code under OnGameModeExit
Eg. If i had 10.000 cash and someone from the onnline players had 5000 and then MySQL will save/write 5000 cash to me also... And my player stats are forever GONE
I have problem with saving player stats... The problem is that the stats are messing up when i close my gamemode i have this code under OnGameModeExit
pawn Код:
public OnGameModeExit()
{
ZacuvajIgraci()
return 1;
}
forward ZacuvajIgraci();
public ZacuvajIgraci()
{
foreach(new i : Player)
{
if(IsPlayerConnected(i))
{
if(ProfilVcitan[i] == 1)
{
format( queryig, sizeof(queryig), "UPDATE Igraci SET pKey = '%s', pLevel = '%d', pAdmin = '%d', pDonateRank = '%d', pConnectTime = '%d', pReg = '%d', pSex = '%d', pAge = '%d', pOrigin = '%d', pExp = '%d', pCash = '%d', pAccount = '%d', pPhoneBook = '%d', pLottoNr = '%d', pFishes = '%d', pBiggestFish = '%d', pJob = '%d', pPayCheck = '%d', pHeadValue = '%d', pJailed = '%d'",
PlayerInfo[i][pKey],
PlayerInfo[i][pLevel],
PlayerInfo[i][pAdmin],
PlayerInfo[i][pDonateRank],
PlayerInfo[i][pConnectTime],
PlayerInfo[i][pReg],
PlayerInfo[i][pSex],
PlayerInfo[i][pAge],
PlayerInfo[i][pOrigin],
PlayerInfo[i][pExp],
PlayerInfo[i][pCash],
PlayerInfo[i][pAccount],
PlayerInfo[i][pPhoneBook],
PlayerInfo[i][pLottoNr],
PlayerInfo[i][pFishes],
PlayerInfo[i][pBiggestFish],
PlayerInfo[i][pJob],
PlayerInfo[i][pPayCheck],
PlayerInfo[i][pHeadValue],
PlayerInfo[i][pJailed]);
//etc,etc,etc,etc
//etc,etc,etc,etc
//etc,etc,etc,etc
//etc,etc,etc,etc
//etc,etc,etc,etc
}
}
}
return 1;
}
