Raised This Month: $ Target: $400
 0% 

MOVETYPE_TOSS and touch event


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
DavidLin
Member
Join Date: Jan 2016
Old 01-11-2016 , 14:17   MOVETYPE_TOSS and touch event
Reply With Quote #1

Hello, I made a code where zombie shots an entity and when a player touches the entity it gives him a green screen while the entity is being in the air, and when there is more than one player in the entity's way only one player gets the green screen.

PHP Code:

public plugin_init( ) {
    
register_touch"vomit_entity""*""vomit_touch" );
    
msgidFade  get_user_msgid"ScreenFade" );
}

public 
VomitDoid ) {
    
// New vomit in progress //
    
new Float:vOrigin], Float:vAngles], Float:vVelocity];

    
entity_get_vectoridEV_VEC_originvOrigin );
    
entity_get_vectoridEV_VEC_v_anglevAngles );

    new 
vomit_ent create_entity"info_target" );
    
entity_set_stringvomit_entEV_SZ_classname"vomit_entity" );
    
entity_set_modelvomit_entspit_model );
    
entity_set_sizevomit_entminModelmaxModel );

    
entity_set_originvomit_entvOrigin );
    
entity_set_vectorvomit_entEV_VEC_anglesvAngles );
    
entity_set_intvomit_entEV_INT_solidSOLID_SLIDEBOX );
    
entity_set_intvomit_entEV_INT_movetypeMOVETYPE_TOSS );
    
entity_set_edictvomit_entEV_ENT_ownerid );

    
set_renderingvomit_entkRenderFxGlowShell7918061kRenderNormal25 );

    
velocity_by_aimid700vVelocity );
    
entity_set_vectorvomit_entEV_VEC_velocityvVelocity );
}
public 
vomit_touchvomitEntvictim ) {
    if( !
pev_validvomitEnt ) )
        return;

    static 
vEnt32 ];
    
pevvictimpev_classnamevEntcharsmaxvEnt ) );
    if( 
equalvEnt"player" ) ) {
        if( 
is_user_alivevictim ) && !is_zombievictim ) ) {
            
vomitedUservictim );
        }
    }

What could be the problem ?
DavidLin 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 09:29.


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