Raised This Month: $ Target: $400
 0% 

fwAddToFullPack


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
grs4
Senior Member
Join Date: Dec 2010
Location: Poland
Old 02-09-2017 , 17:12   fwAddToFullPack
Reply With Quote #1

I want to set glow of ENT if is player turret (only for owner)

PHP Code:
public IsEntityPlayerTurret(iEntiPlayer)
    return 
entity_get_edict(iEntEV_ENT_turret_owner) == iPlayer && entity_get_int(iEntEV_INT_turret_level)

public 
fwAddToFullPack(es_handleeENTHOSThostflagsplayerset) {
    if(
player || !is_user_connected(HOST) || !is_valid_ent(ENT))
        return 
FMRES_IGNORED

    
/* If ranger owner is other than player -> hide him */
    
if(IsEntityRanger(ENT) && entity_get_int(ENTEV_INT_ranger_owner) != HOST
        return 
FMRES_OVERRIDE;
    
    if(
IsEntityPlayerTurret(ENTHOST))
    {
        
set_es(es_handleES_RenderModekRenderNormal)
        
set_es(es_handleES_RenderAmt13)
        
set_es(es_handleES_RenderColor25500)
        
set_es(es_handleES_RenderFxkRenderFxGlowShell)
        return 
FMRES_SUPERCEDE
    
}
    return 
FMRES_IGNORED

I tested all f....g options with ES_, with return TYPE. Checking IsEntityPlayer turret work well - (I do not want to checking all times classname, I think checking integers is Faster

What Am I doing wrong?

I tested too with
PHP Code:
set_es(es_handleES_RenderColor, {25500}) 
and others order

//edit
I tested too without if(player || ...) return....

Last edited by grs4; 02-09-2017 at 17:33.
grs4 is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 02-10-2017 , 21:33   Re: fwAddToFullPack
Reply With Quote #2

HOST is the player that the packet is being sent to.
ENT is the entity about which he is receiving the information.

If you said you removed the "player || " check then the problem is because of IsEntityRanger, EV_INT_ranger_owner, or IsEntityPlayerTurret.

Try
"!IsEntityRanger(ENT) || entity_get_int(ENT, EV_INT_ranger_owner) != HOST"
instead of
"IsEntityRanger(ENT) && entity_get_int(ENT, EV_INT_ranger_owner) != HOST".

And don't use the FMRES returns if you don't know what they do. Simply use "return" only.
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Reply


Thread Tools
Display Modes

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 20:42.


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