AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   AddToFullPack (https://forums.alliedmods.net/showthread.php?t=147909)

GXLZPGX 01-15-2011 15:42

AddToFullPack
 
Well I'm trying to make terrorists visible to other terrorists, but for some reason, when there are two or more players in the server it crashes. (We were both on CT)

PHP Code:

public func_AddToFullPack(es_handleeenthosthostflagsplayerpSet)
{
    if(!
player)
    {
        return 
FMRES_IGNORED
    
}
    
    if( 
cs_get_user_team(host) == CS_TEAM_T && cs_get_user_team(ent) == CS_TEAM_T )
    {
        
set_es(entES_RenderFxkRenderFxDistort)
        
set_es(entES_RenderColor, {000})
        
set_es(entES_RenderModekRenderTransAdd)
        
set_es(entES_RenderAmt127)
    }
    
    return 
FMRES_IGNORED 
}[ 


ConnorMcLeod 01-15-2011 15:53

Re: AddToFullPack
 
if( !player || !get_orig_retval() )

GXLZPGX 01-15-2011 19:31

Re: AddToFullPack
 
Quote:

Originally Posted by ConnorMcLeod (Post 1394357)
if( !player || !get_orig_retval() )

Doesn't fix the issue :/

Elusive138 01-15-2011 21:09

Re: AddToFullPack
 
set_es uses es_handle, not ent id.

PHP Code:

// These functions are used with the entity_state data structure (FM_AddToFullPack)
// Get: 0 extra params - Return integer; 1 extra param - by ref float or vector or array
// Set: Use anything
// Use 0 for es_handle to specify the global entity_state handle
native get_es(es_handleEntityState:member, {Float,_}:...);
native set_es(es_handleEntityState:member, {Float,_}:...); 

Also, when I used AddToFullPack, I had to take out returns for it to work (might be just my code)...

Ryokin 01-15-2011 22:05

Re: AddToFullPack
 
this should work..
PHP Code:

if(is_user_alive(host) && is_user_alive(ent) && cs_get_user_team(host) == CS_TEAM_T && cs_get_user_team(ent) == CS_TEAM_T)
{
        
set_es(es_handleES_RenderFxkRenderFxDistort)
        
set_es(es_handleES_RenderColor, {000})
        
set_es(es_handleES_RenderModekRenderTransAdd)
        
set_es(es_handleES_RenderAmt127)


</SPAN>


All times are GMT -4. The time now is 02:08.

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