Raised This Month: $ Target: $400
 0% 

[HELP] Can this code be made better?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-12-2009 , 19:05   Re: [HELP] Can this code be made better?
Reply With Quote #6

Try something like this.
PHP Code:
#include < amxmodx >
#include < engine >
#include < fakemeta >

const Float:INTERVAL 2.0// every 2 seconds
const HEAL 2// +2 hp each heal

const m_flDelay 34;

new 
g_iTriggerHurt;

public 
plugin_init( ) {
    
register_plugin"Auto Healer""1.0""xPaw" );
    
    new 
iEntity create_entity"trigger_hurt" );
    
    if( 
is_valid_entiEntity ) ) {
        new 
szDamage16 ];
        
num_to_str( ( HEAL * -), szDamage15 );
        
        
DispatchKeyValueiEntity"classname""trigger_hurt" );
        
DispatchKeyValueiEntity"damagetype""1024" );
        
DispatchKeyValueiEntity"dmg"szDamage );
        
DispatchKeyValueiEntity"origin""0 0 0" );
        
        
DispatchSpawniEntity );
        
        
entity_set_sizeiEntityFloat:{ -4096.0, -4096.0, -4096.0 }, Float:{ 4096.04096.04096.0 } );
        
entity_set_intiEntityEV_INT_solidSOLID_TRIGGER );
        
        
g_iTriggerHurt iEntity;
        
        
register_touch"player""trigger_hurt""FwdPlayerHurt" );
    }
}

public 
FwdPlayerHurtclientiEntity ) {
    if( 
iEntity == g_iTriggerHurt ) {
        
set_pdata_floatiEntitym_flDelayget_gametime( ) + INTERVAL );
    }

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
 



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 22:34.


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