AMXX-BG.INFO lj_const.inc Raw include

lj_const.inc

Original include source with line numbers.

Back Download .inc
1 /* Sublime AMXX Editor v3.0.0-beta */
2
3 #if defined _lj_const_included
4 #endinput
5 #endif
6 #define _lj_const_included
7
8 /* Load custom module ?
9
10 #pragma reqlib LIBRARY_NAME
11 #if !defined AMXMODX_NOAUTOLOAD
12 #pragma loadlib LIBRARY_NAME
13 #endif
14
15 */
16
17 new const LJ_VERSION[] = "1.0.1"
18
19 new const g_szChatPrefix[] = "^4[LJ Training]^3"
20
21 native lj_get_user_level(id)
22
23 native get_user_boost(id)
24 native set_user_boost(id, bool:IsBoost)
25
26 native give_costumes(id)
27
28 native is_user_spec_list(id)
29 native is_user_spec_hide(id)
30 native set_user_spec_list(id, bool:bSpecList)
31 native set_user_spec_hide(id, bool:bSpecHide)
32
33 native is_user_show_keys(id)
34 native set_user_show_keys(id, bool:bShowKeys)
35
36 native is_user_stucked(id)
37 native set_user_unstuck(id)
38
39 new const g_szVIP_Players[][] =
40 {
41 "Huehue", "mandiX", "chop"
42 }
43
44 enum _:eWeaponsData
45 {
46 WeaponId[32],
47 WeaponName[32],
48 WeaponSpeed[32]
49 }
50
51 new const g_szWeapons[][eWeaponsData] =
52 {
53 { "", "All Weapons", "^n \rSpeed" },
54 { "weapon_scout", "Scout", " \d[\y260\d]" },
55 { "weapon_flashbang", "Flashbang", " \d[\yNormal\d]" },
56 { "weapon_awp", "AWP", " \d[\y210\d]" },
57 { "weapon_m4a1", "M4A1", " \d[\y230\d]" },
58 { "weapon_p90", "P90", " \d[\y245\d]" },
59 { "weapon_famas", "Famas", " \d[\y240\d]" },
60 { "weapon_ak47", "AK-47", " \d[\y221\d]" },
61 { "weapon_m249", "M249 \d(Para)", " \d[\y220\d]" },
62 }
63
64 enum eKnifeItems
65 {
66 HANDS = 0,
67 KUNAI,
68 MOON,
69 OWL,
70 RULER,
71 WINDFAN,
72 TRON,
73 DEFAULT_KNIFE
74 }
75
76 enum _:eKnifeData
77 {
78 KnifePath[128],
79 KnifeName[64],
80 KnifeLevel
81 }
82
83 new const g_szKnifeModels[][eKnifeData] =
84 {
85 { "models/lj_knives/v_hands.mdl", "Bare Hands", 1 },
86 { "models/lj_knives/v_kunai.mdl", "Kunai", 5 },
87 { "models/lj_knives/v_moon.mdl", "Moon Knight", 8 },
88 { "models/lj_knives/v_owl.mdl", "Owl", 12 },
89 { "models/lj_knives/v_ruler.mdl", "Ruler", 15 },
90 { "models/lj_knives/v_windfan.mdl", "Wind Fan", 20 },
91 { "models/lj_knives/v_tron.mdl", "Tron", 25 },
92 { "models/v_knife.mdl", "Default Knife", 0 }
93 }
94
95 enum eModelItems
96 {
97 BELKAGIRL = 0,
98 JOKER,
99 MASK,
100 SURVIVOR,
101 VECTOR,
102 DEFAULT_PLAYER
103 }
104
105 enum _:eModelsData
106 {
107 PlayerModel_Path[64],
108 PlayerModel_Name[64],
109 PlayerModel_Level
110 }
111
112 new const g_szPlayerModels[][eModelsData] =
113 {
114 { "lj_belka", "Belka Girl", 4 },
115 { "lj_joker", "Joker", 7 },
116 { "lj_mask", "Mask", 13 },
117 { "lj_survivor", "Survivor", 20 },
118 { "lj_vector", "Vector", 25 },
119 { "lj_default", "Default Model \d[\yRan\rdom \yCo\rlor\d]^n", 0 },
120 }
121
122 new g_iLJ_TrainingMenu;
123
124 enum _:ePlayerData
125 {
126 bool:GodMode,
127 bool:NoClip,
128 Knife,
129 Player_Model,
130 bool:Camera,
131 bool:CameraSolid,
132 bool:KnifeHidden,
133 bool:JumpTrail,
134 bool:HudInfo,
135 CustomChannel
136 }
137
138 new g_iPlayerData[MAX_CLIENTS + 1][ePlayerData]
139
140 enum _:ePlayerGC
141 {
142 CheckPoint,
143 CPs,
144 GCs,
145 CheckPointPos[XYZ],
146 CheckPointAngle[XYZ],
147 LastCheckPointPos[XYZ],
148 LastCheckPointAngle[XYZ]
149 }
150
151 new g_iPlayerGC[MAX_CLIENTS + 1][ePlayerGC]
152
153 const TASKID_TRAIL = 100
154 new Float:g_flTrailTime[MAX_CLIENTS + 1], g_pSpriteTrail
155
156 new const g_szCheckPointCmds[][] = { "say /cp", "say /checkpoint", "/cp", "cp" }
157 new const g_szGoCheckCmds[][] = { "say /gc", "say /gocheck", "/gc", "gc" }
158
159 new g_iSyncObject
160
161 Base_Commands_Init()
162 {
163 register_clcmd("chooseteam", "Toggle_TrainingMenu")
164 register_clcmd("say /menu", "Toggle_TrainingMenu")
165 register_clcmd("say /training", "Toggle_TrainingMenu")
166
167 register_concmd("Custom_Channel", "Channel_TypeIn")
168
169 register_clcmd("buy", "@Block_BuyCMD")
170 register_clcmd("buyammo1", "@Block_BuyCMD")
171 register_clcmd("buyammo2", "@Block_BuyCMD")
172 register_clcmd("autobuy", "@Block_BuyCMD")
173 register_clcmd("drop", "@Block_BuyCMD")
174
175 static i
176
177 for (i = 0; i < sizeof g_szCheckPointCmds; i++)
178 register_clcmd(g_szCheckPointCmds[i], "Toggle_CheckPoint")
179
180 for (i = 0; i < sizeof g_szGoCheckCmds; i++)
181 register_clcmd(g_szGoCheckCmds[i], "Toggle_GoCheckPoint")
182 }
183
184 ReAPI_Init()
185 {
186 RegisterHookChain(RG_CBasePlayer_Spawn, "CBasePlayer_Spawn", true)
187 RegisterHookChain(RG_CBasePlayerWeapon_DefaultDeploy, "CBasePlayerWeapon_DefaultDeploy", false)
188 //RegisterHookChain(RG_PlayerBlind, "PlayerBlind", false)
189
190 RegisterHookChain(RG_CBasePlayer_Jump, "CBasePlayer_Jump", true)
191
192 RegisterHookChain(RG_CBasePlayer_HintMessageEx, "CBasePlayer_HintMessageEx") // Hint_you_are_the_vip
193
194 rg_map_buy_status(true)
195 }
196
197 Fakemeta_Init()
198 {
199 register_forward(FM_AddToFullPack, "Camera_AddToFullPack", 1)
200 register_forward(FM_AddToFullPack, "Channel_AddToFullPack", 0)
201 }
202
203 Engine_Init()
204 {
205 g_iSyncObject = CreateHudSyncObj()
206
207 new iEnt = create_entity("info_target")
208
209 if(iEnt)
210 {
211 entity_set_string(iEnt, EV_SZ_classname, "ThinkEntity")
212 entity_set_float(iEnt, EV_FL_nextthink, get_gametime() + 1.0)
213
214 register_think("ThinkEntity", "Information_Hud")
215 }
216 }
217
218 Menu_Create_Init()
219 {
220 g_iLJ_TrainingMenu = register_menuid("Training Menu");
221 register_menucmd(g_iLJ_TrainingMenu, 1023, "handleTrainingMenu");
222 }
223
224 Precache_Resources()
225 {
226 precache_model("models/rpgrocket.mdl")
227
228 g_pSpriteTrail = precache_model("sprites/zbeam5.spr");
229
230 static i
231
232 for (i = 0; i < sizeof g_szKnifeModels; i++)
233 precache_model(g_szKnifeModels[i][KnifePath])
234
235 for (i = 0; i < sizeof g_szPlayerModels; i++)
236 try_precache_player_model(g_szPlayerModels[i][PlayerModel_Path])
237 }
238
239 Configurate_Cvars()
240 {
241 set_cvar_num("mp_item_staytime", 0)
242 set_cvar_num("mp_round_infinite", 1)
243 set_cvar_num("mp_auto_join_team", 1)
244 set_cvar_string("humans_join_team", "CT")
245 set_cvar_float("mp_forcerespawn", 0.1)
246 }
247
248 @CBasePlayer_MakeVIP(id)
249 {
250 for (new i = 0; i < sizeof g_szVIP_Players; i++)
251 {
252 if (equal(fmt("%n", id), g_szVIP_Players[i]))
253 {
254 // Set the m_bIsVIP to true & respawn player to show DirectHUD Message
255 set_member(id, m_bIsVIP, true)
256 rg_round_respawn(id)
257
258 // Update the ScoreBoard Information
259 message_begin(MSG_ALL, get_user_msgid("ScoreAttrib"))
260 write_byte(id)
261 write_byte(4)
262 message_end()
263
264 // Then set the m_bIsVIP to false bcuz VIPs can't use Weapons!
265 set_member(id, m_bIsVIP, false)
266
267 if (is_user_alive(id))
268 {
269 set_task(1.0, "Vip_Infomation_Start", id)
270 set_task(7.0, "Vip_Infomation_Stop", id)
271 }
272 }
273 }
274 }
275
276 @Block_BuyCMD(id)
277 {
278 return PLUGIN_HANDLED
279 }