[Include] OnPlayerMoneyChange
#1

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:
pawn Код:
#include <OPMC>
Example script:
pawn Код:
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
Reply


Messages In This Thread
OnPlayerMoneyChange - by Biesmen - 08.05.2011, 21:06
Re: OnPlayerMoneyChange - by Alby Fire - 08.05.2011, 22:23
Re: OnPlayerMoneyChange - by Ironboy - 09.05.2011, 07:33
Re: OnPlayerMoneyChange - by justsomeguy - 09.05.2011, 09:12
Re: OnPlayerMoneyChange - by Biesmen - 09.05.2011, 09:30
Re: OnPlayerMoneyChange - by wups - 09.05.2011, 16:14
Re: OnPlayerMoneyChange - by nuriel8833 - 09.05.2011, 16:25
Re: OnPlayerMoneyChange - by Biesmen - 09.05.2011, 16:41
Re: OnPlayerMoneyChange - by Jay_ - 09.05.2011, 16:53
Re: OnPlayerMoneyChange - by Biesmen - 09.05.2011, 17:06
Re: OnPlayerMoneyChange - by wups - 09.05.2011, 17:55
Re: OnPlayerMoneyChange - by justsomeguy - 09.05.2011, 18:28
Re: OnPlayerMoneyChange - by Davz*|*Criss - 09.05.2011, 18:30
Re: OnPlayerMoneyChange - by Biesmen - 09.05.2011, 19:02
Re: OnPlayerMoneyChange - by wups - 09.05.2011, 19:10
Re: OnPlayerMoneyChange - by xalith - 17.05.2011, 18:03
Re: OnPlayerMoneyChange - by -=Dark=- - 28.05.2011, 15:04
AW: OnPlayerMoneyChange - by Forbidden - 01.06.2011, 17:29
Re: OnPlayerMoneyChange - by Marshall32 - 07.12.2011, 18:17
AW: OnPlayerMoneyChange - by BigETI - 07.12.2011, 18:19
Re: OnPlayerMoneyChange - by Biesmen - 16.02.2012, 21:35
Re: OnPlayerMoneyChange - by Deskoft - 16.02.2012, 22:15
Re: OnPlayerMoneyChange - by KingHual - 17.02.2012, 03:44
Respuesta: OnPlayerMoneyChange - by [Nikk] - 17.02.2012, 09:35

Forum Jump:


Users browsing this thread: 1 Guest(s)