Raised This Month: $12 Target: $400
 3% 

func_door help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Arje
Senior Member
Join Date: Apr 2020
Location: Córdoba, Argentina
Old 07-26-2020 , 13:03   func_door help
Reply With Quote #1

Hello, I do not know if you know the paintball plugin, but when I shoot at the doors they open, and I would like to make this not happen but I do not know how to do it

I am using this code

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <fun>
#include <amxmisc>

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

#define MAX_PAINTBALLS    200
#define TASK_PB_RESET    1000
#define TASK_RELOAD    2000

#define m_pPlayer    41

new g_paintballs[MAX_PAINTBALLS], g_pbstatus[MAX_PAINTBALLS], g_pbcountFloat:lastshot[33], Float:nextattack[33], freezetime;
new 
pbgunpbusppbglockcolorshotsvelocspeedblifesoundbglowdamgefriendlyfiretgunctgunbeamspr;

static const 
g_shot_anim[4] = {0395};
static const 
g_pbgun_models[11][] = {"models/v_pbgun.mdl""models/v_pbgun1.mdl""models/v_pbgun2.mdl""models/v_pbgun3.mdl""models/v_pbgun4.mdl""models/v_pbgun5.mdl""models/v_pbgun6.mdl""models/v_pbgun7.mdl""models/v_pbgun8.mdl""models/v_pbgun9.mdl""models/v_pbgun10.mdl"};

//------------------- Agregados Lucas ------------------------------//
/* The plugin works with 3 lists of maps, where each one fulfills a different function, in the First List we find maps where all the 
entities that can be broken are broken, for example glass, boxes, wood, etc. In the Second List we find maps where you cannot break 
anything on the map, for example the boxes of the sites, etc. In the Third List by using "Nº. Entities" we can tell the sv which 
entities should break and which should not, this is applicable to maps where we want some things to break and others not,for example 
the case in de_mirage where the site boxes we don't want are broken, but there are also bars that we do want to break.
*/

new const g_mapstobreak []=     // Poner los mapas que queramos que se rompan rejas, vidrios, etc.
{                // Put the maps that we want to break bars, glass, etc.
    
"de_chateau",
    
"de_cpl_mill",
    
"de_nuke"
    
"de_survivor",
    
"de_tuscan",
    
"de_inferno",
    
"de_concrete2",
    
"de_concrete20",
    
"surf_ski_2",
    
"de_nuke_rarea",
    
"de_cbble_go",
    
"css_cbble",
    
"css_mirage_go",
    
"css_miragesky_go",
    
"css_train_go",
    
"css_crane"
}

new const 
g_mapsdontbreak []=    // Poner los mapas donde queramos que no se rompan cajas del site, etc.
{                // Put the maps where we want them not to break site boxes, etc.
    
"de_airstrip",
    
"de_aztec",
    
"de_cbble"
    
"de_dust",
    
"de_dust2",
    
"de_storm",
    
"de_torn",
    
"de_train",
    
"de_vertigo",
    
"de_dust2_largo",
    
"de_dust2_largo_y_ma",
    
"de_hell",
    
"de_cpl_fire",
    
"cs_paintball",
    
"css_aztec",
    
"css_dust2",
    
"de_vertigo_go",
    
"css_dust2night_go",
    
"css_dust2winter_go",
    
"css_dust2_go",
    
"css_dust3_go",
    
"css_dust20",
    
"css_dust",
    
"css_kabul2",
    
"css_port",
    
"css_shorttrain",
    
"css_cache2x2",
    
"css_dust2x2",
    
"css_dust2x2_go",
    
"css_kabul2x2",
    
"css_train2x2",
    
// Use Id's entity
    
"de_piranesi"
}

new const 
g_mapstobreaknt []=    // Mapas donde queramos que se rompan algunas cajas y otras no.
{                // Maps where we want some boxes to be broken and others not.
    // Use Id's entity            
    
"de_kabul_sl_v1",     
    
"de_kabul20",
    
"css_kabul20",
    
"de_prodigy",
    
"de_mirage",
    
"de_overpass",
    
"css_overpass",
    
"de_cpl_strike",
    
"css_mirage"
}

new const 
boxesdontbreak []=        // Nº Entitys of "g_mapsdontbreak" (Line: 59 - 77)
{
//de_piranesi
420    ,
423    ,
430    
}

new const 
boxestobreaknt []=    // Nº Entitys of "g_mapstobreaknt" (Line: 79 - 88)
{
//de_prodigy    
16    ,
34    ,
46    ,
47    ,
48    ,
49    ,
73    ,
101    ,
102    ,
103    ,
104    ,
105    ,
//de_mirage    
17    ,
18    ,
19    ,
20    ,
25    ,
29    ,
//de_overpass    
53    ,
54    ,
55    ,
56    ,
57    ,
58    ,
//de_cpl_strike    
21    ,
26    ,
//de_kabul20    
45    ,
94    ,    
//css_mirage    
96    ,
97    
}
//---------------Terminan las constantes agregadas ----------------//////
public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_cvar("paintballgun"VERSIONFCVAR_SERVER|FCVAR_UNLOGGED);
    
register_clcmd("say /ent""ent_info"ADMIN_SLAY);
    
pbgun register_cvar("amx_pbgun""1");
    
pbusp register_cvar("amx_pbusp""1");
    
pbglock register_cvar("amx_pbglock""1");
    
    if (
get_pcvar_num(pbgun) || get_pcvar_num(pbusp) || get_pcvar_num(pbglock))
    {
        
// Reemplazado para que no se puedan bugear las balas en la siguiente ronda
        // register_event("HLTV", "ev_roundstart", "a", "1=0", "2=0")
        
register_logevent("ev_roundstart"2"0=World triggered""1=Round_Start");
        if (
get_cvar_num("mp_freezetime") > 0)
        
register_event("HLTV""ev_freezetime""a""1=0""2=0");
        
        
//---------- Agregados Lucas, reemplazo de ev_curweapon ---------------------------
        
RegisterHam(Ham_Item_Deploy"weapon_usp""Usp_Deploy"1)
        
RegisterHam(Ham_Item_Deploy"weapon_glock18""Glock18_Deploy"1)
        
RegisterHam(Ham_Item_Deploy"weapon_mp5navy""Mp5navy_Deploy"1)
        
//-------------------------------------------------------------------------------

        
register_forward(FM_Touch"fw_touch");
        
register_forward(FM_SetModel"fw_setmodel");
        
register_forward(FM_PlayerPreThink"fw_playerprethink"1);
        
register_forward(FM_UpdateClientData"fw_updateclientdata"1);

        
color register_cvar("pbgun_color""2");
        
shots register_cvar("pbgun_shots""105");
        
veloc register_cvar("pbgun_velocity""2000");
        
speed register_cvar("pbgun_speed""0.08");
        
blife register_cvar("pbgun_life""0.99");    //dejar en 0.99 porque son como 1 segundos de vida del sprite de pintura
        
sound register_cvar("pbgun_sound""1");
        
bglow register_cvar("pbgun_glow""0");
        
damge register_cvar("pbgun_damage""100");
        
friendlyfire get_cvar_pointer("mp_friendlyfire");

        new 
amax_ents_allow global_get(glb_maxEntities) - 5;
        for (
1<= get_pcvar_num(shots); a++)
            if (
MAX_PAINTBALLS)
                if (
engfunc(EngFunc_NumberOfEntities) < max_ents_allow)
                {
                    
g_paintballs[a] = engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"));
                    if (
pev_valid(g_paintballs[a]))
                    {
                        
set_pev(g_paintballs[a], pev_effectspev(g_paintballs[a], pev_effects) | EF_NODRAW);
                        
g_pbcount++;
                    }
                }
        if (
g_pbcount 1)
            
set_fail_state("[AMXX] Failed to load Paintball Gun (unable to create ents)");        
        
//server_print("*** %s v%s by %s Enabled ***", PLUGIN, VERSION, AUTHOR);
    
}
}

public 
plugin_precache()
{
    
register_cvar("amx_pbgun""1");
    
register_cvar("amx_pbusp""1");
    
register_cvar("amx_pbglock""1");
    
register_cvar("pbgun_tgun""3");
    
register_cvar("pbgun_ctgun""7");
    
tgun get_cvar_num("pbgun_tgun");
    
ctgun get_cvar_num("pbgun_ctgun");
    if (
get_cvar_num("amx_pbgun")) {
        
precache_model(g_pbgun_models[tgun]);
        
precache_model(g_pbgun_models[ctgun]);
        
precache_model((ctgun) ? "models/p_pbgun1.mdl" "models/p_pbgun.mdl");
        
precache_model("models/w_pbgun.mdl");
    }
    if (
get_cvar_num("amx_pbusp")) {
        
precache_model("models/v_pbusp.mdl");
        
precache_model("models/p_pbusp.mdl");
    }
    if (
get_cvar_num("amx_pbglock")) {
        
precache_model("models/v_pbglock.mdl");
        
precache_model("models/p_pbglock.mdl");
    }
    if (
get_cvar_num("amx_pbgun") || get_cvar_num("amx_pbusp") || get_cvar_num("amx_pbglock")) {
        
precache_sound("misc/pb1.wav");
        
precache_sound("misc/pb2.wav");
        
precache_sound("misc/pb3.wav");
        
precache_sound("misc/pb4.wav");
        
precache_sound("misc/pbg.wav");
        
precache_model("models/w_paintball.mdl");
        
precache_model("sprites/paintball.spr");
    }
    
beamspr precache_model("sprites/laserbeam.spr");
}
////////////////- Agregados Lucas-////////////////////////////////////
public plugin_cfg()
{
    if(
is_plugin_loaded("Pause Plugins") > -1)
        
server_cmd("amx_pausecfg add ^"Paintball Gun General^"");


// Reemplazo del ev_curweapon. para  que no puedan bugear el arma
public Usp_DeployiUsp )
{
    new 
id get_pdata_cbase(iUspm_pPlayer4);
    
set_pev(idpev_viewmodel2"models/v_pbusp.mdl");
    
set_pev(idpev_weaponmodel2"models/p_pbusp.mdl");


public 
Glock18_DeployiGlock18 )
{
    new 
id get_pdata_cbase(iGlock18m_pPlayer4);
    
set_pev(idpev_viewmodel2"models/v_pbglock.mdl");
    
set_pev(idpev_weaponmodel2"models/p_pbglock.mdl");


public 
Mp5navy_DeployiMp5navy )
{
    new 
id get_pdata_cbase(iMp5navym_pPlayer4);
    
set_pev(idpev_viewmodel2, (get_user_team(id) == 1) ? g_pbgun_models[tgun] : g_pbgun_models[ctgun]);
    
set_pev(idpev_weaponmodel2, (ctgun) ? "models/p_pbgun1.mdl" "models/p_pbgun.mdl");


////////////////- Agregados Lucas-////////////////////////////////////

public ent_info(id)
    
client_print(idprint_chat"[AMXX] [Ent Info (Current/Max)] Paintballs: (%d/%d)   Entities: (%d/%d)"g_pbcountget_pcvar_num(shots), engfunc(EngFunc_NumberOfEntities), global_get(glb_maxEntities));

public 
fw_setmodel(entmodel[]) 
{
     if (
equali(model"models/w_mp5.mdl")) 
        if (
get_pcvar_num(pbgun))
        {
            
engfunc(EngFunc_SetModelent"models/w_pbgun.mdl");
            return 
FMRES_SUPERCEDE;
        }
    return 
FMRES_IGNORED;
}

public 
fw_updateclientdata(idswcd_handle)
{
    if (
user_has_pbgun(id) && cd_handle)
    {
        
set_cd(cd_handleCD_ID1);
        
get_cd(cd_handleCD_flNextAttacknextattack[id]);
        
//set_cd(cd_handle, CD_flNextAttack, 10.0);
        
return FMRES_HANDLED;
    }
    return 
FMRES_IGNORED;
}

public 
fw_playerprethink(id)
{
    new 
my_pbgun user_has_pbgun(id);
    if (
my_pbgun)
    {
        new 
buttons pev(idpev_button);
        if (
buttons IN_ATTACK)
        {
            new 
ammonull get_user_weapon(idammonull);
            if (
ammo)
            {
                
set_pev(idpev_buttonbuttons & ~IN_ATTACK);
                new 
Float:gametime get_gametime(), Float:g_speed;
                if (
my_pbgun == 1)
                    
g_speed get_pcvar_float(speed);
                else
                    
g_speed = (my_pbgun == 2) ? get_pcvar_float(speed) * 2.0 get_pcvar_float(speed) * 3.0;
                if (
gametime-lastshot[id] > g_speed  && nextattack[id] < 0.0 && !freezetime)
                {
                    if (
paint_fire(id))
                    {
                        
lastshot[id] = gametime;
                        
set_user_clip(idammo 1);
                        
set_pev(idpev_punchangleFloat:{-0.50.00.0});
                        
message_begin(MSG_ONE_UNRELIABLESVC_WEAPONANIM_id);
                        
write_byte(g_shot_anim[my_pbgun]);
                        
write_byte(0);
                        
message_end();
                        if (
get_pcvar_num(sound))
                            
emit_sound(idCHAN_AUTO"misc/pbg.wav"1.0ATTN_NORM0PITCH_NORM);
                    }
                }
            }
        }
    }
    return 
FMRES_IGNORED;
}

public 
paint_fire(id)
{
    new 
aent;
    while (
a++ < g_pbcount && !ent)
        if (
g_pbstatus[a] == 0)
            
ent g_pbstatus[a] = g_paintballs[a];
    if (!
ent)
        while (
a-- > && !ent)
            if (
g_pbstatus[a] == 2)
                
ent g_pbstatus[a] = g_paintballs[a];

    if (
pev_valid(ent) && is_user_alive(id))
    {
        new 
Float:vangles[3], Float:nvelocity[3], Float:voriginf[3], vorigin[3], clr;
        
set_pev(entpev_classname"pbBullet");
        
set_pev(entpev_ownerid);
        
engfunc(EngFunc_SetModelent"models/w_paintball.mdl");
        
engfunc(EngFunc_SetSizeentFloat:{-1.0, -1.0, -1.0}, Float:{1.01.01.0});

        switch (
get_pcvar_num(color))
        {
            case 
2clr = (get_user_team(id) == 1) ? 1;
            case 
3clr = (get_user_team(id) == 1) ? 3;
            case 
4clr = (get_user_team(id) == 1) ? 5;
            default: 
clr random_num(06);
        }
        
set_pev(entpev_skinclr);
        
        
get_user_origin(idvorigin1);
        
IVecFVec(voriginvoriginf);
        
engfunc(EngFunc_SetOriginentvoriginf);

        
vangles[0] = random_float(-180.0180.0);
        
vangles[1] = random_float(-180.0180.0);
        
set_pev(entpev_anglesvangles);

        
pev(idpev_v_anglevangles);
        
set_pev(entpev_v_anglevangles);
        
pev(idpev_view_ofsvangles);
        
set_pev(entpev_view_ofsvangles);

        
set_pev(entpev_solid2);
        
set_pev(entpev_movetype5);

        
velocity_by_aim(idget_pcvar_num(veloc), nvelocity);
        
set_pev(entpev_velocitynvelocity);
        
set_pev(entpev_effectspev(entpev_effects) & ~EF_NODRAW);

        
set_task(0.1"paint_glow"ent);
        
set_task(15.0"paint_reset"ent+TASK_PB_RESET);    //aca iba task 15.0
    
}

    return 
ent;
}

public 
fw_touch(bulletent)
{
    new class[
20];
    
pev(bulletpev_classname, class, 19);
    if (!
equali(class, "pbBullet"))
        return 
FMRES_IGNORED;

    new 
Float:origin[3], class2[20], owner pev(bulletpev_owner), is_ent_alive is_user_alive(ent);
    
pev(entpev_classnameclass219);
    
pev(bulletpev_originorigin);
    
    if (
is_ent_alive)
    {
        if (
owner == ent || pev(entpev_takedamage) == DAMAGE_NO)
            return 
FMRES_IGNORED;
        if (
get_user_team(owner) == get_user_team(ent))
            if (!
get_pcvar_num(friendlyfire))
                return 
FMRES_IGNORED;

        new 
szHostagename[32];
        
pev(entpev_classnameszHostagenamecharsmax(szHostagename));
        if(
equali(szHostagename"hostage_entity"))
            return 
FMRES_IGNORED;
                
        
ExecuteHam(Ham_TakeDamageentownerownerfloat(get_pcvar_num(damge)), 4098);
    }
    
    if (!
equali(class, class2))
    {    
        
set_pev(bulletpev_velocityFloat:{0.00.00.0});
        
set_pev(bulletpev_classname"pbPaint");
        
set_pev(bulletpev_solid0);
        
set_pev(bulletpev_movetype0);
        
engfunc(EngFunc_SetModelbullet"sprites/paintball.spr");

        new 
afindpb 0;
        while (
a++ < g_pbcount && !findpb)
            if (
g_paintballs[a] == bullet)
                
findpb g_pbstatus[a] = 2;

        
remove_task(bullet);
        
remove_task(bullet+TASK_PB_RESET);

        if (
get_pcvar_num(sound))
        {
            static 
wav[20];
            
formatex(wav20is_ent_alive "player/pl_pain%d.wav" "misc/pb%d.wav"is_ent_alive random_num(4,7) : random_num(1,4));
            
emit_sound(bulletCHAN_AUTOwav1.0ATTN_NORM0PITCH_NORM);
        }
    
//-------------------------                 Agregados Lucas                      ------------------//
        
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 // The boxes do not explode because they are a box. // No explotan las cajas porque son una caja.
            
            
new maps[32]
            
get_mapname(maps31)
            for(new 
i=0;isizeof(g_mapstobreak);i++)
            if(
equali(mapsg_mapstobreak[i]))
                {
                
isbox false
                
break
                }
                
            for(new 
i=0;isizeof(g_mapsdontbreak);i++)
            if(
equali(mapsg_mapsdontbreak[i]))
                {
                for(new 
0sizeof(boxesdontbreak); i++)
                if(
ent == boxesdontbreak[i])
                    {
                    
isbox false  // Boxes explode, because it's not a box.  // Explotan las cajas, porque no es una caja.
                    
break
                    }
                }
         
            for(new 
i=0;isizeof(g_mapstobreaknt);i++)
            if(
equali(mapsg_mapstobreaknt[i]))
                {
                for(new 
0sizeof(boxestobreaknt); i++)
                if(
ent == boxestobreaknt[i])
                    {
                    
isbox false // Boxes explode, because it's not a box.   // Explotan las cajas, porque no es una caja.
                    
break
                    }
                }
                
            if(!
isbox)  // The !isbox = false boxes are the ones that take damage.    // Las cajas !isbox = false son las que reciben el daño.    
            
ExecuteHam(Ham_TakeDamageentownerownerfloat(pev(entpev_health)), 0);
            
valid_surface false;
            
            if (
isbox)
            
valid_surface true;
            }     
        if (
valid_surface)
        {
            
paint_splat(bullet);
            
set_task(float(get_pcvar_num(blife)), "paint_reset"bullet+TASK_PB_RESET);
        }
        
//------------------              Terminan Agregados Lucas                      ------------------//
        
else
            
paint_reset(bullet+TASK_PB_RESET);

        return 
FMRES_HANDLED
    }

    return 
FMRES_IGNORED;
}

public 
paint_splat(ent)
{
    new 
Float:origin[3], Float:norigin[3], Float:viewofs[3], Float:angles[3], Float:normal[3], Float:aiming[3];
    
pev(entpev_originorigin);
    
pev(entpev_view_ofsviewofs);
    
pev(entpev_v_angleangles);

    
norigin[0] = origin[0] + viewofs[0];
    
norigin[1] = origin[1] + viewofs[1];
    
norigin[2] = origin[2] + viewofs[2];
    
aiming[0] = norigin[0] + floatcos(angles[1], degrees) * 1000.0;
    
aiming[1] = norigin[1] + floatsin(angles[1], degrees) * 1000.0;
    
aiming[2] = norigin[2] + floatsin(-angles[0], degrees) * 1000.0;

    
engfunc(EngFunc_TraceLinenoriginaiming0ent0);
    
get_tr2(0TR_vecPlaneNormalnormal);

    
vector_to_angle(normalangles);
    
angles[1] += 180.0;
    if (
angles[1] >= 360.0angles[1] -= 360.0;
    
set_pev(entpev_anglesangles);
    
set_pev(entpev_v_angleangles);

    
origin[0] += (normal[0] * random_float(0.32.7));
    
origin[1] += (normal[1] * random_float(0.32.7));
    
origin[2] += (normal[2] * random_float(0.32.7));
    
engfunc(EngFunc_SetOriginentorigin);
    
set_pev(entpev_framefloat(random_num( (pev(entpev_skin) * 18), (pev(entpev_skin) * 18) + 17 ) ));
    if (
pev(entpev_renderfx) != kRenderFxNone)
        
set_rendering(ent);
}

public 
paint_glow(ent)
{
    if (
pev_valid(ent))
    {
        static 
pbglow[5], clr[3];
        
get_pcvar_string(bglowpbglow4);
        switch (
get_pcvar_num(color))
        {
            case 
2clr = (get_user_team(pev(entpev_owner))==1) ? {25500} : {00255};
            default: 
clr = {255255255};
        }
        if (
read_flags(pbglow) & (<< 0))
            
set_rendering(entkRenderFxGlowShellclr[0], clr[1], clr[2], kRenderNormal255);
        if (
read_flags(pbglow) & (<< 1))
        {
            
message_begin(MSG_BROADCASTSVC_TEMPENTITY);
            
write_byte(TE_BEAMFOLLOW);
            
write_short(ent);
            
write_short(beamspr);
            
write_byte(4);
            
write_byte(2);
            
write_byte(clr[0]);
            
write_byte(clr[1]);
            
write_byte(clr[2]);
            
write_byte(255);
            
message_end();
        }
    }
}

public 
paint_reset(ent)
{
    
remove_task(ent);
    
ent -= TASK_PB_RESET;
    new 
afindpb 1;
    while (
a++ <= g_pbcount && findpb)
        if (
g_paintballs[a] == ent)
            
findpb g_pbstatus[a] = 0;

    
set_pev(entpev_effectspev(entpev_effects) | EF_NODRAW);
    
engfunc(EngFunc_SetSizeentFloat:{0.00.00.0}, Float:{0.00.00.0});
    
set_pev(entpev_velocityFloat:{0.00.00.0});
    
engfunc(EngFunc_SetOriginentFloat:{-2000.0, -2000.0, -2000.0});
    if (
pev(entpev_renderfx) != kRenderFxNone)
        
set_rendering(ent);
}

public 
ev_roundstart()
{
    for (new 
1<= g_pbcounta++)
        if (
g_pbstatus[a] != 0)
            
paint_reset(g_paintballs[a]+TASK_PB_RESET);
    if (
freezetime)
        
freezetime 0;
}

public 
ev_freezetime()
    
freezetime 1;

stock user_has_pbgun(id)
{
    if (
is_user_alive(id))
    {
        new 
model[25];
        
pev(idpev_viewmodel2model24);
        if (
containi(model"models/v_pbgun") != -1)
            return 
1;
        else if (
equali(model"models/v_pbusp.mdl"))
            return 
2;
        else if (
equali(model"models/v_pbglock.mdl"))
            return 
3;
    }
    return 
0;
}

stock set_user_clip(idammo)
{
    new 
weaponname[32], weaponid = -1weapon get_user_weapon(id__);
    
get_weaponname(weaponweaponname31);
    while ((
weaponid engfunc(EngFunc_FindEntityByStringweaponid"classname"weaponname)) != 0)
        if (
pev(weaponidpev_owner) == id) {
            
set_pdata_int(weaponid51ammo4);
            return 
weaponid;
        }
    return 
0;
}

// teame06's function
stock set_rendering(indexfx=kRenderFxNoner=0g=0b=0render=kRenderNormalamount=16)
{
    
set_pev(indexpev_renderfxfx);
    new 
Float:RenderColor[3];
    
RenderColor[0] = float(r);
    
RenderColor[1] = float(g);
    
RenderColor[2] = float(b);
    
set_pev(indexpev_rendercolorRenderColor);
    
set_pev(indexpev_rendermoderender);
    
set_pev(indexpev_renderamtfloat(amount));

Arje is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 07-26-2020 , 15:00   Re: func_door help
Reply With Quote #2

PHP Code:
public fw_touch(bulletent)
{
    new class[
20];
    
pev(bulletpev_classname, class, 19);
    if (!
equali(class, "pbBullet"))
        return 
FMRES_IGNORED;

    new 
Float:origin[3], class2[20], owner pev(bulletpev_owner), is_ent_alive is_user_alive(ent);
    
pev(entpev_classnameclass219);

    if (
equal(class2"func_door") || equal(class2"func_door_rotating"))
        return 
FMRES_IGNORED
__________________
Retired.
Xalus is offline
Arje
Senior Member
Join Date: Apr 2020
Location: Córdoba, Argentina
Old 07-26-2020 , 16:59   Re: func_door help
Reply With Quote #3

Quote:
Originally Posted by Xalus View Post
PHP Code:
public fw_touch(bulletent)
{
    new class[
20];
    
pev(bulletpev_classname, class, 19);
    if (!
equali(class, "pbBullet"))
        return 
FMRES_IGNORED;

    new 
Float:origin[3], class2[20], owner pev(bulletpev_owner), is_ent_alive is_user_alive(ent);
    
pev(entpev_classnameclass219);

    if (
equal(class2"func_door") || equal(class2"func_door_rotating"))
        return 
FMRES_IGNORED
I tried this but it only makes the bullets bounce off the door, and it keeps opening
Arje is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 07-28-2020 , 03:21   Re: func_door help
Reply With Quote #4

return FMRES_IGNORED; -> return FMRES_SUPERCEDE;
__________________
Retired.
Xalus is offline
Arje
Senior Member
Join Date: Apr 2020
Location: Córdoba, Argentina
Old 07-28-2020 , 20:29   Re: func_door help
Reply With Quote #5

Quote:
Originally Posted by Xalus View Post
return FMRES_IGNORED; -> return FMRES_SUPERCEDE;
I put this
PHP Code:
 if (equal(class2"func_door") || equal(class2"func_door_rotating"))
        return 
FMRES_SUPERCEDE
but the bullets keep bouncing, and the doors opening
Arje is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 07-29-2020 , 14:07   Re: func_door help
Reply With Quote #6

Hm you could do a entity_valid check and remove it before the return FMRES_SUPERCEDE,
so there is no entity colliding with the door.

Sorry, I can't atm do tests by my self.
__________________
Retired.
Xalus is offline
Reply


Thread Tools
Display Modes

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 19:42.


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