Raised This Month: $32 Target: $400
 8% 

Paintball Mod Help With Entitys


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Arje
Senior Member
Join Date: Apr 2020
Location: Córdoba, Argentina
Old 05-19-2020 , 17:46   Paintball Mod Help With Entitys
Reply With Quote #1

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;

Arje is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:19.


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