money Fast Help
#1

hi i need help money saves if i relo,g but if i restart from host i get money set to 0 ....why??il give rep... i really need help..
Reply
#2

show us the script or something, We can't do anything about that like this.
Reply
#3

like what to show if i relog and and go in svr money saves..if i restart gm money sets to 0 ..
Reply
#4

please show us the script, we cannot say anything wihtout it, as we cannot say if the code is ok or not
Reply
#5

PHP код:
public OnPlayerUpdateEx(playerid)
                    {
                    if(
IsPlayerConnected(playerid))
                    {
                    if(
gPlayerLogged[playerid])
                    {
                    new 
string3[32];
                    new 
playername3[MAX_PLAYER_NAME];
                    
GetPlayerName(playerid, playername3, sizeof(playername3));
                    
format(string3, sizeof(string3), "%s.ini", playername3);
                    new 
File: hFile = fopen(string3, io_write);
                    if (
hFile)
                    {
                        new var[
32];
                        
format(var, 64, "Key=%s\n", PlayerInfo[playerid][pKey]);fwrite(hFile, var);
                        
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
                        
format(var, 64, "Level=%d\n",PlayerInfo[playerid][pLevel]);fwrite(hFile, var);
                        
format(var, 64, "Wanted=%d\n",PlayerInfo[playerid][pWantedLevel]);fwrite(hFile, var);
                        
format(var, 64, "AdminLevel=%d\n",PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
                        
format(var, 64, "Lighter=%d\n",PlayerInfo[playerid][pLighter]);fwrite(hFile, var);
                        
format(var, 64, "Cigarettes=%d\n",PlayerInfo[playerid][pCigarettes]);fwrite(hFile, var);
                        
format(var, 64, "GMLevel=%d\n",PlayerInfo[playerid][pGm]);fwrite(hFile, var);
                        
format(var, 64, "DonateRank=%d\n",PlayerInfo[playerid][pDonateRank]);fwrite(hFile, var);
                        
format(var, 64, "UpgradePoints=%d\n",PlayerInfo[playerid][gPupgrade]);fwrite(hFile, var);
                        
format(var, 64, "ConnectedTime=%d\n",PlayerInfo[playerid][pConnectTime]);fwrite(hFile, var);
                        
format(var, 64, "Registered=%d\n",PlayerInfo[playerid][pReg]);fwrite(hFile, var);
                        
format(var, 64, "Sex=%d\n",PlayerInfo[playerid][pSex]);fwrite(hFile, var);
                        
format(var, 64, "Age=%d\n",PlayerInfo[playerid][pAge]);fwrite(hFile, var);
                        
format(var, 64, "Origin=%d\n",PlayerInfo[playerid][pOrigin]);fwrite(hFile, var);
                        
format(var, 64, "CK=%d\n",PlayerInfo[playerid][pCK]);fwrite(hFile, var);
                        
format(var, 64, "Muted=%d\n",PlayerInfo[playerid][pMuted]);fwrite(hFile, var);
                        
format(var, 64, "Respect=%d\n",PlayerInfo[playerid][pExp]);fwrite(hFile, var);
                        
format(var, 64, "Money=%d\n",PlayerInfo[playerid][pCash]);fwrite(hFile, var);
                        
format(var, 64, "Bank=%d\n",PlayerInfo[playerid][pAccount]);fwrite(hFile, var); 
Reply
#6

Show us OnPlayerExit
Reply
#7

PHP код:
public OnPlayerDisconnect(playerid,reason)
                    {
                    
KillTimer(RefillingTimer[playerid]);
                    
KillTimer( PlayerInfo[playerid][SpawnTimer] );
                    
gActivePlayers[playerid]--;
                    
numplayers--;
                    
TextDrawDestroy(Nume[playerid]);
                    
TextDrawDestroy(Textdraw1[playerid]);
                    
TextDrawDestroy(Textdraw49[playerid]);
                    
TextDrawDestroy(Textdraw54[playerid]);
                    
PlayerInfo[playerid][pAdjustable] = 1;
                    
OnPlayerUpdateEx(playerid); 
onpalyerexit dont have.. this i think..
Reply
#8

format(var, 64, "Money=%d\n",PlayerInfo[playerid][pCash]);fwrite(hFile, var);

to

format(var, 64, "Money=%d\n",GetPlayerMoney(playerid));fwrite(hFil e, var);

not sure, but you can try
Reply
#9

the money saves if i quit and play again money saves good ... but if i restart gm..
Reply
#10

hmm needs to be a save on disconnect
Reply


Forum Jump:


Users browsing this thread: