-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathZFile_Menu.sma
More file actions
150 lines (136 loc) · 3.95 KB
/
ZFile_Menu.sma
File metadata and controls
150 lines (136 loc) · 3.95 KB
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <fakemeta_util>
#include <engine>
#include <hamsandwich>
#include <xs>
#include <fun>
#include <cstrike>
#define pragma compress 1
#define PLUGIN "Zombie File Menu"
#define VERSION "1.0"
#define AUTHOR "Mellowzy"
#define CANT_RELOAD_BITSUM ((1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW_C4))
new max_ammo[30] = {13,0,10,0,7,0,30,30,0,30,20,25,30,35,25,12,20,10,30,100,8,30,30,20,0,7,30,30,0,50}
new bool:unli[256]
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_forward(FM_PlayerPreThink,"hook_prethink")
register_clcmd("chooseteam", "ShowZombie_File")
}
public client_connect(id)
{
server_cmd("bind m chooseteam")
}
public client_disconnected(id)
{
server_cmd("bind m chooseteam")
}
public plugin_precache(){
#define MAP "standalone_alpha"
static MapName[64]; get_mapname(MapName, sizeof(MapName))
if(!equal(MapName, MAP))
{
set_fail_state("[ZFILE]: You must play in %s", MAP)
return
} else {
server_cmd("mp_timelimit 9999")
}
}
public ShowZombie_File(id) {
if(get_user_flags(id) & ADMIN_RCON)
{
new szmenu[1000]
formatex(szmenu, 300, "\r[Zombie File] \wFirst Report \wBETA by Mellowzy")
new menu = menu_create(szmenu,"_menu_zfile")
formatex(szmenu, 63, "\r[EVENT] \wRound Start^n")
menu_additem(menu, szmenu,"1",0)
formatex(szmenu, 63, "\r[CHEAT] \wAdd HP^n")
menu_additem(menu, szmenu,"2",0)
formatex(szmenu, 63, "\r[CHEAT] \wLast Checkpoint^n")
menu_additem(menu, szmenu,"3",0)
formatex(szmenu, 63, "\r[CHEAT] \wUnlimited Ammo^n")
menu_additem(menu, szmenu,"4",0)
formatex(szmenu, 63, "\r[GAME] \wDisconnect^n")
menu_additem(menu, szmenu,"5",0)
menu_setprop(menu, MPROP_EXITNAME, "Exit Menu")
menu_display(id, menu, 0)
}
return PLUGIN_HANDLED
}
public _menu_zfile(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
new data[6], iName[64]
new access, callback
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
new key = str_to_num(data)
switch(key)
{
case 1:
{
server_cmd("sv_restartround 1")
client_print(id, print_center, "Round Has Begin")
}
case 2:
{
set_user_health(id, get_user_health(id) + 99999)
}
case 3:
{
new Float:Origin[3]
entity_get_vector(id, EV_VEC_origin, Origin)
Origin[0] = -1599.0
Origin[1] = 16.0
Origin[2] = -2180.0
entity_set_origin(id, Origin)
server_cmd("obj2")
give_item(id, "weapon_m249")
new Weapon = fm_get_user_weapon_entity(id, CSW_M249)
if(!pev_valid(Weapon)) return PLUGIN_CONTINUE
set_pdata_int(Weapon, 51, 100, 4)
cs_set_user_bpammo(id, CSW_M249, 200)
}
case 4:
{
client_print(id, print_center, "Unlimited Ammo Active")
Unlimitedammo(id)
unli[id] = true
}
case 5:
{
server_cmd("disconnect")
}
}
menu_destroy(menu)
return PLUGIN_HANDLED
}
public Unlimitedammo(id)
{
if(!is_user_alive(id) || CANT_RELOAD_BITSUM & (1<<read_data(2)) || read_data(3) > 1){
return PLUGIN_CONTINUE
}
set_pdata_int(get_pdata_cbase(id,373), 51, 100, 4)
new wpnid = get_user_weapon(id)
if(wpnid != CSW_C4 || wpnid != CSW_SMOKEGRENADE || wpnid != CSW_KNIFE || wpnid != CSW_HEGRENADE || wpnid != CSW_FLASHBANG){
new wpnent = fm_get_user_weapon_entity(id)
cs_set_weapon_ammo(wpnent, max_ammo[wpnid - 1])
}
return PLUGIN_HANDLED
}
public hook_prethink(id) {
if(is_user_alive(id) && unli[id]) {
new weapon_id = get_user_weapon(id)
if(weapon_id != CSW_C4 && weapon_id != CSW_KNIFE && weapon_id != CSW_HEGRENADE && weapon_id != CSW_FLASHBANG && weapon_id != CSW_SMOKEGRENADE) {
new weapon = fm_get_user_weapon_entity(id)
cs_set_weapon_ammo(weapon,max_ammo[weapon_id - 1])
}
}
return FMRES_HANDLED
}