AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Paintball Mod Help With Entitys (https://forums.alliedmods.net/showthread.php?t=324565)

Arje 05-19-2020 17:44

Paintball Mod Help With Entitys
 
Hello everyone! well, i need help with this paintball script

I do not want bullets to break entities on the map, at least not the base boxes, but I do want them to break glass or bars,
I found a small solution to this, which is only allowing some entities to be affected by the painting and the rest not, however some entities are affected because their EntIDs are the same, I publish the part of the code that is what affects this.

I wanted to know if it is possible to make that for each map, I can choose which entities can be broken


PHP Code:

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

#define PLUGIN "Paintball Gun"
#define VERSION "3.4"
#define AUTHOR "WhooKid"

new const boxes []=
{
    
//de_nuke
    
111,
    
114,
    
115,
    
165,
    
166,
    
169,
    
172,
    
185,
    
//de_inferno
    
179,
    
//de_prodigy
    
86,
    
98,
    
99,
    
100,
    
125,
    
157,
    
158,
    
//de_survivor
    
100,
    
146,
    
147,
    
148,
    
149,
    
//de_cpl_mill
    
236,
    
//de_mirage
    
69,
    
70,
    
71,
    
72,
    
77,
    
81
}

public 
fw_touch(bulletent)
{
new 
bool:valid_surface = (is_ent_alive || containi(class2"door") != -1) ? false true;
if (
pev(entpev_health) && !is_ent_alive// && pev(ent, pev_takedamage) != DAMAGE_NO)
            
{
            new 
bool:isbox true
            
for(new 0sizeof(boxes); i++)
            if(
ent == boxes[i])
                {
                
isbox false
                
break
                }
                
            if(!
isbox)
        
ExecuteHam(Ham_TakeDamageentownerownerfloat(pev(entpev_health)), 0);
        
valid_surface false;
        }
        
        
        if (
valid_surface)
        {
            
paint_splat(bullet);
            
set_task(float(get_pcvar_num(blife)), "paint_reset"bullet+TASK_PB_RESET);
        }
        else
            
paint_reset(bullet+TASK_PB_RESET);

        return 
FMRES_HANDLED
    }
    return 
FMRES_IGNORED;




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

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