/shop & /bombshop - money bug.
#1

Alright, lads this all complies into one.

The amount of cash you log in with stays there until you log out, say for an example - you log out with -5,000 and you'll log back in with -5,000 and get up to the positives; $6,000.

You'll still not be able to buy from /shop and /bombshop due to the simple fact you logged in with -5,000.


If you log in with positive $5,000 and waste it all in /shop or /bombshop then you can keep buying stuff even whilst in the negative - when you log out you'll log back in with negative.


Is there anyway you can update the money stats whilst in-game automatically?

This is one of my cases from /shop (exact same to every other case)
pawn Код:
case 1:{
    if(PlayerInfo[playerid][pCash] <= 1499)
    {
        SendClientMessage(playerid, GREY, "Shop: You need $1500!");
        return 1;
    }
    else if(PlayerInfo[playerid][pCash] >= 1500)
    GivePlayerWeapon(playerid, 31, 600);
    GivePlayerMoney(playerid, -1500);
This is what I have to write in my scriptfile - OnPlayerDisconnect.
pawn Код:
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
I have this in my /stats
pawn Код:
new cash = PlayerInfo[playerid][pCash];
This is when loading up the data.
pawn Код:
INI_Int("Cash",PlayerInfo[playerid][pCash]);
Reply
#2

Where you do GivePlayerMoney(playerid, -1500);, you should do PlayerInfo[playerid][pCash]=- 1500;. Otherwise it just removes it from the money from the player, but not from the variable

Edit: If you want to add things to the variable, you should use the '+='. (if you didnt know this already)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)