Raised This Month: $ Target: $400
 0% 

Money as Health


Post New Thread Reply   
 
Thread Tools Display Modes
Fedde
BANNED
Join Date: Sep 2011
Old 10-27-2011 , 10:58   Re: Money as Health
Reply With Quote #11

Quote:
Originally Posted by Bugsy View Post
What do you want displayed in the regular health HUD? Does the money HUD get reduced by purchases and increased for kills etc like normal money?
I want to block regular Health HUD and use the money hud for it.
Fedde is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 10-27-2011 , 12:00   Re: Money as Health
Reply With Quote #12

You should register the Health message and update the Money when a Health message is sent.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-27-2011 , 12:54   Re: Money as Health
Reply With Quote #13

Untested
Edit: Don't use this, try and see for yourself why :X
PHP Code:
#include <amxmodx> 
#include <cstrike>

public plugin_init() 
{
   
register_messageget_user_msgid"Health" ) , "MessageHealth" ); //byte
   
register_messageget_user_msgid"Money" ) , "MessageMoney" ); //long 


public 
MessageHealthmsgid dest id 

   
cs_set_user_moneyid get_msg_arg_int) , );
   
set_msg_arg_int ARG_BYTE );


public 
MessageMoneymsgid dest id 

   
set_msg_arg_intARG_LONG get_user_healthid ) ); 

__________________

Last edited by Bugsy; 10-27-2011 at 19:43.
Bugsy is offline
Fedde
BANNED
Join Date: Sep 2011
Old 10-27-2011 , 22:16   Re: Money as Health
Reply With Quote #14

Quote:
Originally Posted by Bugsy View Post
Untested
Edit: Don't use this, try and see for yourself why :X
PHP Code:
#include <amxmodx> 
#include <cstrike>

public plugin_init() 
{
   
register_messageget_user_msgid"Health" ) , "MessageHealth" ); //byte
   
register_messageget_user_msgid"Money" ) , "MessageMoney" ); //long 


public 
MessageHealthmsgid dest id 

   
cs_set_user_moneyid get_msg_arg_int) , );
   
set_msg_arg_int ARG_BYTE );


public 
MessageMoneymsgid dest id 

   
set_msg_arg_intARG_LONG get_user_healthid ) ); 

1st The health is not displayed in the money^^.

--
Searching for results..More help,please?
Fedde is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-27-2011 , 22:27   Re: Money as Health
Reply With Quote #15

It works for me but the game controls were messed up, for me atleast.
__________________
Bugsy is offline
Fedde
BANNED
Join Date: Sep 2011
Old 10-27-2011 , 22:49   Re: Money as Health
Reply With Quote #16

So how I do this work?
Fedde is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 10-27-2011 , 22:52   Re: Money as Health
Reply With Quote #17

Quote:
Originally Posted by Bugsy View Post
It works for me but the game controls were messed up, for me atleast.
It's because of the zero hp bug. See https://forums.alliedmods.net/showthread.php?t=68124
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Fedde
BANNED
Join Date: Sep 2011
Old 10-27-2011 , 23:26   Re: Money as Health
Reply With Quote #18

Quote:
Originally Posted by Emp` View Post
It's because of the zero hp bug. See https://forums.alliedmods.net/showthread.php?t=68124
I use this to fix the HP bug..
Code:
public MessageHealth(MsgId,MsgDest,id) {     if(!is_user_alive(id))         return PLUGIN_CONTINUE;             static hp;     hp = get_msg_arg_int(1);         if(hp > 255 && (hp % 256) == 0)         set_msg_arg_int(1,ARG_BYTE,++hp);           return PLUGIN_CONTINUE; }

[Edit]
Oh,is the same xD...

(Still not working)

Code:
new Money; new Health; public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         Money = get_user_msgid("Money");     register_message(Money,"MessageMoney");         Health = get_user_msgid("Health");     register_message(Health,"MessageHealth");         RegisterHam(Ham_TakeDamage,"player","HamTakeDamage",1); } public MessageMoney(MsgId,MsgDest,id) {     new plyrMoney = get_user_health(id)         set_msg_arg_int(1,ARG_LONG,plyrMoney);     set_pdata_int(id,155,0); } public MessageHealth(MsgId,MsgDest,id) {     if(!is_user_alive(id))         return PLUGIN_CONTINUE;             static hp;     hp = get_msg_arg_int(1);         if(hp > 255 && (hp % 256) == 0)         set_msg_arg_int(1,ARG_BYTE,++hp);           return PLUGIN_CONTINUE; } public HamTakeDamage(victim,attacker,Float:fldamage)     cs_set_user_money(victim,get_user_health(victim));

Last edited by Fedde; 10-27-2011 at 23:33.
Fedde is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-27-2011 , 23:37   Re: Money as Health
Reply With Quote #19

Quote:
Originally Posted by Fedde View Post
I use this to fix the HP bug..
Code:
public MessageHealth(MsgId,MsgDest,id) {     if(!is_user_alive(id))         return PLUGIN_CONTINUE;             static hp;     hp = get_msg_arg_int(1);         if(hp > 255 && (hp % 256) == 0)         set_msg_arg_int(1,ARG_BYTE,++hp);           return PLUGIN_CONTINUE; } public HamTakeDamage(victim,attacker,Float:fldamage)     cs_set_user_money(victim,get_user_health(victim));
You don't need both Health message and HamTakeDamage. When you get hurt, Health message is called to update the HUD, HamTakeDamage can be removed.
__________________
Bugsy is offline
Fedde
BANNED
Join Date: Sep 2011
Old 10-27-2011 , 23:43   Re: Money as Health
Reply With Quote #20

Quote:
Originally Posted by Bugsy View Post
You don't need both Health message and HamTakeDamage. When you get hurt, Health message is called to update the HUD, HamTakeDamage can be removed.
But Still not working...

Code:
new Money; new Health; public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         Money = get_user_msgid("Money");     register_message(Money,"MessageMoney");         Health = get_user_msgid("Health");     register_message(Health,"MessageHealth"); } public MessageMoney(MsgId,MsgDest,id) {     new plyrMoney = get_user_health(id)         set_msg_arg_int(1,ARG_LONG,plyrMoney);     set_pdata_int(id,155,0); } public MessageHealth(MsgId,MsgDest,id) {     if(!is_user_alive(id))         return PLUGIN_CONTINUE;             static hp;     hp = get_msg_arg_int(1);         if(hp > 255 && (hp % 256) == 0)         set_msg_arg_int(1,ARG_BYTE,++hp);         return PLUGIN_CONTINUE; }

I want to set the HP in Money,but when I slap my self by X damage the money not change...(But when I get some HP,it works).
Fedde is offline
Old 10-28-2011, 06:28
tamimrahman52
This message has been deleted by Emp`. Reason: spam
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 00:52.


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