Money bug ?
#1

Well, everytime people crash / die or respawn, they lose all their money, anyone know how to fix this? Since my playerbase is quiet high and its a major bug.
Reply
#2

Post your code.
Reply
#3

OnPlayerDeath or which one?
Reply
#4

Quote:
Originally Posted by 2fast4you
OnPlayerDeath or which one?
OnPlayerDeath and your spawn code, OnPlayerSpawn or whatever you have it defined as.
Reply
#5

OnPlayerDeath code : http://pastebin.com/m30ecf9ab

OnPlayerSpawn code : http://pastebin.com/m500cf958
Reply
#6

hm. I'v got the same bug. And there's no money reset after player death or spawn in script...
Reply
#7

Save the money to a variable then and give it to the player on spawn. Reset the money before giving it just in case
Reply
#8

Uhm, could u guide me a bit more pl0x? Like how to do it etc..
Reply
#9

ok, I've made it and test it. Works fine.

at the top of script:

new money[MAX_PLAYERS];
------------------

OnPlayerConnect:

money[playerid] = 0;

-------------------------
OnPlayerDeath:

money[playerid] = GetPlayerMoney(playerid);

----------------------------
OnPlayerSpawn:

GivePlayerMoney(playerid,money[playerid]);

that will save your money summ after death and give it after spawn
Reply
#10

Hmm, when i /kill, my money goes up double , but then goes back to 0?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)