AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Linux C4 OFFSET (https://forums.alliedmods.net/showthread.php?t=320679)

MayroN 01-03-2020 16:17

Linux C4 OFFSET
 
Prompt please offsets on Linux that the thrown out Bomb C4 was not removed at once from the earth

P.S. On Windows everything is in order

PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define STEP 10.0
#define VERTICAL_SPEED 20.0
#define HORISONTAL_SPEED 60.0

enum (+= 1) {
    
STATUS_NONE 0,
    
STATUS_EFFECT,
    
STATUS_KILL
}

new 
g_CvarTimeout;

public 
plugin_init() {
    
register_plugin("Remove Drop Weapon""0.3""GordonFreeman & F@nt0M");
        
register_forward(FM_SetModel"FM_SetModel_Pre"0)
    
register_forward(FM_SetModel"CWeaponBox_ItemModel")
        
RegisterHam(Ham_Think"item_thighpack""fw_WeaponBoxThink")
    
RegisterHam(Ham_Think,"weapon_shield","fw_WeaponBoxThink")
    
RegisterHam(Ham_Think,"weaponbox","fw_WeaponBoxThink")
        
g_CvarTimeout register_cvar("weapon_time""30.0")
}

public 
FM_SetModel_Pre(const iEntity)
{
    
#define m_rgpPlayerItems2 39 // CBasePlayerItem *

    
new szClassName[32]; pev(iEntitypev_classnameszClassNamecharsmax(szClassName));
    if(!
equal(szClassName"weaponbox")) return FMRES_IGNORED;

    new 
pWeapon get_pdata_cbase(iEntitym_rgpPlayerItems24);

    if(!
pev_valid(pWeapon))
    {
         
set_pev(iEntitypev_nextthinkget_gametime() + get_pcvar_float(g_CvarTimeout));
    }
    
    return 
FMRES_IGNORED;
}

public 
CWeaponBox_ItemModel(const iEntity) {
    if(!
pev_valid(iEntity))
        return 
FMRES_IGNORED;
    
    static 
szClassName[32]
    
pev(iEntitypev_classnameszClassNamecharsmax(szClassName))
        
    if(
equal(szClassName"item_thighpack"))    
        {
        
set_pev(iEntitypev_impulseSTATUS_NONE);
        
set_pev(iEntitypev_nextthinkget_gametime() + get_pcvar_float(g_CvarTimeout));    
    }
    else if(
equal(szClassName"weapon_shield"))    
        {
                
set_task0.1"ChangeNextThinkTime"iEntity )
    }
    
    return 
FMRES_IGNORED;
}

public 
ChangeNextThinkTime( const iEntity ) {
       
    if( 
pev_valid(iEntity) ) {
        static 
szClassName[32]
        
pev(iEntitypev_classnameszClassNamecharsmax(szClassName))
        if(
equal(szClassName"weapon_shield"))    {
        
set_pev(iEntitypev_impulseSTATUS_NONE);
        
set_pev(iEntitypev_nextthinkget_gametime() + get_pcvar_float(g_CvarTimeout));
        }
    }
}

public 
fw_WeaponBoxThink(iEntity) {
    if (!
pev_valid(iEntity)) {
        return 
HAM_IGNORED;
    }
    
    switch(
pev(iEntitypev_impulse))    {
        case 
STATUS_NONE:{
            
set_pev(iEntitypev_movetypeMOVETYPE_FLY);
            
set_pev(iEntitypev_solidSOLID_NOT);
            
set_pev(iEntitypev_rendermodekRenderTransAlpha);
            
            
set_pev(iEntitypev_renderamt100.0);
            
set_pev(iEntitypev_velocityFloat:{0.00.0VERTICAL_SPEED});
            
set_pev(iEntitypev_avelocityFloat:{0.0HORISONTAL_SPEED0.0})
            
set_pev(iEntitypev_impulseSTATUS_EFFECT);        
        }
        case 
STATUS_EFFECT:    {
            if (
pev(iEntitypev_renderamt) > 0.0) {
                
set_pev(iEntitypev_renderamtfloatmax(0.0pev(iEntitypev_renderamt) - STEP));
            } else {
                
set_pev(iEntitypev_flagsFL_KILLME);
                
set_pev(iEntitypev_impulseSTATUS_KILL);
            }
        }
    }
    
    
set_pev(iEntity,pev_nextthink,get_gametime() + 0.1)
    
    return 
HAM_SUPERCEDE;



thEsp 01-04-2020 06:16

Re: Linux C4 OFFSET
 
I fear your thread isn't well-detailed. Are you using a translator?

MayroN 01-04-2020 12:48

Re: Linux C4 OFFSET
 
Quote:

Originally Posted by thEsp (Post 2678922)
I fear your thread isn't well-detailed. Are you using a translator?

On Windows, all discarded weapons are removed from the ground after the time has elapsed ( the Bomb is not removed).On Linux, the same thing happens with the Bomb.I need offsets that will not remove the Bomb from the ground on Linux


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

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