Raised This Month: $ Target: $400
 0% 

need CVAR help!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
timian
Member
Join Date: Oct 2006
Location: Denmark
Old 06-30-2009 , 15:15   need CVAR help!
Reply With Quote #1

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

new cvar_StartHP
new cvar_MinimumHP

public plugin_init(){
    
register_plugin("need cvar help""1.1""Beancake12")
    
cvar_startHP register_cvar("amx_ETO_startHP""300")
    
cvar_minimumHP register_cvar("amx_ETO_minimumHP""50")
}

public 
cvar_function() {
    
how can i make the cvars change the start hp
    
and how do i make it change minimum hp?

timian is offline
TheRadiance
Senior Member
Join Date: Nov 2007
Location: Kazakhstan
Old 07-01-2009 , 06:18   Re: need CVAR help!
Reply With Quote #2

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

new cvar_startHP
/new cvar_minimumHP

public plugin_init()
{
    
register_plugin("need cvar help""1.1""Beancake12");

    
cvar_startHP register_cvar("amx_ETO_startHP""300");
    
//cvar_minimumHP = register_cvar("amx_ETO_minimumHP", "50");

    
RegisterHam(Ham_Spawn"player""_fw_player_spawn_post"1);
    
//RegisterHam(Ham_TakeDamage, "player", "_fw_player_takedmg_pre", 0);
}

public 
_fw_player_spawn_post(id)
{
    if (
is_user_alive(id))
    {
        
set_user_health(idget_pcvar_num(cvar_startHP));
    }
}
/*
public _fw_player_takedmg_pre(vic, inf, id, Float:dmg)
{
    if (!is_user_alive(vic) || !is_user_connected(id))
    {
        return;
    }

    new _minhp = get_pcvar_num(cvar_minimumHP);

    if (get_user_health(vic) - dmg < _minhp)
    {
        SetHamParamFloat(4, float(_minhp));
    }
}*/ 
Couldn't understand minimumHP

Last edited by TheRadiance; 07-01-2009 at 07:04.
TheRadiance is offline
Send a message via ICQ to TheRadiance
timian
Member
Join Date: Oct 2006
Location: Denmark
Old 07-01-2009 , 06:49   Re: need CVAR help!
Reply With Quote #3

hope it work! look at it later.

minimum HP is because i want to decree good ppl's HP, but then they would get negative HP, ther for i need minimum hp
timian is offline
TheRadiance
Senior Member
Join Date: Nov 2007
Location: Kazakhstan
Old 07-01-2009 , 07:04   Re: need CVAR help!
Reply With Quote #4

How would you decree hp??
TheRadiance is offline
Send a message via ICQ to TheRadiance
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-01-2009 , 10:34   Re: need CVAR help!
Reply With Quote #5

Do you mean you want to set a minimum hp that a players hp can be decreased to?
__________________

Last edited by Bugsy; 07-01-2009 at 10:37.
Bugsy is offline
timian
Member
Join Date: Oct 2006
Location: Denmark
Old 07-01-2009 , 16:48   Re: need CVAR help!
Reply With Quote #6

Quote:
Originally Posted by Bugsy View Post
Do you mean you want to set a minimum hp that a players hp can be decreased to?
yer! so a player cant go lower than the minimum HP.

and then i need a cvar witch change that minimum HP i set to what they want
timian is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-01-2009 , 22:35   Re: need CVAR help!
Reply With Quote #7

How is the players hp decreased in your plugin? By attacks from other players? or what?
__________________
Bugsy is offline
timian
Member
Join Date: Oct 2006
Location: Denmark
Old 07-05-2009 , 11:13   Re: need CVAR help!
Reply With Quote #8

the hp decree depend on frags-deaths
timian is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-05-2009 , 14:15   Re: need CVAR help!
Reply With Quote #9

How is a players hp decreased? Is the amount of hp decrease relative to kill-death ratio?

ie.
10 kills, 5 deaths, hp decrease by 10
10 kills 0 deaths, hp decrease by 5?

Give an example so I can better understand what you're trying to do.
__________________
Bugsy is offline
timian
Member
Join Date: Oct 2006
Location: Denmark
Old 07-05-2009 , 14:45   Re: need CVAR help!
Reply With Quote #10

you can see what I've made until now http://forums.alliedmods.net/showthread.php?t=96063
timian 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 15:32.


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