AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   TT can't kill CT how I can make this? (https://forums.alliedmods.net/showthread.php?t=98610)

merkava 07-27-2009 06:37

TT can't kill CT how I can make this?
 
I have only one idea on this.

Code:

public plugin_init()
{
   
register_plugin(PLUGIN, VERSION, AUTHOR)
   
   
set_task(1.0, "cmDCheckHP", _,_,_, "b")
   
   
// Add your own code here
}

public
cmDCheckHP(id)
{
    new
alive = is_user_alive(id)
    new
team = cs_get_user_team(id)
    new
hp = get_user_health(id)
   
    if((
alive) || (team) == CS_TEAM_CT) {
        if(
hp < 100) {
           
set_user_health(id, 255)
        }
    }
}



But this idea is negative. Unfortunately, it doesn't work
Well... I need help.


anssik 07-27-2009 07:46

Re: TT can't kill CT how I can make this?
 
1 Attachment(s)
Untested, but should work.

Xellath 07-27-2009 08:00

Re: TT can't kill CT how I can make this?
 
PHP Code:

#include <amxmodx>
#include <hamsandwich>

public plugin_init( ) 
{   
    
RegisterHamHam_TakeDamage"player""fwd_TakeDamage");
}

public 
fwd_TakeDamagevictiminflictorattackerFloat:damagedmgbits )
{
    if ( 
is_user_alive(  attacker ) )
    {
        if ( 
get_user_teamattacker ) == )
        {
             return 
HAM_SUPERCEDE;
        }

        return 
HAM_IGNORED;


Try this, not tested.

merkava 07-27-2009 08:09

Re: TT can't kill CT how I can make this?
 
Okey. I will test it. Thanks for the time which you devoted to me.

Mlk27 07-27-2009 08:22

Re: TT can't kill CT how I can make this?
 
Code:
public fwd_TakeDamage( victim, inflictor, attacker, Float:damage, dmgbits ) {     if (is_user_alive(attacker))     {         if (get_user_team(victim) == 2 && get_user_team(attacker) == 1)         {              return HAM_SUPERCEDE;         }         return HAM_IGNORED; }

Xellath 07-27-2009 08:22

Re: TT can't kill CT how I can make this?
 
Quote:

Originally Posted by merkava (Post 882924)
Okey. I will test it. Thanks for the time which you devoted to me.

Well, it took like 10 minutes to write, so it's not a big loss.

I am on vacation and I am surfing on my phone, so I cannot type as fast as I would on a computer.

Hope it works! :crab:

merkava 07-27-2009 15:11

Re: TT can't kill CT how I can make this?
 
anssik your plugin is runing good.

Xellath your don't worked good :>


All times are GMT -4. The time now is 18:17.

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