Raised This Month: $ Target: $400
 0% 

ptouched and kill


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Arje
Senior Member
Join Date: Apr 2020
Location: Córdoba, Argentina
Old 02-07-2022 , 11:37   ptouched and kill
Reply With Quote #1

Hello, I use this code and I would like that when someone touches the entity it dies, but the frag is added to the person who created the entity

At the moment I can only make them die when they touch the entity, but I would like the frag to be added to whoever created the entity

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")) {
            
            
// This is to make the one who touches the entity die
            
new gOrigHealth get_user_health(ptd)
            new 
health gOrigHealth gOrigHealth
            
            set_user_health
(ptdhealth)    
            
            
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