Skip to content

Commit b4791e5

Browse files
author
Gam3ronE
committed
Zombie Plague 5.0.8
1 parent 69fff13 commit b4791e5

File tree

5 files changed

+83
-0
lines changed

5 files changed

+83
-0
lines changed

plugin/addons/amxmodx/configs/plugins-zp.ini

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ zp50_item_antidote.amxx
6767
zp50_item_zombie_madness.amxx
6868
zp50_item_infection_bomb.amxx
6969
zp50_item_unlimited_clip.amxx
70+
zp50_item_multi-jump.amxx
7071

7172
; Admin
7273

Binary file not shown.

plugin/addons/amxmodx/scripting/compile.dat

+2
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,5 @@ Age=1152647539
160160
Age=1152743864
161161
[zp50_addon_no_engine_knockback.sma]
162162
Age=1152743908
163+
[zp50_item_multi-jump.sma]
164+
Age=1152747045
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#include <amxmodx>
2+
#include <amxmisc>
3+
#include <engine>
4+
#include <hamsandwich>
5+
6+
#include <zp50_core>
7+
#include <zp50_items>
8+
#include <zp50_class_nemesis>
9+
#include <zp50_class_survivor>
10+
11+
12+
#define PLUGIN "[ZP] Item: Multi-Jump"
13+
#define VERSION "1.0"
14+
#define AUTHOR "Xalus"
15+
16+
// Global Variables
17+
new zpItem
18+
19+
new zpMultiJump[33]
20+
new bool:plJump[33], plJumps[33]
21+
22+
public plugin_init() {
23+
register_plugin(PLUGIN, VERSION, AUTHOR)
24+
25+
// Register: Extra item
26+
zpItem = zp_items_register("Multi-Jump", 8)
27+
28+
RegisterHam(Ham_Spawn, "player", "Ham_PlayerSpawn", 1);
29+
}
30+
31+
public zp_fw_items_select_pre(id, itemid) {
32+
if(itemid == zpItem) {
33+
if( zp_class_survivor_get(id) || zp_class_nemesis_get(id))
34+
return ZP_ITEM_DONT_SHOW
35+
}
36+
return ZP_ITEM_AVAILABLE;
37+
}
38+
39+
public zp_fw_core_infect_post(id, attacker)
40+
zpMultiJump[id] = 0
41+
42+
public zp_fw_items_select_post(player, itemid) {
43+
if(itemid == zpItem) {
44+
zpMultiJump[player]++
45+
client_print(player, print_center, "Now you can jump %i time(s) in mid-air.", zpMultiJump[player]);
46+
}
47+
}
48+
49+
public Ham_PlayerSpawn(id)
50+
if(is_user_alive(id))
51+
zpMultiJump[id] = 0
52+
53+
public client_PreThink(id) {
54+
if(!is_user_alive(id) || !zpMultiJump[id])
55+
return
56+
57+
new plButton[2]
58+
plButton[0] = get_user_button(id)
59+
plButton[1] = get_user_oldbutton(id)
60+
61+
if( (plButton[0] & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(plButton[1] & IN_JUMP)) {
62+
if(plJumps[id] < zpMultiJump[id]) {
63+
plJump[id] = true
64+
plJumps[id]++
65+
}
66+
}
67+
else if((plButton[0] & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
68+
plJumps[id] = 0
69+
}
70+
71+
public client_PostThink(id) {
72+
if(!is_user_alive(id) || !plJump[id] || !zpMultiJump[id])
73+
return
74+
75+
new Float:velocity[3]
76+
entity_get_vector(id,EV_VEC_velocity,velocity)
77+
velocity[2] = random_float(265.0,285.0)
78+
entity_set_vector(id,EV_VEC_velocity,velocity)
79+
plJump[id] = false
80+
}

0 commit comments

Comments
 (0)