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

set_user_health


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cstrike37
Member
Join Date: Jan 2012
Old 07-15-2013 , 23:38   set_user_health
Reply With Quote #1

sometimes it gives 500 health or more instead of 250 if the user spawn too fast.. How do i fix this?
PHP Code:
#include <amxmodx> 
#include <amxmisc> 
#include <cstrike> 
#include <fun> 
#include <hamsandwich> 

#define PLUGIN "Bonus Health" 
#define VERSION "1.0" 
#define AUTHOR "cstrike37" 


public plugin_init() { 
   
    
register_plugin(PLUGINVERSIONAUTHOR
    
RegisterHam(Ham_Spawn"player""Spawn"1)
    

public 
Spawn(id

    new 
model[32]
    
cs_get_user_model(idmodelcharsmax(model))
    if (
equal(model"gign"))
    
set_task(1.0"setbonushp"id)
}
public 
setbonushp(id)
{
    
remove_task(0)
    
set_user_health(idget_user_health(id) + 250)


cstrike37 is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 07-15-2013 , 23:55   Re: set_user_health
Reply With Quote #2

Your plugin correct.

Quote:
if the user spawn too fast..

Maybe other plugins give health?
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
wickedd
Veteran Member
Join Date: Nov 2009
Old 07-16-2013 , 00:09   Re: set_user_health
Reply With Quote #3

Check if is_user_alive, also you don't need a task.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
cstrike37
Member
Join Date: Jan 2012
Old 07-16-2013 , 03:14   Re: set_user_health
Reply With Quote #4

Quote:
Originally Posted by Bos93 View Post
Your plugin correct.

Maybe other plugins give health?
I disabled all the plugins that gives health. still not working..
Quote:
Originally Posted by wickedd View Post
Check if is_user_alive, also you don't need a task.
Tried, no luck =/

I got instant respawn on my server..

Last edited by cstrike37; 07-16-2013 at 03:14.
cstrike37 is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 07-16-2013 , 03:30   Re: set_user_health
Reply With Quote #5

Quote:
if the user spawn too fast..
Quote:
I got instant respawn on my server..
What is this?

your mode ZP?


The problem is not with this plugin


maybe:

-> Spawn player - set 100 hp (default)

-> 1 sec... + 250 hp

-> = 350 hp,But you are using an old build and you do not show the correct messages health
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 07-16-2013 , 06:18   Re: set_user_health
Reply With Quote #6

Probaly because players spawns twice in less then 1 second.

PHP Code:
#include <amxmodx>  
#include <amxmisc>  
#include <cstrike>  
#include <fun>  
#include <hamsandwich>  

#define PLUGIN "Bonus Health"  
#define VERSION "1.0"  
#define AUTHOR "cstrike37"  

public plugin_init() {  
    
    
register_plugin(PLUGINVERSIONAUTHOR)  
    
RegisterHam(Ham_Spawn"player""Ham_PlayerSpawn"1
     
}  
public 
Ham_PlayerSpawn(id)  
{  
    if(
is_user_alive(id))
    {
        static 
model[32
        
cs_get_user_model(idmodelcharsmax(model)) 
        
        if (
equal(model"gign")) 
             
set_user_health(idget_user_health(id) + 250
    }

__________________
Retired.
Xalus 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 19:27.


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