AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   need CVAR help! (https://forums.alliedmods.net/showthread.php?t=96092)

timian 06-30-2009 15:15

need CVAR help!
 
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?



TheRadiance 07-01-2009 06:18

Re: need CVAR help!
 
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

timian 07-01-2009 06:49

Re: need CVAR help!
 
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

TheRadiance 07-01-2009 07:04

Re: need CVAR help!
 
How would you decree hp??

Bugsy 07-01-2009 10:34

Re: need CVAR help!
 
Do you mean you want to set a minimum hp that a players hp can be decreased to?

timian 07-01-2009 16:48

Re: need CVAR help!
 
Quote:

Originally Posted by Bugsy (Post 861601)
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

Bugsy 07-01-2009 22:35

Re: need CVAR help!
 
How is the players hp decreased in your plugin? By attacks from other players? or what?

timian 07-05-2009 11:13

Re: need CVAR help!
 
the hp decree depend on frags-deaths

Bugsy 07-05-2009 14:15

Re: need CVAR help!
 
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.

timian 07-05-2009 14:45

Re: need CVAR help!
 
you can see what I've made until now http://forums.alliedmods.net/showthread.php?t=96063


All times are GMT -4. The time now is 15:32.

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