PPC Business Help
#1

Hey I am using PPC Business and when I go to collect my earnings with /busmenu > Retrieve Earnings its giving me my money then taking straight back off me again? like giving it then taking it straight at the same time?
Reply
#2

bump
Reply
#3

bump
Reply
#4

Did you look at the bottom of the script?

Your gamemode must have some sort of server-sided money system, which is responsible for what you're describing.

The business-script tries to call your gamemode to send the money to your script.
If it wasn't successfull, it uses GivePlayerMoney instead (client-sided money).
pawn Код:
// This function is used to set the player's money
INT_GivePlayerMoney(playerid, Money)
{
    // Setup local variables
    new Success;

    // Try to call the external function to get the player's money (used to send the serversided money for this player)
    Success = CallRemoteFunction("Admin_GivePlayerMoney", "ii", playerid, Money);

    // The external function returned "0" as the function is not used in another script
    if (Success == 0)
        GivePlayerMoney(playerid, Money); // Use the normal money (client-sided money)
}
This is the code used to reward the player with money from within the filterscript.

In order to make it compatible with your gamemode, you need to copy the commented "Admin_GivePlayerMoney" function to your gamemode and adjust the code slightly where that function should store the received money value.
pawn Код:
// This function is used to set the player's money
forward Admin_GivePlayerMoney(playerid, Money);
public Admin_GivePlayerMoney(playerid, Money)
{
    // Add the given money to the player's account
    APlayerData[playerid][PlayerMoney] = APlayerData[playerid][PlayerMoney] + Money;

    // Return that the function had success
    return 1;
}
This is the function you need to copy to your gamemode (or whatever script you use that handles server-sided money) and adjust the variables for money-storage.



If you do this, the business script is able to call that remote function in your other script to send the money there, instead of using hackable client-sided money, which your script is removing a second later.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)