Raised This Month: $ Target: $400
 0% 

ptouched and kill


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Arje
Senior Member
Join Date: Apr 2020
Location: Córdoba, Argentina
Old 02-07-2022 , 14:16   Re: ptouched and kill
Reply With Quote #6

Finally I was able to make it work now it works correctly, thank you very much for the help it really helped me a lot, thank you

I had to change some things in this function and use natives of the superhero include

PHP Code:
//----------------------------------------------------------------------------------------------
public pfn_touch(ptrptd
{
    if(!
is_valid_ent(ptd) || !is_valid_ent(ptr))
        return 
PLUGIN_CONTINUE
            
    
if(!is_user_connected(ptd) || !is_user_alive(ptd))
        return 
PLUGIN_CONTINUE
    
    
new classname[32]
    
entity_get_string(ptrEV_SZ_classnameclassname31)
    if(
equal(classname"coronavirus")) {
        
        static 
iOwner;
        
iOwner entity_get_edict(ptrEV_ENT_owner);

        if( 
is_user_connected(iOwner) && is_user_alive(iOwner) ) {
            
            
// This is to make the one who touches the entity die
            // Make damage to target
            
new damage read_data(2)
            
            
sh_extra_damage(ptdiOwnerdamage"Por CoronaVirus"0SH_DMG_KILL)
        }
        
        
remove_entity(ptr);
    } 
    
    return 
PLUGIN_CONTINUE
}
//---------------------------------------------------------------------------------------------- 
Arje 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 11:40.


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