Raised This Month: $ Target: $400
 0% 

Catch when a player loose some amount of money


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 04-10-2011 , 04:26   Catch when a player loose some amount of money
Reply With Quote #1

How to properly catch when a player spend some money, or his money decrease?
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-10-2011 , 04:27   Re: Catch when a player loose some amount of money
Reply With Quote #2

Hook the "Money" event and check the new value against the old value?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 04-10-2011 , 09:34   Re: Catch when a player loose some amount of money
Reply With Quote #3

if you could show me an example cuz i'm confused
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-10-2011 , 10:22   Re: Catch when a player loose some amount of money
Reply With Quote #4

It seems that you start coding ???

PHP Code:
#include <amxmodx>

#define MAX_PLAYERS        32

#define VERSION "0.0.1"
#define PLUGIN ""

new g_iLastMoney[MAX_PLAYERS+1]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")
    
register_event("Money""Event_Money""b")
}

public 
Event_Moneyid )
{
    new 
iMoney read_data(1)
    new 
iMoneyDiff g_iLastMoney[id] - iMoney
    g_iLastMoney
[id] = iMoney
    
if( iMoneyDiff )
    {
        
// player has lost $iMoneyDiff
    
}

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 04-10-2011 , 14:00   Re: Catch when a player loose some amount of money
Reply With Quote #5

Quote:
Originally Posted by ConnorMcLeod View Post
It seems that you start coding ???

PHP Code:
#include <amxmodx>

#define MAX_PLAYERS        32

#define VERSION "0.0.1"
#define PLUGIN ""

new g_iLastMoney[MAX_PLAYERS+1]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")
    
register_event("Money""Event_Money""b")
}

public 
Event_Moneyid )
{
    new 
iMoney read_data(1)
    new 
iMoneyDiff g_iLastMoney[id] - iMoney
    g_iLastMoney
[id] = iMoney
    
if( iMoneyDiff )
    {
        
// player has lost $iMoneyDiff
    
}

yeah )
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:11.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode