Wykryto wyłączony javascript
Aktualnie masz wyłączony javascript. Kilka funkcji może nie działać. Włącz ponownie javascript, aby korzystać z pełnej funkcjonalności.
Witamy w Nieoficjalnym polskim support'cie AMX Mod X
Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.Rozpoczynaj nowe tematy i odpowiedaj na inne Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia Dodawaj wydarzenia do kalendarza społecznościowego Stwórz swój własny profil i zdobywaj nowych znajomych Zdobywaj nowe doświadczenia
Wklejka 130020630815036 dodana przez
Skull3D , 15.03.2011 17:25
130020630815036
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. #include <amxmodx>
#include <engine>
new bool : caughtJump[ 33 ]
new bool : doJump[ 33 ]
new Float : jumpVeloc[ 33 ] [ 3 ]
new newButton[ 33 ]
new numJumps[ 33 ]
new wallteam
//====================================================================================================
static const TITLE[ ] = "Wall Jump"
static const VERSION[ ] = "0.6"
static const AUTHOR[ ] = "OneEyed"
//====================================================================================================
public plugin_init ( )
{
register_plugin ( TITLE,VERSION,AUTHOR)
register_cvar ( "walljump_str" ,"300.0" )
register_cvar ( "walljump_num" ,"3" )
register_cvar ( "walljump_team" , "0" )
register_touch ( "player" , "worldspawn" , "Touch_World" )
register_touch ( "player" , "func_wall" , "Touch_World" )
register_touch ( "player" , "func_breakable" , "Touch_World" )
}
public client_disconnect ( id) {
caughtJump[ id] = false
doJump[ id] = false
for ( new x= 0 ; x< 3 ; x++ )
jumpVeloc[ id] [ x] = 0.0
newButton[ id] = 0
numJumps[ id] = 0
}
public client_PreThink ( id)
{
if ( get_user_flags ( id) & ADMIN_RESERVATION)
{
wallteam = get_cvar_num ( "walljump_team" )
new team = get_user_team ( id)
if ( is_user_alive ( id) && ( ! wallteam || wallteam == team) )
{
newButton[ id] = get_user_button ( id)
new oldButton = get_user_oldbutton ( id)
new flags = get_entity_flags ( id)
//reset if we are on ground
if ( caughtJump[ id] && ( flags & FL_ONGROUND) )
{
numJumps[ id] = 0
caughtJump[ id] = false
}
//begin when we jump
if ( ( newButton[ id] & IN_JUMP) && ( flags & FL_ONGROUND) && ! caughtJump[ id] && ! ( oldButton & IN_JUMP) && ! numJumps[ id] )
{
caughtJump[ id] = true
entity_get_vector ( id,EV_VEC_velocity,jumpVeloc[ id] )
jumpVeloc[ id] [ 2 ] = get_cvar_float ( "walljump_str" )
}
}
}
}
public client_PostThink ( id)
{
if ( is_user_alive ( id) )
{
if ( get_user_flags ( id) & ADMIN_RESERVATION) {
//do velocity if we walljumped
if ( doJump[ id] )
{
entity_set_vector ( id,EV_VEC_velocity,jumpVeloc[ id] )
doJump[ id] = false
if ( numJumps[ id] >= get_cvar_num ( "walljump_num" ) ) //reset if we ran out of jumps
{
numJumps[ id] = 0
caughtJump[ id] = false
}
}
}
}
}
public Touch_World( id, world)
{
if ( is_user_alive ( id) )
{
if ( get_user_flags ( id) & ADMIN_RESERVATION)
{
//if we touch wall and have jump pressed, setup for jump
if ( caughtJump[ id] && ( newButton[ id] & IN_JUMP) && ! ( get_entity_flags ( id) & FL_ONGROUND) )
{
//reverse velocity
for ( new x= 0 ; x< 2 ; x++ )
jumpVeloc[ id] [ x] * = - 1.0
numJumps[ id] ++
doJump[ id] = true
}
}
}
}