Raised This Month: $51 Target: $400
 12% 

[HELP] Hooking Money Event


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-01-2016 , 07:48   [HELP] Hooking Money Event
Reply With Quote #1

How do you hook the money event properly? i tried below, but it doesn't seem to work when i call set_user_money

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "irblu"


new g_MsgMoney

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say money2""cash2")
    
    
g_MsgMoney get_user_msgid("Money")
    
    
register_event("Money""event_money""b")
    
register_message(g_MsgMoney"message_money")
    
}    

public 
event_money(id)
{
    
client_print(0print_chat"Event Triggered")
}

public 
message_money(blablablaid)
{
    
client_print(0print_chat"Message Triggered")
}

public 
cash2(id)
{
    
cs_set_user_money(idcs_get_user_money(id) + 10000)

__________________

Last edited by Depresie; 09-01-2016 at 10:15.
Depresie is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 09-02-2016 , 04:49   Re: [HELP] Hooking Money Event
Reply With Quote #2

You may hook AddAccount
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 09-02-2016 , 07:02   Re: [HELP] Hooking Money Event
Reply With Quote #3

cs_set_user_money uses direct CBasePlayer member change and sends Money usermsg bypassing metamod/amxmodx hooks, so it can't simple hooked.
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-02-2016 , 09:07   Re: [HELP] Hooking Money Event
Reply With Quote #4

Quote:
Originally Posted by PRoSToTeM@ View Post
cs_set_user_money uses direct CBasePlayer member change and sends Money usermsg bypassing metamod/amxmodx hooks, so it can't simple hooked.
Thanks
__________________
Depresie is offline
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 18:21.


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