Raised This Month: $ Target: $400
 0% 

[TESTING] No Wall Bullets


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 06-26-2006 , 23:23   [TESTING] No Wall Bullets
Reply With Quote #1

Made this plugin so that you can restrict people from shooting through walls. simply set mp_wallshots to 0 (default) and people SHOULDNT be able to shoot through walls. Needs testing which is why it is here. Please get back to me on this.
Attached Files
File Type: sma Get Plugin or Get Source (No_Wall_Shots.sma - 745 views - 1.3 KB)
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 06-26-2006 , 23:31   Re: [TESTING] No Wall Bullets
Reply With Quote #2

I think this is a better and easier way. Credits goes to VEN

Code:
public FW_TraceLine(Float:v1[3], Float:v2[3], noMonsters, id)
{  
    if(!is_user_connected(id) || !is_user_alive(id))
        return FMRES_IGNORED
    
    new victim = get_tr(TR_pHit)
    if(!is_user_connected(victim) || !is_user_alive(victim))
        return FMRES_IGNORED

    if(!fm_is_ent_visible(id, victim)) {
        set_tr(TR_flFraction, 1.0)
    }
    return FMRES_IGNORED
}

stock bool:fm_is_ent_visible(index, entity) 
{
    new Float:origin[3], Float:view_ofs[3], Float:eyespos[3]
    pev(index, pev_origin, origin)
    pev(index, pev_view_ofs, view_ofs)
    xs_vec_add(origin, view_ofs, eyespos)

    new Float:entpos[3]
    pev(entity, pev_origin, entpos)
    engfunc(EngFunc_TraceLine, eyespos, entpos, 0, index)

    switch (pev(entity, pev_solid)) {
        case SOLID_BBOX..SOLID_BSP: return global_get(glb_trace_ent) == entity
    }

    new Float:fraction
    global_get(glb_trace_fraction, fraction)
    if (fraction == 1.0)
        return true

    return false
}
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
allenwr
Veteran Member
Join Date: Jan 2006
Location: The place where the karm
Old 06-26-2006 , 23:44   Re: [TESTING] No Wall Bullets
Reply With Quote #3

I had this idea a while ago, back before i knew anything about scripting...

Good Job on making it
__________________
Don't ever place an order with Vee Servers. This is why.
allenwr is offline
Send a message via ICQ to allenwr Send a message via Yahoo to allenwr
VEN
Veteran Member
Join Date: Jan 2005
Old 06-27-2006 , 12:34   Re: [TESTING] No Wall Bullets
Reply With Quote #4

PHP Code:
register_event("Damage","Damage","3=DMG_BULLET"
Will not work at least for 2 reasons:

1. Macros is igoned by precompiler if it's inside a string, so you have to convert intiger constant to a string or hardcode it.

2. Flag isn't specified (event type: global/specified).
VEN 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 08:04.


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