Money help please
#1

Hi

i trying make some dialog when player have X ammot of point so he can buy cash with that.
but that not giving the money, i made whole system with that " rewards " aka points, player car buy cars and more few things and rest works, just that money part not working,

Well this is the code of cash

pawn Код:
if(PlayerInfo[playerid][pRewards]<34) return SendClientError(playerid,"Not enough rewards");
                    {
                        new camorra[128];
                        new amount = 2500000;
                        PlayerInfo[playerid][pRewards] = PlayerInfo[playerid][pRewards]-35;
                        dini_IntSet(PlayerInfo[playerid],"rewards",PlayerInfo[playerid][pRewards]);
                        SendClientMessage(playerid, COLOR_WHITE,"-------------------------");
                        format(camorra, sizeof(camorra), "{e94a4a}[info:]{f1a3a4} You have received  {003300}%d $ ", amount);
                        SendClientMessage(playerid, COLOR_RED, camorra);
                        SendClientMessage(playerid, COLOR_WHITE,"-------------------------");
                        GivePlayerMoneyEx(playerid, 2500000);
                                    //GivePlayerMoneyEx(playerid, amount); also tryed with that
                    }
                    return 1;
Reply
#2

Show us
pawn Код:
stock GivePlayerMoneyEx(playerid, amount)
Reply
#3

What are you using to save data such as player's money? Instead of using the GivePlayerMoneyEx just load the player's money on a variable let's say called "Money" and use
SetPlayerMoney(playerid, strval(Money)+amount);
or
GivePlayerMoney(playerid, amount);
Reply
#4

This one part of " Rewards " this things works but the buytable not works.

pawn Код:
if(PlayerInfo[i][pRewards]==10)
        {
            new camorrastring[128];
            new amount = 150000;
            format(camorrastring, sizeof(camorrastring), "{e94a4a}[info:]{f1a3a4} You have received {003300}$%d Reward", amount);
            SendClientMessage(i, COLOR_RED, camorrastring);
            GivePlayerMoneyEx(i,amount);

        }
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)