multiply your debt!
#1

if someone is in debt on my server (negative money) this is also save in the ini files on my server... but
if this person reconnects, the negative money is STILL IN RAM. i used GivePlayerMoney, not SetPlayerMoney, in all of my scripts, so this person ends up with their debt being multiplied by 2. this only happens with negative numbers. I have already fixed it in my script. just wanted to let somebody know that it could happen (probably because everything is stored in RAM instead of unloading it. why do you think sa-mp loads so much faster now?)
Reply
#2

Quote:
Originally Posted by Yourfatness
Посмотреть сообщение
if someone is in debt on my server (negative money) this is also save in the ini files on my server... but
if this person reconnects, the negative money is STILL IN RAM. i used GivePlayerMoney, not SetPlayerMoney, in all of my scripts, so this person ends up with their debt being multiplied by 2. this only happens with negative numbers. I have already fixed it in my script. just wanted to let somebody know that it could happen (probably because everything is stored in RAM instead of unloading it. why do you think sa-mp loads so much faster now?)
Redefine GivePlayerMoney and define it as SetPlayerMoney
pawn Код:
stock SetPlayerMoney(playerid, money)
{
    ResetPlayerMoney(playerid);
    GivePlayerMoney(playerid, money);
}
Reply
#3

one of my friends played for the first time in months... this means it couldnt be stored in ram... and still ended up in debt.
once again, just thought i would post this, it's already been fixed on my server.
Reply
#4

"stored in ram".

If you declare a variable in pawn and do not re-set it. The variable will remain having it's value until changed by the script. So if you save the data on an enum that is connected to the player ID, it could also just mean that you are giving the guy the money thats set on the variable AND the saved amount. Which ends up multiplied.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)