View Single Post
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 02-21-2015 , 09:22   Re: Entity is touched = server crash
Reply With Quote #10

Working fine.
PHP Code:
public mine_explosion(touchertouched)
{
    if(!
is_valid_ent(toucher) && !is_user_connected(touched))
        return;

    
toucher_owner entity_get_edict(toucherEV_ENT_owner);
    
    
// Only crashing if this check is passed!
    
if(cs_get_user_team(touched) != cs_get_user_team(toucher_owner))
    {
        
entity_get_vector(toucherEV_VEC_origing_origin);
        
        if(
task_exist(toucher TASK_EXPLODE))
        {
            
set_task(0.5"explode"toucher TASK_EXPLODE);
        }
    }

But now i have another problem.
PHP Code:
set_user_health(targetget_user_health(target) - damage); // work!
ExecuteHamB(Ham_TakeDamagetargettouchertoucherdamageDMG_ALWAYSGIB); // doesn't work! (there are no errors, just don't take damage) 
I prefer to use Ham_TakeDamage instead of set_user_health.

Last edited by KiLLeR.; 02-21-2015 at 09:42.
KiLLeR. is offline