Raised This Month: $ Target: $400
 0% 

[HELP] health problem in 35hp and 35hp_2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
m.touqeerafzal
Member
Join Date: May 2013
Old 11-06-2013 , 12:17   [HELP] health problem in 35hp and 35hp_2
Reply With Quote #1

plz some 1 help me... In my HLDS.. when i run 35hp or 35hp_2, health of the player remains 100.... some1 plz tell me what is the issue... how to solve this problem....
plz help...
m.touqeerafzal is offline
Send a message via Skype™ to m.touqeerafzal
Kellan123
AlliedModders Donor
Join Date: Aug 2012
Old 11-06-2013 , 12:26   Re: [HELP] health problem in 35hp and 35hp_2
Reply With Quote #2

Test this:
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fun>
 
public plugin_init()
{
        
register_plugin("35HP Map Only 35HP""1.0""Name");
 
        
RegisterHam(Ham_Spawn"player""Fwd_Ham_Spawn_Post"1);
}
 
public 
Fwd_Ham_Spawn_Post(id)
{
        
get_mapname(mapnamecharsmax(mapname));
 
        if(
equali(mapname"35hp_2"))
                return;
 
        
set_task(0.1"SetHP"id);
}
 
public 
SetHP(id)
{
        
set_user_health(id35);


Last edited by Kellan123; 11-06-2013 at 12:27.
Kellan123 is offline
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 11-06-2013 , 12:29   Re: [HELP] health problem in 35hp and 35hp_2
Reply With Quote #3

Quote:
Originally Posted by Kellan123 View Post
Test this:
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fun>
 
public plugin_init()
{
        
register_plugin("35HP Map Only 35HP""1.0""Name");
 
        
RegisterHam(Ham_Spawn"player""Fwd_Ham_Spawn_Post"1);
}
 
public 
Fwd_Ham_Spawn_Post(id)
{
        
get_mapname(mapnamecharsmax(mapname));
 
        if(
equali(mapname"35hp_2"))
                return;
 
        
set_task(0.1"SetHP"id);
}
 
public 
SetHP(id)
{
        
set_user_health(id35);

it's better to check mapname on plugin_init and in SetHP check if user is alive

you never create mapname

Last edited by baneado; 11-06-2013 at 12:30.
baneado is offline
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 11-06-2013 , 12:41   Re: [HELP] health problem in 35hp and 35hp_2
Reply With Quote #4

Quote:
Originally Posted by m.touqeerafzal View Post
there are compilation error in this code... plz help me out...

plz i dont know this programming language.... so kindaly help me in these checks.. i.e mapname and SetHP
OK, here you have. Test it

Improve your writing plzzzzzzz.

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

new g_enabled

public plugin_init()
{
        
register_plugin("35HP Map Only 35HP""1.0""Name");

        new 
mapname[20]
        
get_mapname(mapnamecharsmax(mapname))
 
        if(
containi(mapname"35hp"))
                
g_enabled true
 
        RegisterHam
(Ham_Spawn"player""Fwd_Ham_Spawn_Post"1);
}
 
public 
Fwd_Ham_Spawn_Post(id)
        if (
g_enabledset_task(0.1"SetHP"id);
  
public 
SetHP(id)
{
        if (
is_user_alive(id))
                
set_user_health(id35);

This plugin should work in every map that have 35hp in their mapname.

@Kellan123, what are you doing? No..

Last edited by baneado; 11-06-2013 at 12:44.
baneado is offline
m.touqeerafzal
Member
Join Date: May 2013
Old 11-06-2013 , 12:32   Re: [HELP] health problem in 35hp and 35hp_2
Reply With Quote #5

there are compilation error in this code... plz help me out...

plz i dont know this programming language.... so kindaly help me in these checks.. i.e mapname and SetHP

Last edited by m.touqeerafzal; 11-06-2013 at 12:34.
m.touqeerafzal is offline
Send a message via Skype™ to m.touqeerafzal
Kellan123
AlliedModders Donor
Join Date: Aug 2012
Old 11-06-2013 , 12:39   Re: [HELP] health problem in 35hp and 35hp_2
Reply With Quote #6

Quote:
Originally Posted by m.touqeerafzal View Post
there are compilation error in this code... plz help me out...

plz i dont know this programming language.... so kindaly help me in these checks.. i.e mapname and SetHP
Try...
Attached Files
File Type: sma Get Plugin or Get Source (35hp.sma - 441 views - 736 Bytes)
Kellan123 is offline
m.touqeerafzal
Member
Join Date: May 2013
Old 11-06-2013 , 12:51   Re: [HELP] health problem in 35hp and 35hp_2
Reply With Quote #7

any of these codes does'nt work..
m.touqeerafzal is offline
Send a message via Skype™ to m.touqeerafzal
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 11-06-2013 , 13:50   Re: [HELP] health problem in 35hp and 35hp_2
Reply With Quote #8

change set_task(0.1, ...
to set_task(1.0, ...
baneado is offline
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 11-06-2013 , 14:02   Re: [HELP] health problem in 35hp and 35hp_2
Reply With Quote #9

Try this, it should work. Otherwise consider that you have another plugin which change the health of players ( Or the map is badly designed ) :

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

public plugin_init( )
{
    
register_plugin"Fix 35HP""1.0.0""Baguette" );

    new 
szMapName32 ];
    
get_mapnameszMapNamecharsmaxszMapName ));
    
    if( 
equalszMapName"35hp" ) || equalszMapName"35hp_2" ))
    {
        
RegisterHamHam_Spawn"player""CPlayer__Spawn_P"true );
    }
}
 
public 
CPlayer__Spawn_PiPlayer )
{
    if( 
is_user_aliveiPlayer ))
    {
        
set_user_healthiPlayer35 );
    }

__________________
micapat is offline
m.touqeerafzal
Member
Join Date: May 2013
Old 11-07-2013 , 13:29   Re: [HELP] health problem in 35hp and 35hp_2
Reply With Quote #10

Thanx micapat

your code is really helpful.... it solved my problem...

Last edited by m.touqeerafzal; 11-07-2013 at 13:30.
m.touqeerafzal is offline
Send a message via Skype™ to m.touqeerafzal
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 23:19.


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