Money Saving wrong
#1

Alright for some reason my money when ever someone log's back in after they disconnect and stuff my money is loading it and giving them it as a negative. Anyone know the problem?

Here is the money saving line it's under a public

pawn Код:
dini_IntSet(file,"Money",PlayerInfo[playerid][pMoney]-GetPlayerMoney(playerid));
And btw the money saves as the player disconnects if that helps.
Reply
#2

Could you explain why you did:

pawn Код:
dini_IntSet(file,"Money",PlayerInfo[playerid][pMoney]-GetPlayerMoney(playerid));
And not:

pawn Код:
dini_IntSet(file,"Money",GetPlayerMoney(playerid));
Or:

pawn Код:
PlayerInfo[playerid][pMoney] = GetPlayerMoney(playerid);
dini_IntSet(file,"Money",PlayerInfo[playerid][pMoney]);
Reply
#3

pawn Код:
dini_IntSet(file,"Money",PlayerInfo[playerid][pMoney]);
and make sure u have the onplayerupdate or timer

pawn Код:
if(IsPlayerConnected(playerid))
    {
        if( GetPlayerMoney(playerid) != PlayerInfo[playerid][pMoney])
        {
            ResetPlayerMoney(playerid);
            GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
        }
    }
Reply
#4

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
Could you explain why you did:

pawn Код:
dini_IntSet(file,"Money",PlayerInfo[playerid][pMoney]-GetPlayerMoney(playerid));
And not:

pawn Код:
dini_IntSet(file,"Money",GetPlayerMoney(playerid));
Or:

pawn Код:
PlayerInfo[playerid][pMoney] = GetPlayerMoney(playerid);
dini_IntSet(file,"Money",PlayerInfo[playerid][pMoney]);
To be honest, im retarded.
Reply
#5

Quote:
Originally Posted by Steven82
Посмотреть сообщение
To be honest, im retarded.
Haha, good answer !! Jk, did you get it working properly?
Reply
#6

Yes sir Thank you
Reply
#7

Quote:
Originally Posted by Steven82
Посмотреть сообщение
To be honest, im retarded.
o_O I have No clue what to say.. heh
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)