[Release][SA-MP][Include] OnPlayerMoneyChange

Results 1 to 1 of 1
  1. #1
    01010010 01011010 Biesmen is offline
    Super ModRank
    Apr 2007 Join Date
    2,517Posts

    [Release][SA-MP][Include] OnPlayerMoneyChange

    [Note: All my releases here are also released on the original SA-MP forum!]
    [Note 2: It's dead here, so I decided to release my releases here.]

    OnPlayerMoneyChange 2.0
    Created by: Biesmen

    About
    Previously I made an include called OnPlayerEarnMoney and OnPlayerLoseMoney. After thinking wisely I came up with an conclusion that include wouldn't work properly as it should do. I decided to recreate it and rename it. The script is very easy to understand. The script will check the player's money once he spawns and store it in a variable. This will support servers who have a register/login system. If the player's money changes, negative or positive, it will call the callback "OnPlayerMoneyChange", with the amount that has been changed.

    Version
    Version 2.0

    Change log:
    Version 2.0
    -Added one parameter to the callback: TotalAmount. This will return the money you have when the callback OnPlayerMoneyChange is being called.
    -Modified a variable in the OnPlayerUpdate callback, in the include. Unnecessarily usage of MAX_PLAYERS is not needed.

    How-to
    Copy the script of the pastebin url.
    Open a new notepad file. Paste the script you copied at the pastebin url.
    Go to your GTA San Andreas server files folder.
    Save the notepad file as OPMC.inc at /pawno/include.

    In your gamemode/filterscript/script:
    Type this at your includes list, at the top of your script:
    Code:
    #include <OPMC>
    Example script:
    Code:
    public OnPlayerMoneyChange(playerid, amount, totalamount)
    {
    	new string[100];
    	format(string, sizeof(string), "Your money has been changed with a value of $%i. Your total balance is: $%i", amount, totalamount);
    	SendClientMessage(playerid, -1, string);
    	return 1;
    }
    Download
    Pastebin Version: 2.0
    Pastebin Version: 1.0
    No mirrors allowed!

    Known bugs
    None so far.
    Feel free to post bugs on this section, if you found any.

    Credits
    • Biesmen
    • Wups - Idea for the ALS Hooking





Advertisement