AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Remove bullet holes (https://forums.alliedmods.net/showthread.php?t=121826)

lazarev 03-20-2010 09:32

Remove bullet holes
 
How? :|

Arkshine 03-20-2010 09:35

Re: Remove bullet holes
 
AFAIK, you can not remove specific decals but you can remove all the decals in a map at once.

KadiR 03-20-2010 10:11

Re: Remove bullet holes
 
PHP Code:

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

#define PLUGIN "Decal Remover"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.1"

#define FEV_RELIABLE (1<<1)
#define FEV_GLOBAL (1<<2)

new g_iDecalReset
new g_iTaskEnt

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
RegisterTask()

    
g_iDecalReset engfunc(EngFunc_PrecacheEvent1"events/decal_reset.sc")
}

RegisterTask()
{
    new 
iEnt
    
new iMaxEnts global_get(glb_maxEntities)
    new 
szClassName[2]
    
// without amxx, the ent id is maxplayers + 1
    // but if a plugin creates some entities during precache it won't
    // so use this code to retrieve the ent
    
for(iEnt get_maxplayers() + 1iEnt<iMaxEntsiEnt++)
    {
        if( 
pev_valid(iEnt) )
        {
            
pev(iEntpev_classnameszClassNamecharsmax(szClassName))
            if( !
szClassName[0] )
            {
                
g_iTaskEnt iEnt
                RegisterHamFromEntity
(Ham_ThinkiEnt"Task_RemoveDecals"1)
                return
            }
        }
    }
}

public 
Task_RemoveDecalsiEnt )
{
    if( 
iEnt != g_iTaskEnt )
    {
    
/*    new szClassName[32]
        pev(iEnt, pev_classname, szClassName, charsmax(szClassName))
        log_to_file("ClassLessEnt", szClassName)*/
        
return
    }

    static 
iCount
    
if( ++iCount 15 == )
    {
        
engfunc(EngFunc_PlaybackEventFEV_RELIABLE|FEV_GLOBAL0g_iDecalReset0.0Float:{0.00.00.0}, Float:{0.00.00.0}, 0.00.00000)
    }




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

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