SA-MP Forums Archive
money Fast Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: money Fast Help (/showthread.php?tid=366876)



money Fast Help - Akcent_Voltaj - 08.08.2012

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..


Re: money Fast Help - RowdyrideR - 08.08.2012

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


Re: money Fast Help - Akcent_Voltaj - 08.08.2012

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


Re: money Fast Help - Jstylezzz - 08.08.2012

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


Re: money Fast Help - Akcent_Voltaj - 08.08.2012

PHP код:
public OnPlayerUpdateEx(playerid)
                    {
                    if(
IsPlayerConnected(playerid))
                    {
                    if(
gPlayerLogged[playerid])
                    {
                    new 
string3[32];
                    new 
playername3[MAX_PLAYER_NAME];
                    
GetPlayerName(playeridplayername3sizeof(playername3));
                    
format(string3sizeof(string3), "%s.ini"playername3);
                    new 
FilehFile fopen(string3io_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); 



Re: money Fast Help - [EuG]ZeRoGoD - 08.08.2012

Show us OnPlayerExit


Re: money Fast Help - Akcent_Voltaj - 08.08.2012

PHP код:
public OnPlayerDisconnect(playerid,reason)
                    {
                    
KillTimer(RefillingTimer[playerid]);
                    
KillTimerPlayerInfo[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..


Re: money Fast Help - Jstylezzz - 08.08.2012

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


Re: money Fast Help - Akcent_Voltaj - 08.08.2012

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


Re: money Fast Help - [EuG]ZeRoGoD - 08.08.2012

hmm needs to be a save on disconnect