Raised This Month: $32 Target: $400
 8% 

Spawn Health Bug Fix v2.0


Post New Thread Reply   
 
Thread Tools Display Modes
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 10-29-2010 , 17:58   Re: [AMXX] Life MSG
Reply With Quote #11

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>

new hp

public 
plugin_init()
{
    
register_plugin("HP Bug Fix""1.0","Hattrick");
    
RegisterHam(Ham_Spawn"player""AtSpawn"1);
    
    
hp get_user_msgid("Health");
}

public 
AtSpawn(id)
{
    if(!
is_user_alive(id))
        return;
    
    
message_begin(MSG_ONEhp_id);
    
write_byte(pev(idpev_health));
    
message_end();

Better a bit.
__________________
Join US - custom Zombie Server - Custom Addons:




Last edited by Sn!ff3r; 10-29-2010 at 18:01.
Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-01-2010 , 10:59   Re: [AMXX] Life MSG
Reply With Quote #12

Approval requirements
  • Don't register both pre and post Spawn forward, only post is needed.
  • Don't send Health message, just set m_iClientHealth (359) private data to 0 or -1 and game gonna send the message itself.
  • Remove [AMXX] from post title.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 11-06-2010 at 12:36.
ConnorMcLeod is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 11-05-2010 , 17:22   Re: [AMXX] Life MSG
Reply With Quote #13

That's it.
__________________

Last edited by claudiuhks; 04-20-2012 at 20:32.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-06-2010 , 12:36   Re: Spawn HP bug fixer
Reply With Quote #14

Check if player is alive.

PHP Code:
    new iHealth 100;
    
iHealth -= 1;
    
set_pdata_int(id359iHealth); 

why don't you do :
set_pdata_int(id, 359, 99)
??

If you want to be sure the message is sent, set some negative value.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 11-07-2010 , 05:25   Re: Spawn HP bug fixer
Reply With Quote #15

Alive check available, negative value is set.
Everything alright.
__________________

Last edited by claudiuhks; 04-20-2012 at 20:33.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-07-2010 , 05:33   Re: Spawn HP bug fixer
Reply With Quote #16

No return is needed in post forwards.

Would be better if you named the offset, or add some comment in plugin so if someone reads your code he gonna understand it.

Approved.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 16:16.


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