AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   1 Simple Question About TE_DLIGHT (https://forums.alliedmods.net/showthread.php?t=113504)

Merc3y 12-27-2009 13:29

1 Simple Question About TE_DLIGHT
 
Anyone know how to remove the TE_DLIGHT after a function is false or == 0 ?

Something like this:

PHP Code:

                static origin]
                
get_user_originidorigin )
                if ( 
HasASDid ] == )
                {
                        
message_beginMSG_PVSSVC_TEMPENTITYorigin )
                        
write_byteTE_DLIGHT )
                        
write_coordorigin] ) 
                        
write_coordorigin] )
                        
write_coordorigin] )
                        
write_byte10 )
                        
write_byte)
                        
write_byte)
                        
write_byte)
                        
write_byte)
                        
write_byte)
                        
message_end( )
                }
 
                static 
origin]
                
get_user_originidorigin )
                if ( 
HasMadnessid ] == )
                {
                        
message_beginMSG_PVSSVC_TEMPENTITYorigin )
                        
write_byteTE_DLIGHT )
                        
write_coordorigin] ) 
                        
write_coordorigin] )
                        
write_coordorigin] )
                        
write_byte10 )
                        
write_byte)
                        
write_byte)
                        
write_byte255 )
                        
write_byte)
                        
write_byte)
                        
message_end( )
                } 

I try to replace the TE_DLIGHT with 0 when the function is 1 it crash my server.

Excalibur.007 12-27-2009 22:28

Re: 1 Simple Question About TE_DLIGHT
 
Aura? from mah witch :P?
EDIT: Put in inside FM_PlayerPreThink
Code:

public fw_PlayerPreThink( id )
{
    if( !is_user_alive( id ) || !zp_get_user_zombie( id ) || zp_get_user_zombie_class( id ) != g_zclass_witch || zp_get_user_nemesis( id ) )
        return FMRES_IGNORED
   
    if( is_user_alive( id ) && zp_get_user_zombie( id ) && zp_get_user_zombie_class( id ) == g_zclass_witch && !zp_get_user_nemesis( id ) )
    {
        if( HasASD[ id ] == 1 )
        {
            static origin[ 3 ]
            get_user_origin( id, origin )
       
            message_begin( MSG_PVS, SVC_TEMPENTITY, origin )
            write_byte( TE_DLIGHT )
            write_coord( origin[0] )
            write_coord( origin[1] )
            write_coord( origin[2] )
            write_byte( 10 )
            write_byte( 180 )
            write_byte( 0 )
            write_byte( 0 )
            write_byte( 2 )
            write_byte( 0 )
            message_end( )
        }
    }
    return FMRES_IGNORED
}

You don't have to return 0... It will automatically check when it becomes 0. Look inside my witch code.

Merc3y 12-28-2009 01:19

Re: 1 Simple Question About TE_DLIGHT
 
Quote:

Originally Posted by Excalibur.007 (Post 1033401)
Aura? from mah witch :P?
EDIT: Put in inside FM_PlayerPreThink
Code:

public fw_PlayerPreThink( id )
{
    if( !is_user_alive( id ) || !zp_get_user_zombie( id ) || zp_get_user_zombie_class( id ) != g_zclass_witch || zp_get_user_nemesis( id ) )
        return FMRES_IGNORED
 
    if( is_user_alive( id ) && zp_get_user_zombie( id ) && zp_get_user_zombie_class( id ) == g_zclass_witch && !zp_get_user_nemesis( id ) )
    {
        if( HasASD[ id ] == 1 )
        {
            static origin[ 3 ]
            get_user_origin( id, origin )
 
            message_begin( MSG_PVS, SVC_TEMPENTITY, origin )
            write_byte( TE_DLIGHT )
            write_coord( origin[0] )
            write_coord( origin[1] )
            write_coord( origin[2] )
            write_byte( 10 )
            write_byte( 180 )
            write_byte( 0 )
            write_byte( 0 )
            write_byte( 2 )
            write_byte( 0 )
            message_end( )
        }
    }
    return FMRES_IGNORED
}

You don't have to return 0... It will automatically check when it becomes 0. Look inside my witch code.

I took it from zombieplague source code ? :nono:


All times are GMT -4. The time now is 04:17.

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