Counter-Strike 1.6 Icon CS1.6 Script

[AMXX] [ALL] Walk through walls ADVANCED

Greetings! We are one of the oldest mod sites on the Interwebs. Sign up and maximize your browsing experience.

  • Subscribe: Get notified of new submissions like this.
  • Say Thanks: Show your appreciation by sending Rj. points.
  • Post: Give Rj. your thoughts on this Script.
  • Vote: Help Rj. win the Monthly Awards.
  • Rate: Give this Script a rating out of 10.
  • Flag: Alert moderators and warn members of a problem with this Script.
  • Watch: Get notified when this Script is updated.
Mascot

Join the community!

Become a Bananite

Already a Bananite? Login

130 lines | 4 kb | Raw Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>
#include <xs>

#define PLUGIN "Walk through walls"
#define VERSION "1.1"
#define AUTHOR "Xalus"

new Float:g_flDelay[33];
new g_cvarDistance, g_cvarFalldistance, g_cvarButton, g_cvarDelay, g_cvarMessages;

public plugin_init()
{
        register_plugin(PLUGIN, VERSION, AUTHOR);
       
        // Register: Cvar
        g_cvarDistance           = register_cvar("wtw_distance", "60");         // Maximum wall width wich player can go through.
        g_cvarFalldistance       = register_cvar("wtw_fall_distance", "150");   // Maximum Fall distance behind the wall. (So you don't end up dead).
        g_cvarButton             = register_cvar("wtw_button", "0");            // Button (USE) needed to go through walls (1) or automatically (0)
        g_cvarDelay              = register_cvar("wtw_delay", "0.7");           // Delay after going through a wall, to go through the next one.
        g_cvarMessages           = register_cvar("wtw_message", "0");           // Show a message to player if walking trough wall failed.
       
        // Register: Touch
        register_touch("worldspawn","player","Touch_Wall");
        register_touch("func_brush","player","Touch_Wall");
        register_touch("func_breakable","player","Touch_Wall");
       
       
}
public Touch_Wall(entity, id)
{
        if(is_user_alive(id))
        {
                if(g_flDelay[id] < get_gametime())
                {
                        new intCvarButton;
                        intCvarButton = get_pcvar_num(g_cvarButton);
                       
                        if(!intCvarButton || (intCvarButton && pev(id, pev_button) & IN_USE))
                        {
                                set_player_behindwall(id);
                        }
                }
        }
}

set_player_behindwall(id)
{
        new Float:flOrigin[4][3], Float:flAngle[3]
       
        pev(id, pev_origin, flOrigin[0])
        pev(id, pev_v_angle, flAngle)
       
        flAngle[0] = -10.0
       
        origin_infront(flAngle, flOrigin[0], (get_pcvar_float(g_cvarDistance) + 40.0), flOrigin[1]);

        new iTraceHandle = create_tr2();
        engfunc(EngFunc_TraceLine, flOrigin[0], flOrigin[1], DONT_IGNORE_MONSTERS, id, iTraceHandle);
       
        get_tr2(iTraceHandle, TR_vecEndPos, flOrigin[2]);
       
        if(get_distance_f(flOrigin[0], flOrigin[2]) > 17.0)
        {
                free_tr2(iTraceHandle);
                return 0;
        }
       
       
        g_flDelay[id] = (get_gametime() + get_pcvar_float(g_cvarDelay));
       
       
        engfunc(EngFunc_TraceLine, flOrigin[1], flOrigin[0], DONT_IGNORE_MONSTERS, id, iTraceHandle);
       
        get_tr2(iTraceHandle, TR_vecEndPos, flOrigin[3]);
       
        origin_infront(flAngle, flOrigin[3], 16.55, flOrigin[3]);
       
        if(is_hull_vacant(flOrigin[3], pev(id, pev_flags) & FL_DUCKING ? HULL_HEAD : HULL_HUMAN))
        {      
                xs_vec_copy(flOrigin[3], flOrigin[1]);
                flOrigin[1][2] -= 1000.0;
               
                engfunc(EngFunc_TraceLine, flOrigin[3], flOrigin[1], IGNORE_MONSTERS, id, iTraceHandle);
                get_tr2(iTraceHandle, TR_vecEndPos, flOrigin[1]);
               
                if(get_distance_f(flOrigin[3], flOrigin[1]) > get_pcvar_float(g_cvarFalldistance))
                {
                        if(get_pcvar_num(g_cvarMessages))
                        {
                                client_print(id, print_center, "Walking through wall failed, no solid ground behind wall.");
                        }
                       
                        free_tr2(iTraceHandle);
                        return 0;
                }
               
                engfunc(EngFunc_SetOrigin, id, flOrigin[3]);
        }
        else if(get_pcvar_num(g_cvarMessages))
        {
                client_print(id, print_center, "Walking through wall failed, wall too big.");
        }
       
        free_tr2(iTraceHandle);
       
        return 1;
}

origin_infront( Float:vAngles[3], Float:vecOrigin[ 3 ], Float:flDistance, Float:vecOutput[ 3 ] ) // By Exolent
{
        new Float:vecAngles[3];
        xs_vec_copy(vAngles, vecAngles);
       
        engfunc(EngFunc_MakeVectors, vecAngles);
        global_get(glb_v_forward, vecAngles);
       
        xs_vec_mul_scalar(vecAngles, flDistance, vecAngles);
       
        xs_vec_add(vecOrigin, vecAngles, vecOutput);
}
bool:is_hull_vacant(const Float:origin[3], hull)
{
        new tr;
        engfunc(EngFunc_TraceHull, origin, origin, IGNORE_MONSTERS, hull, 0, tr);
       
        return bool:(!get_tr2(tr, TR_StartSolid) && !get_tr2(tr, TR_AllSolid) && get_tr2(tr, TR_InOpen))
}

WALK THROUGH WALLS ADVANCED (V1.1)

A plugin that allows you to walk throught walls.
Changelog 
  • Optimized code
  • New features (Hold button, ...)
  • Extra cvars

Cvars
  • wtw_distance 60 - Maximum wall width which player can go trough.
  • wtw_fall_distance 150 - Maximum Fall distance behind the wall. (So you don't end up dead).
  • wtw_button 0 - Button (USE) needed to go through walls (1) or automatically (0)
  • wtw_delay 0.7 - Delay after going through a wall, to go through the next one.
  • wtw_message 0 - Show a message to player if walking through wall failed.

Comments

None found

Share

Shareable Image:
Share banner
HTML embed code:
BB embed code:
Markdown embed code:

More embeddable images

Bookmark and Share

Credits

Original Authors
Xalus
AMXX Coder/Script

Submitter

Rj. avatar
Rj. IN PLAYGROUND
Homepage
Member Joined 9 months ago
34 medals 4 legendary 8 rare
  • Submitted 15 Tools Medal icon
  • Submitted 50 Gamefiles Medal icon
  • 15+ Entries! GameBanana’s Christmas Giveaway 2016 Medal icon
  • Thanked 500 submitters Medal icon
  • 2nd Place - Game Poetry Contest Medal icon
  • Submitted 5 Tools Medal icon

Rj.
Redistributor
Are you the owner? Request Ownership
Send a Private Message to the submitter

Category

Stats

Posts
0
Views
297
Date Added
1 month ago
Feb 20 2017 @ 1:26am UTC
Date Modified
1 month ago
Feb 20 2017 @ 1:28am UTC
Date Updated
1 month ago
Feb 20 2017 @ 1:26am UTC