AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [Problem] Grenade plugin crashes my server (https://forums.alliedmods.net/showthread.php?t=262680)

PinHeaDi 05-10-2015 07:47

[Problem] Grenade plugin crashes my server
 
https://forums.alliedmods.net/showpo...3&postcount=80

I'm using the updated version d without Orpheu.

Code:

#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#include <engine>
#include <csx>
#include <fun>

#define VERSION                        "0.1.0d"

#define FBitSet(%0,%1)                ( %0 |= ( 1 << ( %1 & 31 ) ) )
#define FBitClear(%0,%1)        ( %0 &= ~( 1 << ( %1 & 31 ) ) )
#define FBitGet(%0,%1)                ( %0 & ( 1 << ( %1 & 31 ) ) )

new IsFrozen;

#define XO_WEAPON                4
#define m_flNextPrimaryAttack        46
#define m_flNextSecondaryAttack        47
#define m_fGrenadeInfo                96
#define m_usEvent                114
#define m_flFallVelocity        251
#define m_pActiveItem                373

#define EVENT_SMOKE                26

#define CGINFO_HE                ( 1 << 0 )
#define CGINFO_SMOKE                ( 1 << 1 )

#define TASK_UNFREEZE                100

new const g_szSndExplosion[] = "_exp1.wav";
new const g_szSndFrost[] = "_exp2.wav";
new const g_szSndFlare[] = "flareon.wav";

new const g_szMdlFrozen[] = "models/_frozen.mdl";

enum _:Sprites
{
        SPRITE_BEAM,
        SPRITE_EXPLOSION,
        SPRITE_EXPLOSION2,
        SPRITE_SMOKE,
        SPRITE_CYLINDER,
        SPRITE_FLARE,
        SPRITE_FROST,
        SPRITE_FROST2,
        SPRITE_BEAM2,
        SPRITE_FLAKE,
        SPRITE_BEAM3
}

new g_iSprites[ Sprites ];

new const g_iColours[][ 3 ] =
{
        { 255, 0, 0 },
        { 0, 0, 255 },
        { 0, 255, 0 },
        { 255, 255,0 },
        { 255, 0, 255 },
        { 0, 255, 128 },
        { 255, 128, 0 },
        { 255, 255, 255 }
}

new HamHook:_CBasePlayer_PreThink, HamHook:_CBasePlayer_ResetMaxSpeed;
new _pfnEmitSound, _pfnEmitSound_Post, _pfnPlaybackEvent;
new _MsgTempEntity;

new g_pFreezeRadius, g_pFreezeDuration, g_pFlareRadius, g_pFreezeGod;

new g_iMaxPlayers, g_iMdlGlass;

public plugin_precache()
{
        precache_sound( g_szSndExplosion );
        precache_sound( g_szSndFrost );
        precache_sound( g_szSndFlare );
       
        precache_model( g_szMdlFrozen );
        g_iMdlGlass = precache_model( "models/glassgibs.mdl" );
       
        g_iSprites[ SPRITE_BEAM ] = precache_model( "sprites/_trail_1.spr" );
        g_iSprites[ SPRITE_EXPLOSION ] = precache_model( "sprites/_explosion_1.spr" );
        g_iSprites[ SPRITE_EXPLOSION2 ] = precache_model( "sprites/_explosion_2.spr" );
        g_iSprites[ SPRITE_SMOKE ] = precache_model( "sprites/black_smoke4.spr" );
        g_iSprites[ SPRITE_CYLINDER ] = precache_model( "sprites/white.spr" );
        g_iSprites[ SPRITE_FLARE ] = precache_model( "sprites/3dmflaora.spr" );
        g_iSprites[ SPRITE_FROST ] = precache_model( "sprites/_frostexp_1.spr" );
        g_iSprites[ SPRITE_FROST2 ] = precache_model( "sprites/_frostexp_2.spr" );
        g_iSprites[ SPRITE_BEAM2 ] = precache_model( "sprites/_trail_2.spr" );
        g_iSprites[ SPRITE_FLAKE ] = precache_model( "sprites/_snowflake_1.spr" );
        g_iSprites[ SPRITE_BEAM3 ] = precache_model( "sprites/_flare_1.spr" );
}

public plugin_init()
{
        register_plugin( "Grenade Effects", VERSION, "hornet" );
       
        g_pFreezeRadius        = register_cvar( "ge_freeze_radius", "200" );
        g_pFreezeDuration        = register_cvar( "ge_freeze_duration", "5" );
        g_pFlareRadius                = register_cvar( "ge_flare_radius", "35" );
        g_pFreezeGod                = register_cvar( "ge_flare_godmode", "0" );
       
        g_iMaxPlayers                = get_maxplayers();
       
        RegisterHam( Ham_Spawn, "player", "CBasePlayer_Spawn_Post", 1 );
        RegisterHam( Ham_Killed, "player", "CBasePlayer_Killed_Post", 1 );
       
        register_touch( "worldspawn", "grenade", "CGrenade_Touch" );
}

public client_disconnect( id )
{
        if( FBitGet( IsFrozen, id ) )
                UnbreakEffects( id );
}

        /*---------------------------------|
        |                Messages          |
        |---------------------------------*/
       
public Message_TempEntity()
{
        if( get_msg_arg_int( 1 ) == TE_EXPLOSION )
                return PLUGIN_HANDLED;
               
        return PLUGIN_CONTINUE;
}

        /*---------------------------------|
        |        Ham Forwards                    |
        |---------------------------------*/

public CBasePlayer_Spawn_Post( id )
{
        if( is_user_alive( id ) )
        {
                if( FBitGet( IsFrozen, id ) )
                        UnbreakEffects( id );
        }
}
       
public CBasePlayer_Killed_Post( id )
{
        if( FBitGet( IsFrozen, id ) )
                UnbreakEffects( id );
}
               

public CBasePlayer_PreThink( id )
{
        if( FBitGet( IsFrozen, id ) )
        {
                set_pev( id, pev_bInDuck, 0 );
               
                set_pev( id, pev_oldbuttons, pev( id, pev_oldbuttons ) | IN_JUMP );
                set_pev( id, pev_button, pev( id, pev_button ) & IN_JUMP );
        }
}
       
public CBasePlayer_ResetMaxSpeed( id )
{
        if( FBitGet( IsFrozen, id ) )
                return HAM_SUPERCEDE;
       
        return HAM_IGNORED;
}

public CGrenade_Touch( iTouched, iEnt )
{
        if( !get_pdata_int( iEnt, m_usEvent, XO_WEAPON ) )
        {
                if( pev( iEnt, pev_flags ) & FL_ONGROUND && !pev( iEnt, pev_iuser2 ) )
                {
                        emit_sound( iEnt, CHAN_AUTO, g_szSndFlare, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
                        set_pev( iEnt, pev_iuser2 );
                       
                        new iColour[ 3 ];
                        GetColourRGB( pev( iEnt, pev_iuser1 ), iColour );
                       
                        set_rendering( iEnt, kRenderFxGlowShell, iColour[ 0 ], iColour[ 1 ], iColour[ 2 ], kRenderNormal, 16 );
                       
                        FlareExplode( iEnt );
                        Unregister( iEnt, CSW_FLASHBANG );
                }
        }
}

public FlareExplode( iEnt )
{
        if( pev_valid( iEnt ) )
                set_task( 5.0, "FlareExplode", iEnt );
        else        return;
                       
        new iColour[ 3 ];
        GetColourRGB( pev( iEnt, pev_iuser1 ), iColour );
               
        UTIL_DLight( iEnt, 25, iColour[ 0 ], iColour[ 1 ], iColour[ 2 ], 51, 0 );
}

        /*---------------------------------|
        |        Engine Forwards                  |
        |---------------------------------*/

public grenade_throw( id, iEnt, iWeapon )
{
        switch( iWeapon )
        {
                case CSW_HEGRENADE:
                {
                        if( !_MsgTempEntity )
                                _MsgTempEntity = register_message( SVC_TEMPENTITY, "Message_TempEntity" );
                               
                        if( !_pfnEmitSound )
                                _pfnEmitSound = register_forward( FM_EmitSound, "pfnEmitSound" );
                       
                        UTIL_BeamFollow( iEnt, g_iSprites[ SPRITE_BEAM ], 12, 40, 255, 128, 0, 255 );
                        UTIL_BeamFollow( iEnt, g_iSprites[ SPRITE_BEAM ], 8, 30, 255, 135, 40, 150 );
                        UTIL_BeamFollow( iEnt, g_iSprites[ SPRITE_BEAM ], 5, 5, 255, 255, 255, 255 );
                }
               
                case CSW_SMOKEGRENADE:
                {               
                        if( !_pfnEmitSound )
                                _pfnEmitSound = register_forward( FM_EmitSound, "pfnEmitSound" );
                       
                        UTIL_BeamFollow( iEnt, g_iSprites[ SPRITE_BEAM2 ], 20, 10, 0, 128, 255, 255 );
                }
               
                case CSW_FLASHBANG:
                {       
                        new iRand = random_num( 0, sizeof g_iColours - 1 );
                        UTIL_BeamFollow( iEnt, g_iSprites[ SPRITE_BEAM3 ], get_pcvar_num( g_pFlareRadius ), 10, g_iColours[ iRand ][ 0 ], g_iColours[ iRand ][ 1 ], g_iColours[ iRand ][ 2 ], 255 );
                       
                        set_pev( iEnt, pev_iuser1, GetColourTrue( g_iColours[ iRand ] ) );
                               
                        set_pev( iEnt, pev_dmgtime, 9999.0 );
                }
        }
}

        /*---------------------------------|
        |        Fakemeta Forwards          |
        |---------------------------------*/

public pfnPlaybackEvent( Flags, iEnt, iIndex )
{
        if( iIndex == EVENT_SMOKE )
        {
                while( ( iEnt = find_ent_by_class( iEnt, "grenade" ) ) )
                {
                        if( get_pdata_int( iEnt, m_usEvent, XO_WEAPON ) & CGINFO_SMOKE )
                                Unregister( iEnt, CSW_SMOKEGRENADE );
                }
               
                return FMRES_SUPERCEDE;
        }
               
        return FMRES_IGNORED;
}
       
public pfnEmitSound( iEnt, iChannel, szSound[] )
{
        if( equal( szSound, "weapons/debris1.wav" ) || equal( szSound, "weapons/debris2.wav" ) || equal( szSound, "weapons/debris3.wav" ) )
        {
                emit_sound( iEnt, CHAN_AUTO, g_szSndExplosion, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
       
                new Float:vOrigin[ 3 ];
                pev( iEnt, pev_origin, vOrigin );
                       
                vOrigin[ 2 ] -= 32.0;
                set_pev( iEnt, pev_origin, vOrigin );
                       
                UTIL_Explosion( iEnt, g_iSprites[ SPRITE_EXPLOSION ], 50, 30, 4 );
                UTIL_Explosion( iEnt, g_iSprites[ SPRITE_EXPLOSION2 ], 50, 10, 4 );
                       
                UTIL_Smoke( iEnt, g_iSprites[ SPRITE_SMOKE ], 30, 30 );
                UTIL_Smoke( iEnt, g_iSprites[ SPRITE_SMOKE ], 15, 25 );
                       
                UTIL_DLight( iEnt, 80, 255, 128, 0, 50, 40 );
                UTIL_BeamCylinder( iEnt, g_iSprites[ SPRITE_CYLINDER ], 0, 6, 20, 255, 255, 128, 0, 255, 0 );
                UTIL_SpriteTrail( iEnt, g_iSprites[ SPRITE_FLARE ], 15, 3, 3, 50, 0 );
               
                Unregister( iEnt, CSW_HEGRENADE );
        }
        else if( equal( szSound, "weapons/sg_explode.wav" ) )
        {
                new Float:vOrigin[ 3 ];
                pev( iEnt, pev_origin, vOrigin );
               
                UTIL_Explosion( iEnt, g_iSprites[ SPRITE_FROST ], 40, 30, 4 );
                UTIL_Explosion( iEnt, g_iSprites[ SPRITE_FROST2 ], 20, 30, 4 );
               
                UTIL_DLight( iEnt, 80, 0, 128, 255, 50, 40 );
                UTIL_DLight( iEnt, 80, 0, 128, 255, 50, 40 );
                UTIL_BeamCylinder( iEnt, g_iSprites[ SPRITE_CYLINDER ], 0, 5, 10, 255, 0, 128, 255, 255, 0 );
                UTIL_SpriteTrail( iEnt, g_iSprites[ SPRITE_FLAKE ], 30, 3, 2, 30, 0 );
               
                new Players[ 32 ], iNum, iPlayer, Float:flDuration, jEnt, Float:flTime, iGod;
               
                flTime = get_gametime();
                flDuration = get_pcvar_float( g_pFreezeDuration );
                iGod = get_pcvar_num( g_pFreezeGod );
                iNum = find_sphere_class( iEnt, "player", get_pcvar_float( g_pFreezeRadius ), Players, g_iMaxPlayers - 1 );
               
                new id = pev( iEnt, pev_owner );
                new iTeam = get_user_team( id );
               
                if( iNum )
                {
                        if( !IsFrozen )
                        {
                                _CBasePlayer_PreThink = RegisterHam( Ham_Player_PreThink, "player", "CBasePlayer_PreThink" );
                                _CBasePlayer_ResetMaxSpeed = RegisterHam( Ham_CS_Player_ResetMaxSpeed, "player", "CBasePlayer_ResetMaxSpeed" );
                        }
                }
               
                for( new i ; i < iNum ; i ++ )
                {
                        iPlayer = Players[ i ];
                       
                        if( !FBitGet( IsFrozen, iPlayer ) && iPlayer != id && is_user_alive( iPlayer ) && iTeam != get_user_team( iPlayer ) )
                        {
                                iEnt = create_entity( "func_breakable" );
                               
                                pev( iPlayer, pev_origin, vOrigin );
                                entity_set_model( iEnt, g_szMdlFrozen );
                               
                                set_pev( iEnt, pev_body, 1 )
                                set_pev( iEnt, pev_owner, iPlayer );
                                set_rendering( iEnt, kRenderFxNone, 0, 128, 200, kRenderTransAdd, 125 );
                               
                                FBitSet( IsFrozen, iPlayer );
                               
                                if( pev( iPlayer, pev_flags ) & FL_ONGROUND )
                                {
                                        set_pev( iPlayer, pev_gravity, 100.0 );
                                       
                                        entity_set_origin( iEnt, vOrigin );
                                        drop_to_floor( iEnt );
                                }
                                else
                                {
                                        set_pev( iPlayer, pev_gravity, 0.00000000001 );
                                        set_pdata_float( iPlayer, m_flFallVelocity, 0.0 );
                                       
                                        vOrigin[ 2 ] -= 45;
                                        entity_set_origin( iEnt, vOrigin );
                                }
                               
                                jEnt = get_pdata_cbase( iPlayer, m_pActiveItem );
                               
                                set_pdata_float( jEnt, m_flNextPrimaryAttack, flTime + 9999.0, XO_WEAPON );
                                set_pdata_float( jEnt, m_flNextSecondaryAttack, flTime + 9999.0, XO_WEAPON );
                               
                                set_pev( iPlayer, pev_velocity, Float:{ 0.0, 0.0, 0.0 } );
                                set_pev( iPlayer, pev_basevelocity, Float:{ 0.0, 0.0, 0.0 } );
                                set_pev( iPlayer, pev_maxspeed, 1.0 );
                               
                                if( iGod )
                                        set_user_godmode( iPlayer, 1 );
                               
                                set_user_rendering( iPlayer, kRenderFxGlowShell, 0, 128, 255, kRenderNormal, 32 );
                                set_task( flDuration, "Task_Unfreeze", iPlayer + TASK_UNFREEZE );
                        }

                }
               
                emit_sound( iEnt, CHAN_AUTO, g_szSndFrost, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
               
                _pfnEmitSound_Post = register_forward( FM_EmitSound, "pfnEmitSound_Post", 1 );
               
                return FMRES_SUPERCEDE;
        }
       
        return FMRES_IGNORED;
}
       
public pfnEmitSound_Post( iEnt, iChannel, szSound[] )
{
        if( !_pfnPlaybackEvent )
                _pfnPlaybackEvent = register_forward( FM_PlaybackEvent, "pfnPlaybackEvent" );
       
        unregister_forward( FM_EmitSound, _pfnEmitSound_Post, 1 );
}

        /*---------------------------------|
        |                Tasks                  |
        |---------------------------------*/

public Task_Unfreeze( id )
{
        id -= TASK_UNFREEZE;
       
        if( is_user_alive( id ) )
        {
                FBitClear( IsFrozen, id );
               
                set_pev( id, pev_gravity, 1.0 );
                ExecuteHamB( Ham_CS_Player_ResetMaxSpeed, id );
               
                new iEnt = get_pdata_cbase( id, m_pActiveItem );
                               
                set_pdata_float( iEnt, m_flNextPrimaryAttack, 0.0, XO_WEAPON );
                set_pdata_float( iEnt, m_flNextSecondaryAttack, 0.0, XO_WEAPON );
               
                set_user_rendering( id, kRenderFxNone, 0, 0, 0, kRenderNormal, 1 );
               
                if( get_pcvar_num( g_pFreezeGod ) )
                        set_user_godmode( id, 0 );
               
                UnbreakEffects( id );
        }
}

        /*---------------------------------|
        |                Stocks                  |
        |---------------------------------*/

GetColourRGB( iColour, iOut[ 3 ] )
{
        iOut[ 0 ] = ( iColour >> 16 ) & 0xFF;
        iOut[ 1 ] = ( iColour >> 8 ) & 0xFF;
        iOut[ 2 ] = iColour & 0xFF;
}

GetColourTrue( RGB[ 3 ] )
{
        new iColour;
       
        iColour = RGB[ 0 ];
        iColour = ( iColour << 8 ) + RGB[ 1 ];
        iColour = ( iColour << 8 ) + RGB[ 2 ];
       
        return iColour;
}
       
UnbreakEffects( id )
{
        new iEnt = find_ent_by_owner( -1, "func_breakable", id );
        UTIL_BreakModel( iEnt, g_iMdlGlass, Float:{ 64.0, 64.0, 128.0 }, Float:{ 50.0, 50.0, 100.0 }, 15, 10, 10, 0 );
               
        emit_sound( iEnt, CHAN_AUTO, "debris/bustglass1.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
               
        remove_entity( iEnt );
               
        FBitClear( IsFrozen, id );
               
        if( !IsFrozen )
        {
                DisableHamForward( _CBasePlayer_PreThink );
                DisableHamForward( _CBasePlayer_ResetMaxSpeed );
        }
               
        if( task_exists( id + TASK_UNFREEZE ) )
                remove_task( id + TASK_UNFREEZE  );
}

Unregister( iEnt, iWeapon )
{
        new Bits, jEnt;

        while( ( jEnt = find_ent_by_class( jEnt, "grenade" ) ) )
        {       
                if( jEnt == iEnt )
                        continue;
               
                Bits = get_pdata_int( m_usEvent, jEnt, XO_WEAPON );       
               
                if( Bits & CGINFO_SMOKE && iWeapon == CSW_SMOKEGRENADE )
                {
                        remove_entity( iEnt );
                        return;
                }
               
                if( Bits & CGINFO_HE && iWeapon == CSW_HEGRENADE )
                {
                        return;
                }
        }
       
        if( !iEnt )
        {
                unregister_forward( FM_EmitSound, _pfnEmitSound );
                _pfnEmitSound = 0;
        }
       
        switch( iWeapon )
        {
                case CSW_SMOKEGRENADE:
                {
                        unregister_forward( FM_PlaybackEvent, _pfnPlaybackEvent );
                        _pfnPlaybackEvent = 0;
                       
                        remove_entity( iEnt );
                }
               
                case CSW_HEGRENADE:
                {
                        unregister_message( SVC_TEMPENTITY, _MsgTempEntity );
                        _MsgTempEntity = 0;
                }
        }
}
       
UTIL_BeamCylinder( iEnt, iSprite, iFramerate, iLife, iWidth, iAmplitude, iRed, iGreen, iBlue, iBright, iSpeed )
{
        new Float:vOrigin[ 3 ];
        pev( iEnt, pev_origin, vOrigin );
       
        message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
        write_byte( TE_BEAMCYLINDER );
        engfunc( EngFunc_WriteCoord, vOrigin[ 0 ] );
        engfunc( EngFunc_WriteCoord, vOrigin[ 1 ] );
        engfunc( EngFunc_WriteCoord, vOrigin[ 2 ] + 10 );
        engfunc( EngFunc_WriteCoord, vOrigin[ 0 ] );
        engfunc( EngFunc_WriteCoord, vOrigin[ 1 ] + 400 );
        engfunc( EngFunc_WriteCoord, vOrigin[ 2 ] + 400 );
        write_short( iSprite );
        write_byte( 0 );
        write_byte( iFramerate );
        write_byte( iLife );
        write_byte( iWidth );
        write_byte( iAmplitude );
        write_byte( iRed );
        write_byte( iGreen );
        write_byte( iBlue );
        write_byte( iBright );
        write_byte( iSpeed );
        message_end();
}
       
UTIL_BeamFollow( iEnt, iSprite, iLife, iWidth, iRed, iGreen, iBlue, iBright )
{
        message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
        write_byte( TE_BEAMFOLLOW );
        write_short( iEnt );
        write_short( iSprite );
        write_byte( iLife );
        write_byte( iWidth );
        write_byte( iRed );
        write_byte( iGreen );
        write_byte( iBlue );
        write_byte( iBright );
        message_end();
}

UTIL_BreakModel( iEnt, iModel, Float:vSize[ 3 ], Float:vVelocity[ 3 ], iVary, iNum, iLife, Flags )
{
        new Float:vOrigin[ 3 ];
        pev( iEnt, pev_origin, vOrigin );
       
        message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
        write_byte(TE_BREAKMODEL);
        engfunc( EngFunc_WriteCoord, vOrigin[ 0 ] );
        engfunc( EngFunc_WriteCoord, vOrigin[ 1 ] );
        engfunc( EngFunc_WriteCoord, vOrigin[ 2 ] );
        engfunc( EngFunc_WriteCoord, vSize[ 0 ] );
        engfunc( EngFunc_WriteCoord, vSize[ 1 ] );
        engfunc( EngFunc_WriteCoord, vSize[ 2 ] );
        engfunc( EngFunc_WriteCoord, random_float( -vVelocity[ 0 ], vVelocity[ 0 ] ) );
        engfunc( EngFunc_WriteCoord, random_float( -vVelocity[ 1 ], vVelocity[ 1 ] ) );
        engfunc( EngFunc_WriteCoord, vVelocity[ 2 ] );
        write_byte( iVary );
        write_short( iModel );
        write_byte( iNum );
        write_byte( iLife );
        write_byte( Flags );
        message_end();
}

UTIL_DLight( iEnt, iRadius, iRed, iGreen, iBlue, iLife, iDecay )
{
        new Float:vOrigin[ 3 ];
        pev( iEnt, pev_origin, vOrigin );
       
        message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
        write_byte( TE_DLIGHT );
        engfunc( EngFunc_WriteCoord, vOrigin[ 0 ] );
        engfunc( EngFunc_WriteCoord, vOrigin[ 1 ] );
        engfunc( EngFunc_WriteCoord, vOrigin[ 2 ] );
        write_byte( iRadius );
        write_byte( iRed );
        write_byte( iGreen );
        write_byte( iBlue );
        write_byte( iLife );
        write_byte( iDecay );
        message_end();
}

UTIL_Explosion( iEnt, iSprite, iScale, iFramerate, Flags )
{
        new Float:vOrigin[ 3 ];
        pev( iEnt, pev_origin, vOrigin );
       
        message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
        write_byte( TE_EXPLOSION );
        engfunc( EngFunc_WriteCoord, vOrigin[ 0 ] );
        engfunc( EngFunc_WriteCoord, vOrigin[ 1 ] );
        engfunc( EngFunc_WriteCoord, vOrigin[ 2 ] );
        write_short( iSprite );
        write_byte( iScale );
        write_byte( iFramerate );
        write_byte( Flags );
        message_end();
}

UTIL_SpriteTrail( iEnt, iSprite, iCount, iLife, iScale, iVelocity, iVary )
{
        new Float:vOrigin[ 3 ];
        pev( iEnt, pev_origin, vOrigin );
       
        message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
        write_byte( TE_SPRITETRAIL );
        engfunc( EngFunc_WriteCoord, vOrigin[ 0 ] );
        engfunc( EngFunc_WriteCoord, vOrigin[ 1 ] );
        engfunc( EngFunc_WriteCoord, vOrigin[ 2 ] + 100 );
        engfunc( EngFunc_WriteCoord, vOrigin[ 0 ] + random_float( -200.0, 200.0 ) );
        engfunc( EngFunc_WriteCoord, vOrigin[ 1 ] + random_float( -200.0, 200.0 ) );
        engfunc( EngFunc_WriteCoord, vOrigin[ 2 ] );
        write_short( iSprite );
        write_byte( iCount );
        write_byte( iLife );
        write_byte( iScale );
        write_byte( iVelocity );
        write_byte( iVary );
        message_end();
}

UTIL_Smoke( iEnt, iSprite, iScale, iFramerate )
{
        new Float:vOrigin[ 3 ];
        pev( iEnt, pev_origin, vOrigin );
       
        message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
        write_byte( TE_SMOKE );
        engfunc( EngFunc_WriteCoord, vOrigin[ 0 ] );
        engfunc( EngFunc_WriteCoord, vOrigin[ 1 ] );
        engfunc( EngFunc_WriteCoord, vOrigin[ 2 ] );
        write_short( iSprite );
        write_byte( iScale );
        write_byte( iFramerate );
        message_end();
}

The frost grenade is buggy. Sometimes when you freeze someone - he's stays that way. When you throw it - it plays the sound of the flare, and than it frosts. And the server is crashing with it, but now error at all. But its that's plugins fault, because without it no server crash occurs..ever.

JusTGo 05-10-2015 07:55

Re: [Problem] Grenade plugin crashes my server
 
1 Attachment(s)
you may test this one it doesn't require orpheu

PinHeaDi 05-10-2015 08:00

Re: [Problem] Grenade plugin crashes my server
 
Quote:

Originally Posted by JusTGo (Post 2295180)
you may test this one it doesn't require orpheu

I liked the explosive effect of this plugin, that's why I need it to be fixed. Basically I liked that its 3 in 1, and no other plugins are needed.

JusTGo 05-10-2015 08:13

Re: [Problem] Grenade plugin crashes my server
 
i think they are the same see avalanche_frost.sma.

PinHeaDi 05-10-2015 10:11

Re: [Problem] Grenade plugin crashes my server
 
Well found a good frost grenade. But can the HE grenade effects and the whole grenade to be extracted from this plugin, to a different one, only with the HE grenade.


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

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