Raised This Month: $ Target: $400
 0% 

TakeDamage & trigger_hurt problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr.G
Senior Member
Join Date: Nov 2008
Old 04-06-2009 , 18:40   Re: TakeDamage & trigger_hurt problem
Reply With Quote #1

http://www.amxmodx.org/funcwiki.php?go=func&id=114

--->

PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <fun>
 
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
 
public plugin_init() 
{
 
register_plugin(PLUGINVERSIONAUTHOR)
 
 
register_clcmd("say /godmode","god_mode")
 
register_clcmd("say_team /godmode","god_mode")
}
 
public 
god_mode(id)
{
 if(!
get_user_godmode(id))
  {
  
set_user_godmode(id,1)
  
client_print(id,print_chat,"Godmode is ON")
  }
 else
  {
  
set_user_godmode(id,0)
  
client_print(id,print_chat,"Godmode is OFF")
  }
 
 return 
PLUGIN_HANDLED 

__________________

Last edited by Dr.G; 04-06-2009 at 18:46.
Dr.G is offline
ILUSION
Senior Member
Join Date: Oct 2006
Location: Argentina
Old 04-06-2009 , 18:56   Re: TakeDamage & trigger_hurt problem
Reply With Quote #2

Quote:
Originally Posted by Dr.G View Post
http://www.amxmodx.org/funcwiki.php?go=func&id=114

--->

PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <fun>
 
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
 
public plugin_init() 
{
 
register_plugin(PLUGINVERSIONAUTHOR)
 
 
register_clcmd("say /godmode","god_mode")
 
register_clcmd("say_team /godmode","god_mode")
}
 
public 
god_mode(id)
{
 if(!
get_user_godmode(id))
  {
  
set_user_godmode(id,1)
  
client_print(id,print_chat,"Godmode is ON")
  }
 else
  {
  
set_user_godmode(id,0)
  
client_print(id,print_chat,"Godmode is OFF")
  }
 
 return 
PLUGIN_HANDLED 

Is godmode to surf, if I fall from 500mts I don't get damage.

Thanks to all, I fix the problem.

PHP Code:
public fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
    if (
victim == attacker || !is_user_connected(attacker))
        return 
HAM_IGNORED;
    
    if (
get_pcvar_num(cvar_godmode))
    {   
        if (
g_godmode[attacker])
        {
            
set_user_hitzones(0attacker255)
            
g_godmode[attacker] = false
        
}
    }
    else
        return 
HAM_IGNORED;
        
    return 
HAM_IGNORED;

And now work fine.
ILUSION is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 04-07-2009 , 00:13   Re: TakeDamage & trigger_hurt problem
Reply With Quote #3

Quote:
Originally Posted by ILUSION View Post
Is godmode to surf, if I fall from 500mts I don't get damage.
Thanks to all, I fix the problem.
And now work fine.
This is how to do it. Better and without the fun module

PHP Code:
public fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
    if (
victim == attacker || !is_user_connected(attacker))
        return 
HAM_IGNORED;
    
    if (
get_pcvar_num(cvar_godmode))
    {   
        if (
g_godmode[attacker])
        {
            
g_godmode[attacker] = false
            
return HAM_SUPERCEDE
        
}
    }
    else
        return 
HAM_IGNORED;
        
    return 
HAM_IGNORED;

__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 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 02:27.


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