SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 02/08/2020, 12:10 PM   #1
diliyar413
Little Clucker
 
Join Date: Jul 2011
Posts: 18
Reputation: 0
Default Every time you log in, the money is 0

The database is correct, you can even buy items, the balance will be negative,
I re-enter the game, the money is still 0,
/stats display is accurate。 help me please.
diliyar413 is offline   Reply With Quote
Old 02/08/2020, 12:59 PM   #2
Kursed
Huge Clucker
 
Kursed's Avatar
 
Join Date: Jan 2015
Posts: 280
Reputation: 35
Default Re: Every time you log in, the money is 0

Did you save player data when disconnect?
__________________
Kursed is offline   Reply With Quote
Old 02/08/2020, 01:11 PM   #3
diliyar413
Little Clucker
 
Join Date: Jul 2011
Posts: 18
Reputation: 0
Default Re: Every time you log in, the money is 0

Quote:
Originally Posted by Kursed View Post
Did you save player data when disconnect?
Yes, the amount of green money in the upper right corner is 0
But /stats is accurate
diliyar413 is offline   Reply With Quote
Old 02/08/2020, 01:25 PM   #4
XGreen
Huge Clucker
 
XGreen's Avatar
 
Join Date: May 2014
Location: Manila
Posts: 207
Reputation: 8
Default Re: Every time you log in, the money is 0

Under OnPlayerSpawn or OnPlayerConnect

GivePlayerMoney(playerid, <Your money variable that is beings saved on the database>);
XGreen is offline   Reply With Quote
Old 02/08/2020, 01:40 PM   #5
xRadical3
Gangsta
 
Join Date: May 2017
Location: Iran
Posts: 692
Reputation: 63
Default Re: Every time you log in, the money is 0

Show us how you load players data.
xRadical3 is offline   Reply With Quote
Old 02/08/2020, 02:43 PM   #6
cipi89
Little Clucker
 
Join Date: Sep 2018
Posts: 30
Reputation: 3
Default Re: Every time you log in, the money is 0

Every time player logs you need to reset his default GTA money and set it back to the amount of money you have saved in your database in order for it to be shown on the screen.

Lets say you're saving your money in database like this:
Code:
Data[playerid][money]
so you should have this on player login
Code:
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, Data[playerid][money]);
cipi89 is offline   Reply With Quote
Old 02/08/2020, 03:43 PM   #7
makemoneynotfriends
Big Clucker
 
Join Date: Jan 2020
Location: Egypt
Posts: 138
Reputation: 3
Default Re: Every time you log in, the money is 0

update
Data[playerid][money]
to
GetPlayerMoney(playerid)
in the saving
makemoneynotfriends is offline   Reply With Quote
Old 03/08/2020, 12:07 PM   #8
diliyar413
Little Clucker
 
Join Date: Jul 2011
Posts: 18
Reputation: 0
Default Re: Every time you log in, the money is 0

Because of nex AC, it was normal before
diliyar413 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Online time money Mattski Scripting Help 34 03/12/2019 05:35 PM
HELP about Random Money and Time :) AngeloBrand98 Scripting Help 6 19/08/2017 03:48 PM
Money is losing each time I go off. Zlaja Scripting Help 6 25/07/2013 01:11 PM
Wait a certained time before you receive money. Verth Scripting Help 3 10/07/2013 10:14 PM
Need help which move object which time and money doreto Help Archive 5 12/11/2010 01:28 PM


All times are GMT. The time now is 01:40 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.