AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   TakeDamage & trigger_hurt problem (https://forums.alliedmods.net/showthread.php?t=89456)

ILUSION 04-06-2009 15:39

TakeDamage & trigger_hurt problem
 
Hi I have this code:

PHP Code:

public fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
    if (!
get_pcvar_num(cvar_godmode))
        return 
HAM_IGNORED
    
    
if (g_godmode[attacker])
    {
        
set_user_hitzones(0attacker255)
        
g_godmode[attacker] = false
    
}
    
    return 
HAM_IGNORED


In the map surf_ninja when I fall, the trigger_hurt fails (not ever). If I disable the function "TakeDamage" now the trigger_hurt works fine. What is wrong?

Some pics...

[IMG]http://img12.**************/img12/5193/surfninja0000.th.jpg[/IMG]
[IMG]http://img19.**************/img19/82/surfninja0001.th.jpg[/IMG]
[IMG]http://img12.**************/img12/2923/surfninja0002.th.jpg[/IMG]

Thanks

IneedHelp 04-06-2009 15:48

Re: TakeDamage & trigger_hurt problem
 
You can try to check if there's a touch between the player and the trigger_hurt, and then kill the player, else, set him godmode, or check the dmg_bits (if dmg_fall then kill them?)

P.S. You should try to make another method to make a surf godmode, I'll try to do one =)

ILUSION 04-06-2009 16:13

Re: TakeDamage & trigger_hurt problem
 
Quote:

Originally Posted by IneedHelp
You can try to check if there's a touch between the player and the trigger_hurt, and then kill the player, else, set him godmode, or check the dmg_bits (if dmg_fall then kill them?)

How?

This method is effective, but I have that bug -_-

If I set the pcvar cvar_godmode to 0 the trigger_hurt works fine. :|

ConnorMcLeod 04-06-2009 16:22

Re: TakeDamage & trigger_hurt problem
 
What you exactly want to do ?
Prevent players to shoot other players and let every other damage ?

ILUSION 04-06-2009 16:30

Re: TakeDamage & trigger_hurt problem
 
If a player have godmode and attack other player, remove the godmode of the player.

Quote:

Originally Posted by ConnorMcLeod
What you exactly want to do ?
Prevent players to shoot other players and let every other damage ?

Yes, but first need write "/godmode" in the chat.

ConnorMcLeod 04-06-2009 16:32

Re: TakeDamage & trigger_hurt problem
 
You don't get it, question is which damage do you want to block and which one do you want to allow ?

ILUSION 04-06-2009 16:36

Re: TakeDamage & trigger_hurt problem
 
Quote:

Originally Posted by ConnorMcLeod (Post 799156)
You don't get it, question is which damage do you want to block and which one do you want to allow ?

Yes. Sorry if you don't understand me.

Dr.G 04-06-2009 17:16

Re: TakeDamage & trigger_hurt problem
 
lmao ILUSION you need to tell what you wanna do

BOYSplayCS 04-06-2009 17:17

Re: TakeDamage & trigger_hurt problem
 
What kind of damage(hurt) do you want to block?

ILUSION 04-06-2009 17:21

Re: TakeDamage & trigger_hurt problem
 
I want to block shots, knife damage and nade damage.


All times are GMT -4. The time now is 02:27.

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