· 8 years ago · Aug 06, 2018, 08:50 PM
1#include <sourcemod>
2#include <sdktools>
3#include <sdkhooks>
4#include <clientprefs>
5#include <cstrike>
6
7#include "new_features/globals.sp"
8
9native IsClientVIP(int iId);
10
11enum StatTrakOption:
12{
13 StatTrakOption_None = 0,
14
15 StatTrakOption_Disabled,
16 StatTrakOption_Enabled
17};
18
19enum Knife:
20{
21 Knife_None = -1,
22 Knife_Default = 0,
23
24 Knife_Karambit,
25 Knife_Butterfly,
26 Knife_M9,
27 Knife_Bayonet,
28 Knife_Tactical,
29 Knife_Push,
30 Knife_Falchion,
31 Knife_Gut,
32 Knife_Flip,
33 Knife_Bowie
34};
35
36enum KnifeSkin:
37{
38 Knife_Skin_None = -2,
39 Knife_Skin_Random = -1,
40 Knife_Skin_Default = 0,
41
42 Knife_Skin_Fade = 38,
43 Knife_Skin_Webs = 12,
44 Knife_Skin_WebsDarker = 232,
45 Knife_Skin_Purple = 98,
46 Knife_Skin_Oiled = 44,
47 Knife_Skin_DDPat = 5,
48 Knife_Skin_Night = 40,
49 Knife_Skin_MarbleFade = 413,
50 Knife_Skin_ForestBoreal = 77,
51 Knife_Skin_DopplerPhase1 = 418,
52 Knife_Skin_DopplerPhase2 = 419,
53 Knife_Skin_DopplerPhase3 = 420,
54 Knife_Skin_DopplerPhase4 = 421,
55 Knife_Skin_Slaughter = 59,
56 Knife_Skin_Blued = 42,
57 Knife_Skin_TigerOrange = 409,
58 Knife_Skin_Damascus = 410,
59 Knife_Skin_DopplerRuby = 415,
60 Knife_Skin_DopplerSapphire = 416,
61 Knife_Skin_DopplerBlackpearl = 417,
62 Knife_Skin_Damascus90 = 411,
63 Knife_Skin_Stained = 43,
64 Knife_Skin_SafariMesh = 72,
65 Knife_Skin_UrbanMasked = 143,
66 Knife_Skin_Scorched = 175,
67 Knife_Skin_RustCoat = 414,
68 Knife_Skin_Bayonet_Lore = 558,
69 Knife_Skin_Flip_Lore = 559,
70 Knife_Skin_Gut_Lore = 560,
71 Knife_Skin_Karambit_Lore = 561,
72 Knife_Skin_M9_Bayonet_Lore = 562,
73 Knife_Skin_Bayonet_BLaminate = 563,
74 Knife_Skin_Flip_BLaminate = 564,
75 Knife_Skin_Gut_BLaminate = 565,
76 Knife_Skin_Karambit_BLaminate = 566,
77 Knife_Skin_M9_Bayonet_BLaminate = 567,
78 Knife_Skin_EmeraldMarbleized = 568,
79 Knife_Skin_GDoppler_P1 = 569,
80 Knife_Skin_GDoppler_P2 = 570,
81 Knife_Skin_GDoppler_P3 = 571,
82 Knife_Skin_GDoppler_P4 = 572,
83 Knife_Skin_Bayonet_Auto = 573,
84 Knife_Skin_Flip_Auto = 574,
85 Knife_Skin_Gut_Auto = 575,
86 Knife_Skin_Karambit_Auto = 576,
87 Knife_Skin_M9_Bayonet_Auto = 577,
88 Knife_Skin_BrightWater = 578,
89 Knife_Skin_BrightWater_M9 = 579,
90 Knife_Skin_FreeHand = 580,
91 Knife_Skin_FreeHand_M9 = 581,
92 Knife_Skin_FreeHand_Karambit = 582
93};
94
95Handle g_pDatabase = INVALID_HANDLE;
96
97Handle g_pKnifeCookie = INVALID_HANDLE;
98Handle g_pStatTrakOptionCookie = INVALID_HANDLE;
99Handle g_pKnifeSkinCookie = INVALID_HANDLE;
100
101int g_Skins[MAXPLAYERS + 1][PLATFORM_MAX_PATH * 3];
102int g_ItemDefinitionIndex[MAXPLAYERS + 1] = { 0, ... };
103int g_Kills[MAXPLAYERS + 1] = { 0, ... };
104int g_SpawnTime[MAXPLAYERS + 1] = { 0, ... };
105
106char g_Steam[MAXPLAYERS + 1][MAX_NAME_LENGTH];
107
108bool g_bIsInGame[MAXPLAYERS + 1] = { false, ... };
109bool g_bMessageShown[MAXPLAYERS + 1] = { false, ... };
110
111KnifeSkin g_pKnifeSkin[MAXPLAYERS + 1] = { Knife_Skin_None, ... };
112Knife g_pKnife[MAXPLAYERS + 1] = { Knife_None, ... };
113StatTrakOption g_pStatTrakOption[MAXPLAYERS + 1] = { StatTrakOption_None, ... };
114Handle g_pWear = INVALID_HANDLE;
115Handle g_pNTCookies[PLATFORM_MAX_PATH * 3] = { INVALID_HANDLE, ... };
116
117char g_Buffer[PLATFORM_MAX_PATH * 16];
118
119int g_iFakeClient = INVALID_ENT_REFERENCE;
120
121bool g_bIsInRound = false;
122
123float g_fDelay = 0.0;
124int g_Offset = 0;
125
126int Find(char[] szProp)
127{
128 static int iIter = 0, iInfo = 0;
129
130 static char pClasses[][] =
131 {
132 "Player", "CSPlayer", "CCSPlayer", "GameResource", "GameResources",
133 "CGameResource", "CGameResources", "CSGameResource", "CSGameResources",
134 "CCSGameResource", "CCSGameResources", "BasePlayer", "CBasePlayer",
135 "BaseEntity", "CBaseEntity", "BaseWeapon", "CBaseWeapon", "BaseGrenade",
136 "CBaseGrenade", "BaseCombatWeapon", "CBaseCombatWeapon", "WeaponCSBase",
137 "CWeaponCSBase", "CSWeaponCSBase", "CCSWeaponCSBase", "PlayerResource",
138 "CPlayerResource", "CSPlayerResource", "CCSPlayerResource", "PlayerResources",
139 "CPlayerResources", "CSPlayerResources", "CCSPlayerResources", "BaseAnimating",
140 "CBaseAnimating", "BaseCombatCharacter", "CBaseCombatCharacter",
141 "BaseMultiplayerPlayer", "CBaseMultiplayerPlayer", "BaseFlex", "CBaseFlex"
142 };
143
144 for (iIter = 0; iIter < sizeof(pClasses); iIter++)
145 {
146 if ((iInfo = FindSendPropInfo(pClasses[iIter], szProp)) > 0)
147 return iInfo;
148 }
149
150 return 0;
151}
152
153void xSaveUserNameTagForWeapon(int iUser, int iWeapon, char[] szNameTag)
154{
155 static char szName[MAX_NAME_LENGTH] = "";
156 static char szInfo[PLATFORM_MAX_PATH] = "";
157
158 if (g_pNTCookies[iWeapon] == INVALID_HANDLE)
159 {
160 FormatEx(szName, sizeof(szName), "m_szCustomName@%04d", iWeapon);
161 FormatEx(szInfo, sizeof(szInfo), "Custom Name For Weapon Having m_iItemDefinitionIndex %d", iWeapon);
162
163 g_pNTCookies[iWeapon] = RegClientCookie(szName, szInfo, CookieAccess_Private);
164 }
165
166 if (g_pNTCookies[iWeapon] != INVALID_HANDLE)
167 {
168 SetClientCookie(iUser, g_pNTCookies[iWeapon], szNameTag);
169 }
170}
171
172void xGetUserNameTagForWeapon(int iUser, int iWeapon, char[] szNameTag)
173{
174 static char szName[MAX_NAME_LENGTH] = "";
175 static char szInfo[PLATFORM_MAX_PATH] = "";
176
177 if (g_pNTCookies[iWeapon] == INVALID_HANDLE)
178 {
179 FormatEx(szName, sizeof(szName), "m_szCustomName@%04d", iWeapon);
180 FormatEx(szInfo, sizeof(szInfo), "Custom Name For Weapon Having m_iItemDefinitionIndex %d", iWeapon);
181
182 g_pNTCookies[iWeapon] = RegClientCookie(szName, szInfo, CookieAccess_Private);
183 }
184
185 if (g_pNTCookies[iWeapon] != INVALID_HANDLE)
186 {
187 GetClientCookie(iUser, g_pNTCookies[iWeapon], szNameTag, MAX_NAME_LENGTH);
188 }
189}
190
191public void OnMySQLThreadedConnection(Handle pOwner, Handle pChild, const char[] Error, any Data)
192{
193 if (g_pDatabase == INVALID_HANDLE)
194 {
195 g_pDatabase = pChild;
196
197 if (strlen(Error) < 1 && g_pDatabase != INVALID_HANDLE)
198 {
199 SQL_SetCharset(g_pDatabase, "utf8");
200
201 SQL_TQuery(g_pDatabase, QueryHandler_Empty, "CREATE TABLE IF NOT EXISTS nf_players (Steam varchar(128) NOT NULL UNIQUE, Skins varchar(8192), Name varchar(128), lastSeen NUMERIC, Kills NUMERIC);", _, DBPrio_High);
202 }
203 }
204
205 else if (pChild != INVALID_HANDLE)
206 {
207 CloseHandle(pChild);
208 pChild = INVALID_HANDLE;
209 }
210}
211
212public void OnMapStart()
213{
214 CreateTimer(1.0, Timer_CreateFakeClient, _, TIMER_FLAG_NO_MAPCHANGE);
215
216 g_fDelay = 0.0;
217}
218
219public Action Timer_CreateFakeClient(Handle pTimer, any _Data)
220{
221 if (g_iFakeClient == INVALID_ENT_REFERENCE)
222 g_iFakeClient = CreateFakeClient("BOT Hattrick");
223}
224
225public void OnMapEnd()
226{
227 if (g_iFakeClient != INVALID_ENT_REFERENCE)
228 g_iFakeClient = INVALID_ENT_REFERENCE;
229
230 g_bIsInRound = false;
231 g_fDelay = 0.0;
232}
233
234public Action CS_OnTerminateRound(float& Delay, CSRoundEndReason& Reason)
235{
236 static int Owner;
237
238 g_bIsInRound = false;
239
240 for (Owner = 1; Owner <= MaxClients; Owner++)
241 {
242 if (g_bIsInGame[Owner] && IsPlayerAlive(Owner))
243 CreateTimer(Delay - GetRandomFloat(0.2975, 0.3995), stripKnifeQuietly, Owner, TIMER_FLAG_NO_MAPCHANGE);
244 }
245}
246
247public Action stripKnifeQuietly(Handle pTimer, any Owner)
248{
249 static char Class[MAX_NAME_LENGTH];
250 static int Entity, Tries;
251
252 if (g_bIsInGame[Owner] && IsPlayerAlive(Owner))
253 {
254 Entity = INVALID_ENT_REFERENCE;
255
256 Tries = 0;
257
258 while ((Entity = GetPlayerWeaponSlot(Owner, CS_SLOT_KNIFE)) != INVALID_ENT_REFERENCE)
259 {
260 if (GetEdictClassname(Entity, Class, sizeof(Class)) && \
261 (StrContains(Class, "Knife", false) != -1 || \
262 StrContains(Class, "Bayonet", false) != -1))
263 {
264 if (RemovePlayerItem(Owner, Entity))
265 {
266 my_Remove(Entity);
267 }
268
269 break;
270 }
271
272 if (++Tries >= 4)
273 break;
274 }
275 }
276}
277
278float FClamp(float fVal, float fMin, float fMax)
279{
280 if (fVal < fMin)
281 return fMin;
282
283 else if (fVal > fMax)
284 return fMax;
285
286 return fVal;
287}
288
289float GetWear(int iId)
290{
291 static char szValue[MAX_NAME_LENGTH / 4] = "";
292 GetClientCookie(iId, g_pWear, szValue, sizeof(szValue));
293
294 return FClamp(StringToFloat(szValue), 0.00005, 8192.0);
295}
296
297public Action OnWear(int iClient, int iArgs)
298{
299 if (iClient < 1 || iClient > MaxClients || !IsClientInGame(iClient))
300 return Plugin_Stop;
301
302 float fOldWear = GetWear(iClient);
303
304 if (iArgs < 1)
305 {
306 ReplyToCommand(iClient, "Current\x04 Wear\x0B %f", fOldWear);
307 ReplyToCommand(iClient, "Command Usage (Example)\x04 SM_Wear\x0B %f", GetRandomFloat(0.0, 1.0));
308
309 return Plugin_Stop;
310 }
311
312 char szArg[MAX_NAME_LENGTH];
313 GetCmdArg(1, szArg, sizeof(szArg));
314
315 float fWear = FClamp(StringToFloat(szArg), 0.00005, 8192.0);
316
317 FloatToString(fWear, szArg, sizeof(szArg));
318 SetClientCookie(iClient, g_pWear, szArg);
319
320 ReplyToCommand(iClient, "Old\x04 Wear\x0B %f\x01 New\x04 Wear\x0B %f", fOldWear, StringToFloat(szArg));
321
322 if (IsPlayerAlive(iClient))
323 CreateTimer(GetRandomFloat(0.025, 0.1575), TimerHandler_DisplaySkinsMenu, iClient, TIMER_FLAG_NO_MAPCHANGE);
324
325 return Plugin_Stop;
326}
327
328public Action Timer_Ad(Handle pTimer, any _Data)
329{
330 PrintToChatAll("\x01 NEW COMMAND\x04 !WEAR\x05 %f\x01 (EXAMPLE)", GetRandomFloat(0.0, 1.0));
331}
332
333public void OnPluginStart()
334{
335 CreateTimer(60.0 * 10.0, Timer_Ad, _, TIMER_REPEAT);
336
337 SQL_TConnect(OnMySQLThreadedConnection, "new_features");
338
339 HookEventEx("round_start", OnRoundStart);
340
341 HookEventEx("player_spawn", OnPlayerSpawn);
342 HookEventEx("player_death", OnPlayerDeath);
343
344 RegAdminCmd("sm_wear", OnWear, 0, "Sets Wear Value (Float) On Item");
345
346 RegConsoleCmd("buyammo", CommandBuyAmmo);
347
348 RegConsoleCmd("buyammo1", CommandBuyAmmo);
349 RegConsoleCmd("buyammo2", CommandBuyAmmo);
350
351 RegConsoleCmd("say", CommandSay);
352 RegConsoleCmd("say_team", CommandSay);
353
354 g_Offset = Find("m_szCustomName");
355
356 g_pKnifeCookie = RegClientCookie("KnifeType", "Stores the knifecc type.", CookieAccess_Private);
357 g_pStatTrakOptionCookie = RegClientCookie("StatTrakTechOpt", "Stores the StatTrak(tm) technology option.", CookieAccess_Private);
358 g_pKnifeSkinCookie = RegClientCookie("KnifeSkin", "Stores the knife skin.", CookieAccess_Private);
359 g_pWear = RegClientCookie("Wear", "Stores The Wear Value", CookieAccess_Private);
360}
361
362public void OnRoundStart(Handle pEvent, const char[] eventName, bool bNoBroadcast)
363{
364 g_bIsInRound = true;
365}
366
367public void OnClientAuthorized(int Client, const char[] Auth)
368{
369 if (!IsFakeClient(Client) && !IsClientSourceTV(Client))
370 FormatEx(g_Steam[Client], sizeof(g_Steam[]), Auth);
371
372 else
373 {
374 FormatEx(g_Steam[Client], sizeof(g_Steam[]), "BOT@%N", Client);
375
376 g_pStatTrakOption[Client] = StatTrakOption_Disabled;
377 g_bMessageShown[Client] = true;
378 g_pKnife[Client] = Knife_None;
379 g_pKnifeSkin[Client] = Knife_Skin_Default;
380 }
381}
382
383public void OnClientPutInServer(int Client)
384{
385 static int Iterator;
386
387 g_bIsInGame[Client] = true;
388 g_Kills[Client] = 0;
389
390 for (Iterator = 0; Iterator < sizeof(g_Skins[]); Iterator++)
391 g_Skins[Client][Iterator] = 0;
392
393 if (IsFakeClient(Client) || IsClientSourceTV(Client) || \
394 StrContains("GOTV BOT HLTV SOURCETV SRCTV", g_Steam[Client], false) != -1)
395 {
396 FormatEx(g_Steam[Client], sizeof(g_Steam[]), "BOT@%N", Client);
397
398 g_pStatTrakOption[Client] = StatTrakOption_Disabled;
399 g_bMessageShown[Client] = true;
400 g_pKnife[Client] = Knife_None;
401 g_pKnifeSkin[Client] = Knife_Skin_Default;
402 }
403
404 else
405 {
406 SDKHookEx(Client, SDKHook_WeaponEquipPost, OnWeaponEquip);
407
408 if (g_pDatabase != INVALID_HANDLE)
409 {
410 FormatEx(g_Buffer, sizeof(g_Buffer), "SELECT Skins, Kills FROM nf_players WHERE Steam = '%s';", g_Steam[Client]);
411 SQL_TQuery(g_pDatabase, QueryHandler_SkinsReceived, g_Buffer, Client, DBPrio_High);
412 }
413
414 else
415 CreateTimer(0.1, loadSkins_Delayed, Client, TIMER_FLAG_NO_MAPCHANGE);
416 }
417}
418
419public Action CommandBuyAmmo(int Client, int Args)
420{
421 static int lastTime[MAXPLAYERS + 1], theTime;
422
423 if (Client > 0 && g_bIsInGame[Client])
424 {
425 theTime = GetTime();
426
427 if (lastTime[Client] < theTime && IsPlayerAlive(Client))
428 {
429 CreateTimer(GetRandomFloat(0.025, 0.1575), TimerHandler_DisplaySkinsMenu, Client, TIMER_FLAG_NO_MAPCHANGE);
430
431 lastTime[Client] = theTime + 1;
432 }
433 }
434}
435
436public Action OnWeaponEquip(int iClient, int iEntity)
437{
438 static int iPrevOwner = INVALID_ENT_REFERENCE;
439
440 if ((iPrevOwner = GetEntPropEnt(iEntity, Prop_Send, "m_hPrevOwner")) == INVALID_ENT_REFERENCE || \
441 (iPrevOwner == g_iFakeClient && g_iFakeClient != INVALID_ENT_REFERENCE))
442 {
443 applyWeaponData(iClient, iEntity, GetEntProp(iEntity, Prop_Send, "m_iItemDefinitionIndex"), true);
444 }
445
446 return Plugin_Continue;
447}
448
449void SaveMe(int Client)
450{
451 static int Iterator, iStamp[MAXPLAYERS + 1] = { 0, ... }, Time;
452 static char Item[PLATFORM_MAX_PATH / 8];
453 static bool bShouldSave = false;
454
455 Time = GetTime();
456
457 if (Time - iStamp[Client] < 3 || Time - g_SpawnTime[Client] < 1)
458 return;
459
460 iStamp[Client] = Time;
461
462 g_Buffer[0] = EOS;
463 bShouldSave = false;
464
465 for (Iterator = 0; Iterator < sizeof(g_Skins[]); Iterator++)
466 {
467 if (!bShouldSave && g_Skins[Client][Iterator] != 0)
468 bShouldSave = true;
469
470 IntToString(g_Skins[Client][Iterator], Item, sizeof(Item));
471 StrCat(g_Buffer, sizeof(g_Buffer), Item);
472
473 if (Iterator != sizeof(g_Skins[]) - 1)
474 StrCat(g_Buffer, sizeof(g_Buffer), ",");
475 }
476
477 if (bShouldSave && g_pDatabase != INVALID_HANDLE)
478 {
479 Format(g_Buffer, sizeof(g_Buffer), \
480 "UPDATE nf_players SET Skins = '%s', lastSeen = %d WHERE Steam = '%s';", \
481 g_Buffer, GetTime(), g_Steam[Client]);
482
483 SQL_TQuery(g_pDatabase, QueryHandler_Empty, g_Buffer, _, DBPrio_Low);
484 }
485}
486
487public void OnClientDisconnect(int Client)
488{
489 SDKUnhook(Client, SDKHook_WeaponEquipPost, OnWeaponEquip);
490
491 g_bIsInGame[Client] = false;
492}
493
494public Action loadSkins_Delayed(Handle pTimer, any Client)
495{
496 if (g_bIsInGame[Client] || \
497 IsClientInGame(Client) || \
498 IsClientConnected(Client))
499 {
500 if (g_pDatabase != INVALID_HANDLE)
501 {
502 FormatEx(g_Buffer, sizeof(g_Buffer), "SELECT Skins, Kills FROM nf_players WHERE Steam = '%s';", g_Steam[Client]);
503 SQL_TQuery(g_pDatabase, QueryHandler_SkinsReceived, g_Buffer, Client, DBPrio_High);
504 }
505
506 else
507 CreateTimer(0.1, loadSkins_Delayed, Client, TIMER_FLAG_NO_MAPCHANGE);
508 }
509}
510
511public void OnClientCookiesCached(int Client)
512{
513 static char Value[MAX_NAME_LENGTH / 4];
514
515 if (!IsFakeClient(Client) && \
516 !IsClientSourceTV(Client) && \
517 StrContains("GOTV BOT HLTV SOURCETV SRCTV", g_Steam[Client], false) == -1)
518 {
519 GetClientCookie(Client, g_pKnifeCookie, Value, sizeof(Value));
520
521 if (strlen(Value) == 0)
522 g_pKnife[Client] = Knife_None;
523
524 else
525 g_pKnife[Client] = view_as<Knife>(StringToInt(Value));
526
527 GetClientCookie(Client, g_pKnifeSkinCookie, Value, sizeof(Value));
528
529 if (strlen(Value) == 0)
530 g_pKnifeSkin[Client] = Knife_Skin_None;
531
532 else
533 g_pKnifeSkin[Client] = view_as<KnifeSkin>(StringToInt(Value));
534
535 GetClientCookie(Client, g_pStatTrakOptionCookie, Value, sizeof(Value));
536
537 if (strlen(Value) == 0)
538 {
539 g_pStatTrakOption[Client] = StatTrakOption_None;
540 g_bMessageShown[Client] = false;
541 }
542
543 else
544 {
545 g_pStatTrakOption[Client] = StringToInt(Value) > 0 ? view_as<StatTrakOption>(StringToInt(Value)) : StatTrakOption_None;
546 g_bMessageShown[Client] = GetRandomInt(0, 2) == 0 ? false : true;
547 }
548 }
549
550 else
551 {
552 g_pStatTrakOption[Client] = StatTrakOption_Disabled;
553 g_bMessageShown[Client] = true;
554 g_pKnife[Client] = Knife_None;
555 g_pKnifeSkin[Client] = Knife_Skin_Default;
556 }
557}
558
559int GetRandomKnifeSkin()
560{
561 static KnifeSkin knifeIds[] =
562 {
563 Knife_Skin_Default,
564 Knife_Skin_Fade,
565 Knife_Skin_Webs,
566 Knife_Skin_WebsDarker,
567 Knife_Skin_Purple,
568 Knife_Skin_Oiled,
569 Knife_Skin_DDPat,
570 Knife_Skin_Night,
571 Knife_Skin_MarbleFade,
572 Knife_Skin_ForestBoreal,
573 Knife_Skin_DopplerPhase1,
574 Knife_Skin_DopplerPhase2,
575 Knife_Skin_DopplerPhase3,
576 Knife_Skin_DopplerPhase4,
577 Knife_Skin_Slaughter,
578 Knife_Skin_Blued,
579 Knife_Skin_TigerOrange,
580 Knife_Skin_DopplerRuby,
581 Knife_Skin_DopplerSapphire,
582 Knife_Skin_DopplerBlackpearl,
583 Knife_Skin_GDoppler_P1,
584 Knife_Skin_GDoppler_P2,
585 Knife_Skin_GDoppler_P3,
586 Knife_Skin_GDoppler_P4,
587 Knife_Skin_EmeraldMarbleized,
588 Knife_Skin_Stained,
589 Knife_Skin_SafariMesh,
590 Knife_Skin_UrbanMasked,
591 Knife_Skin_Scorched,
592 Knife_Skin_RustCoat
593 };
594
595 return view_as<int>(knifeIds[GetRandomInt(0, sizeof(knifeIds) - 1)]);
596}
597
598void KnifeClassByOption(int Owner, char[] Class, int Size)
599{
600 switch (g_pKnife[Owner])
601 {
602 case Knife_None, Knife_Default:
603 {
604 switch (GetClientTeam(Owner))
605 {
606 case CS_TEAM_CT: FormatEx(Class, Size, "weapon_knife");
607 case CS_TEAM_T: FormatEx(Class, Size, "weapon_knife_t");
608 }
609 }
610
611 case Knife_Gut: FormatEx(Class, Size, "weapon_knife_gut");
612 case Knife_Flip: FormatEx(Class, Size, "weapon_knife_flip");
613 case Knife_Falchion: FormatEx(Class, Size, "weapon_knife_falchion");
614 case Knife_Bayonet: FormatEx(Class, Size, "weapon_bayonet");
615 case Knife_M9: FormatEx(Class, Size, "weapon_knife_m9_bayonet");
616 case Knife_Push: FormatEx(Class, Size, "weapon_knife_push");
617 case Knife_Karambit: FormatEx(Class, Size, "weapon_knife_karambit");
618 case Knife_Butterfly: FormatEx(Class, Size, "weapon_knife_butterfly");
619 case Knife_Tactical: FormatEx(Class, Size, "weapon_knife_tactical");
620 case Knife_Bowie: FormatEx(Class, Size, "weapon_knife_survival_bowie");
621 }
622}
623
624void applyKnifeData(int Owner, int Entity, int Id)
625{
626 if (Id >= 128 && g_pKnife[Owner] != Knife_Default && g_pKnife[Owner] != Knife_None)
627 {
628 SetEntProp(Entity, Prop_Send, "m_iItemIDLow", -1);
629
630 if (g_pKnifeSkin[Owner] == Knife_Skin_Default || g_pKnifeSkin[Owner] == Knife_Skin_None)
631 SetEntProp(Entity, Prop_Send, "m_nFallbackPaintKit", 1);
632
633 else
634 SetEntProp(Entity, Prop_Send, "m_nFallbackPaintKit", g_pKnifeSkin[Owner] == Knife_Skin_Random ? \
635 GetRandomKnifeSkin() : view_as<int>(g_pKnifeSkin[Owner]));
636
637 if (g_pKnifeSkin[Owner] != Knife_Skin_Default && g_pKnifeSkin[Owner] != Knife_Skin_None)
638 {
639 SetEntPropFloat(Entity, Prop_Send, "m_flFallbackWear", GetWear(Owner));
640 SetEntProp(Entity, Prop_Send, "m_nFallbackSeed", GetRandomInt(0, 8192));
641 }
642
643 if (g_pStatTrakOption[Owner] == StatTrakOption_Enabled)
644 SetEntProp(Entity, Prop_Send, "m_nFallbackStatTrak", g_Kills[Owner]);
645
646 else
647 SetEntProp(Entity, Prop_Send, "m_nFallbackStatTrak", -1);
648
649 SetEntProp(Entity, Prop_Send, "m_iEntityQuality", 3);
650
651 if (!xVIPAvail() || (xVIPAvail() && xIsVIP(Owner)))
652 {
653 xGetUserNameTagForWeapon(Owner, Id, g_Buffer);
654
655 if (strlen(g_Buffer) > 0)
656 SetEntDataString(Entity, g_Offset, g_Buffer, PLATFORM_MAX_PATH);
657 }
658
659 SetEntProp(Entity, Prop_Send, "m_iAccountID", GetEntProp(Entity, Prop_Send, "m_OriginalOwnerXuidLow"));
660 }
661}
662
663public APLRes AskPluginLoad2(Handle pSelf, bool bLate, char[] szError, int iMaxErrSize)
664{
665 MarkNativeAsOptional("IsClientVIP");
666
667 CreateNative("EquipKnife", __EquipKnife);
668
669 RegPluginLibrary("new_features");
670
671 return APLRes_Success;
672}
673
674bool xVIPAvail()
675{
676 return CanTestFeatures() && \
677 GetFeatureStatus(FeatureType_Native, "IsClientVIP") == FeatureStatus_Available ? true : false;
678}
679
680bool xIsVIP(int iId)
681{
682 return CanTestFeatures() && \
683 GetFeatureStatus(FeatureType_Native, "IsClientVIP") == FeatureStatus_Available && \
684 IsClientVIP(iId) ? true : false;
685}
686
687void applyWeaponData(int Owner, int Entity, int Id, bool bByForward = false)
688{
689 static char Class[MAX_NAME_LENGTH] = "";
690
691 if (GetEdictClassname(Entity, Class, sizeof(Class)) && g_Skins[Owner][Id] > 1 && \
692 StrContains(Class, "Bayonet", false) == -1 && StrContains(Class, "Knife", false) == -1)
693 {
694 if (bByForward)
695 {
696 if (RemovePlayerItem(Owner, Entity))
697 {
698 my_Remove(Entity);
699
700 switch (Id)
701 {
702 case 63: Class = "weapon_cz75a";
703 case 64: Class = "weapon_revolver";
704 case 61: Class = "weapon_usp_silencer";
705 case 60: Class = "weapon_m4a1_silencer";
706 }
707
708 SDKUnhook(Owner, SDKHook_WeaponEquipPost, OnWeaponEquip);
709
710 Entity = GivePlayerItem(Owner, Class);
711
712 SDKHookEx(Owner, SDKHook_WeaponEquipPost, OnWeaponEquip);
713 }
714 }
715
716 if (Entity != INVALID_ENT_REFERENCE)
717 {
718 SetEntProp(Entity, Prop_Send, "m_iItemIDLow", -1);
719
720 SetEntProp(Entity, Prop_Send, "m_nFallbackPaintKit", g_Skins[Owner][Id]);
721 SetEntPropFloat(Entity, Prop_Send, "m_flFallbackWear", GetWear(Owner));
722 SetEntProp(Entity, Prop_Send, "m_nFallbackSeed", GetRandomInt(0, 8192));
723
724 if (g_pStatTrakOption[Owner] == StatTrakOption_Enabled)
725 SetEntProp(Entity, Prop_Send, "m_nFallbackStatTrak", g_Kills[Owner]);
726
727 else
728 SetEntProp(Entity, Prop_Send, "m_nFallbackStatTrak", -1);
729
730 if (g_pStatTrakOption[Owner] == StatTrakOption_Enabled)
731 SetEntProp(Entity, Prop_Send, "m_iEntityQuality", 9);
732
733 else if (GetEntProp(Entity, Prop_Send, "m_iEntityQuality") == 12)
734 {
735
736 }
737
738 else
739 {
740 SetEntProp(Entity, Prop_Send, "m_iEntityQuality", 0);
741 }
742
743 if (!xVIPAvail() || (xVIPAvail() && xIsVIP(Owner)))
744 {
745 xGetUserNameTagForWeapon(Owner, Id, g_Buffer);
746
747 if (strlen(g_Buffer) > 0)
748 SetEntDataString(Entity, g_Offset, g_Buffer, PLATFORM_MAX_PATH);
749 }
750
751 SetEntProp(Entity, Prop_Send, "m_iAccountID", GetEntProp(Entity, Prop_Send, "m_OriginalOwnerXuidLow"));
752
753 if (!bByForward)
754 SaveMe(Owner);
755 }
756 }
757}
758
759public void QueryHandler_Empty(Handle pDb, Handle pQuery, char[] Error, any Data)
760{
761
762}
763
764public Action Timer_RetrieveKills(Handle pTimer, any _Data)
765{
766 if (IsClientInGame(_Data) && g_pDatabase != INVALID_HANDLE)
767 {
768 FormatEx(g_Buffer, sizeof(g_Buffer), "SELECT kills FROM ss_players WHERE steam = '%s';", g_Steam[_Data]);
769 SQL_TQuery(g_pDatabase, QueryHandler_KillsReceived, g_Buffer, _Data, DBPrio_High);
770 }
771}
772
773public void QueryHandler_KillsReceived(Handle pOwner, Handle pQuery, const char[] Error, any Client)
774{
775 if (pQuery != INVALID_HANDLE && strlen(Error) < 1 && SQL_GetRowCount(pQuery) > 0)
776 {
777 SQL_FetchRow(pQuery);
778 g_Kills[Client] = SQL_FetchInt(pQuery, 0);
779 FormatEx(g_Buffer, sizeof(g_Buffer), "UPDATE nf_players SET Kills = %d WHERE Steam = '%s';", g_Kills[Client], g_Steam[Client]);
780 SQL_TQuery(g_pDatabase, QueryHandler_Empty, g_Buffer, Client, DBPrio_Low);
781 }
782}
783
784public void QueryHandler_SkinsReceived(Handle pOwner, Handle pQuery, const char[] Error, any Client)
785{
786 static int Iterator;
787 static char Buffers[sizeof(g_Skins[])][PLATFORM_MAX_PATH / 8];
788
789 if (pQuery != INVALID_HANDLE && strlen(Error) < 1)
790 {
791 if (SQL_GetRowCount(pQuery) > 0)
792 {
793 SQL_FetchRow(pQuery);
794 SQL_FetchString(pQuery, 0, g_Buffer, sizeof(g_Buffer));
795 g_Kills[Client] = SQL_FetchInt(pQuery, 1);
796
797 CreateTimer(0.1, Timer_RetrieveKills, Client, TIMER_FLAG_NO_MAPCHANGE);
798
799 if (strlen(g_Buffer) == 0)
800 {
801 for (Iterator = 0; Iterator < sizeof(g_Skins[]); Iterator++)
802 g_Skins[Client][Iterator] = 0;
803 }
804
805 else
806 {
807 for (Iterator = 0; Iterator < sizeof(g_Skins[]); Iterator++)
808 Buffers[Iterator][0] = EOS;
809
810 ExplodeString(g_Buffer, ",", Buffers, sizeof(Buffers), sizeof(Buffers[]));
811
812 for (Iterator = 0; Iterator < sizeof(g_Skins[]); Iterator++)
813 {
814 if (strlen(Buffers[Iterator]) > 0)
815 g_Skins[Client][Iterator] = StringToInt(Buffers[Iterator]);
816
817 else
818 g_Skins[Client][Iterator] = 0;
819 }
820 }
821 }
822
823 else
824 {
825 g_Kills[Client] = 0;
826
827 FormatEx(g_Buffer, sizeof(g_Buffer), "INSERT INTO nf_players VALUES ('%s', '', '', %d, 0);", \
828 g_Steam[Client], GetTime());
829
830 if (g_pDatabase != INVALID_HANDLE)
831 SQL_TQuery(g_pDatabase, QueryHandler_Empty, g_Buffer, _, DBPrio_Low);
832
833 for (Iterator = 0; Iterator < sizeof(g_Skins[]); Iterator++)
834 g_Skins[Client][Iterator] = 0;
835 }
836 }
837}
838
839public void OnPlayerDeath(Handle pEvent, const char[] eventName, bool bNoBroadcast)
840{
841 static int Client, Attacker, Wpn;
842
843 Client = GetClientOfUserId(GetEventInt(pEvent, "userid"));
844
845 if (Client > 0)
846 {
847 if (GetRandomInt(1, 10) == 1 && (!xVIPAvail() || (xVIPAvail() && xIsVIP(Client))))
848 PrintToChat(Client, " \x05NEW\x09 VIP★\x05 COMMAND\x0B !NameTag");
849
850 Attacker = GetClientOfUserId(GetEventInt(pEvent, "attacker"));
851
852 if (Attacker >= 1 && Attacker <= MaxClients && Attacker != Client && g_bIsInGame[Attacker] && \
853 StrContains("GOTV HLTV BOT SOURCETV SRCTV", g_Steam[Attacker], false) == -1)
854 {
855 g_Kills[Attacker]++;
856
857 if (g_pDatabase != INVALID_HANDLE)
858 {
859 FormatEx(g_Buffer, sizeof(g_Buffer), "UPDATE nf_players SET Kills = Kills + 1 WHERE Steam = '%s';", g_Steam[Attacker]);
860 SQL_TQuery(g_pDatabase, QueryHandler_Empty, g_Buffer);
861 }
862
863 if (IsPlayerAlive(Attacker) && g_pStatTrakOption[Attacker] == StatTrakOption_Enabled)
864 {
865 if ((Wpn = GetPlayerWeaponSlot(Attacker, CS_SLOT_PRIMARY)) != INVALID_ENT_REFERENCE && \
866 GetEntProp(Wpn, Prop_Send, "m_nFallbackStatTrak") != -1)
867 {
868 SetEntProp(Wpn, Prop_Send, "m_iItemIDLow", -1);
869 SetEntProp(Wpn, Prop_Send, "m_nFallbackStatTrak", g_Kills[Attacker]);
870 SetEntProp(Wpn, Prop_Send, "m_iAccountID", GetEntProp(Wpn, Prop_Send, "m_OriginalOwnerXuidLow"));
871 }
872
873 if ((Wpn = GetPlayerWeaponSlot(Attacker, CS_SLOT_SECONDARY)) != INVALID_ENT_REFERENCE && \
874 GetEntProp(Wpn, Prop_Send, "m_nFallbackStatTrak") != -1)
875 {
876 SetEntProp(Wpn, Prop_Send, "m_iItemIDLow", -1);
877 SetEntProp(Wpn, Prop_Send, "m_nFallbackStatTrak", g_Kills[Attacker]);
878 SetEntProp(Wpn, Prop_Send, "m_iAccountID", GetEntProp(Wpn, Prop_Send, "m_OriginalOwnerXuidLow"));
879 }
880
881 if ((Wpn = GetPlayerWeaponSlot(Attacker, CS_SLOT_KNIFE)) != INVALID_ENT_REFERENCE && \
882 GetEntProp(Wpn, Prop_Send, "m_nFallbackStatTrak") != -1)
883 {
884 SetEntProp(Wpn, Prop_Send, "m_iItemIDLow", -1);
885 SetEntProp(Wpn, Prop_Send, "m_nFallbackStatTrak", g_Kills[Attacker]);
886 SetEntProp(Wpn, Prop_Send, "m_iAccountID", GetEntProp(Wpn, Prop_Send, "m_OriginalOwnerXuidLow"));
887 }
888 }
889 }
890
891 if (!g_bMessageShown[Client] && GetRandomInt(0, 2) == 0 && g_bIsInGame[Client])
892 CreateTimer(GetRandomFloat(2.75, 4.25), TimerHandler_DisplayStatTrakDetails, Client, TIMER_FLAG_NO_MAPCHANGE);
893 }
894}
895
896public void OnPlayerSpawn(Handle pEvent, const char[] eventName, bool bNoBroadcast)
897{
898 static int Client, iTeam;
899
900 Client = GetClientOfUserId(GetEventInt(pEvent, "userid"));
901
902 if (Client > 0)
903 {
904 if (g_bIsInGame[Client] && \
905 IsPlayerAlive(Client) && \
906 GetEntProp(Client, Prop_Send, "m_iHealth") > 0 && \
907 ((iTeam = GetClientTeam(Client)) == CS_TEAM_T || iTeam == CS_TEAM_CT) && \
908 strncmp(g_Steam[Client], "BOT", 3, false))
909 {
910 g_SpawnTime[Client] = GetTime();
911
912 if (g_pStatTrakOption[Client] == StatTrakOption_None)
913 CreateTimer(GetRandomFloat(2.0, 5.0), TimerHandler_DisplayStatTrakPanel, Client, TIMER_FLAG_NO_MAPCHANGE);
914
915 if (g_pKnife[Client] != Knife_None && g_pKnife[Client] != Knife_Default)
916 CreateTimer(GetRandomFloat(0.1, 0.2), Timer_Replace, Client, TIMER_FLAG_NO_MAPCHANGE);
917 }
918 }
919}
920
921public Action Timer_Replace(Handle pTimer, any _Data)
922{
923 if (g_pKnife[_Data] != Knife_None && g_pKnife[_Data] != Knife_Default)
924 replaceKnifeIfPossible(_Data, true);
925}
926
927#if !defined _hattrick_csgo_included
928 int hCSGO_ClearLine(char[] Line, int Times = 4)
929 {
930 static int m_Iterator, m_Length;
931
932 m_Iterator = 0;
933 m_Length = strlen(Line);
934
935 for (; m_Iterator < Times; m_Iterator++)
936 {
937 StripQuotes(Line);
938 m_Length = TrimString(Line);
939 }
940
941 return m_Length;
942 }
943#endif
944
945public Action CommandSay(int Client, int Args)
946{
947 static int iIter = 0, iWeaponID = 0, iSize = 0, iWeapon = INVALID_ENT_REFERENCE;
948 static char Raw[PLATFORM_MAX_PATH / 2], Command[PLATFORM_MAX_PATH / 2], szClass[PLATFORM_MAX_PATH / 2];
949
950 if (Client > 0 && g_bIsInGame[Client])
951 {
952 GetCmdArgString(Raw, sizeof(Raw));
953
954 if (hCSGO_PureChatCommand(Raw, Command, sizeof(Command)) >= 2)
955 {
956 if (strcmp(Command, "Skin", false) == 0 || strcmp(Command[1], "Skin", false) == 0 || \
957 strcmp(Command, "Skins", false) == 0 || strcmp(Command[1], "Skins", false) == 0 || \
958 strcmp(Command, "Ws", false) == 0 || strcmp(Command[1], "Ws", false) == 0 || \
959 strcmp(Command, "Paints", false) == 0 || strcmp(Command[1], "Paints", false) == 0 || \
960 strcmp(Command, "Paint", false) == 0 || strcmp(Command[1], "Paint", false) == 0)
961 {
962 if (!IsPlayerAlive(Client))
963 PrintToChat(Client, "* You must be\x04 Alive");
964
965 else
966 CreateTimer(GetRandomFloat(0.025, 0.1575), TimerHandler_DisplaySkinsMenu, Client, TIMER_FLAG_NO_MAPCHANGE);
967 }
968
969 else if (strncmp(Command, "NameTag", 7, false) == 0 || strncmp(Command[1], "NameTag", 7, false) == 0)
970 {
971 iWeapon = INVALID_ENT_REFERENCE;
972
973 if (xVIPAvail() && !xIsVIP(Client))
974 {
975 PrintToChat(Client, " \x02YOU MUST BE\x09 VIP★");
976 }
977
978 else if (!IsPlayerAlive(Client))
979 {
980 PrintToChat(Client, " \x02YOU ARE DEAD");
981 }
982
983 else if ((iWeapon = GetEntPropEnt(Client, Prop_Send, "m_hActiveWeapon")) == INVALID_ENT_REFERENCE)
984 {
985 PrintToChat(Client, " \x02YOU HAVE NO\x0B ACTIVE\x02 WEAPON");
986 }
987
988 else
989 {
990 iWeaponID = GetEntProp(iWeapon, Prop_Send, "m_iItemDefinitionIndex");
991
992 hCSGO_ClearLine(Raw);
993 ReplaceString(Raw, sizeof(Raw), "%", "ï¼…");
994
995 for (iIter = 0; iIter < MAX_NAME_LENGTH; iIter++)
996 ReplaceString(Raw, sizeof(Raw), " ", " ");
997
998 char pTokens[MAX_NAME_LENGTH / 4][MAX_NAME_LENGTH];
999 iSize = ExplodeString(Raw, " ", pTokens, sizeof(pTokens), MAX_NAME_LENGTH);
1000
1001 ClassById(iWeaponID, szClass, sizeof(szClass));
1002
1003 if (strlen(szClass) < 1)
1004 {
1005 PrintToChat(Client, " \x02YOU HAVE NO\x04 VALID\x02 WEAPON");
1006
1007 return Plugin_Continue;
1008 }
1009
1010 ReplaceString(szClass, sizeof(szClass), "_", " ");
1011 ReplaceString(szClass, sizeof(szClass), "Weapon ", "", false);
1012
1013 for (iIter = 0; iIter < strlen(szClass); iIter++)
1014 szClass[iIter] = CharToUpper(szClass[iIter]);
1015
1016 Format(szClass, sizeof(szClass), "`%s'", szClass);
1017
1018 if (StrContains(szClass, "Knife ", false) != -1 && \
1019 StrContains(szClass, "Knife T", false) == -1)
1020 {
1021 ReplaceString(szClass, sizeof(szClass), "Knife ", "", false);
1022 }
1023
1024 if (iSize <= 1)
1025 {
1026 xSaveUserNameTagForWeapon(Client, iWeaponID, "");
1027
1028 PrintToChat(Client, " \x04NAME TAG FOR\x0B %s\x07 REMOVED\x02 (NULL)", szClass);
1029
1030 CreateTimer(GetRandomFloat(0.025, 0.1575), TimerHandler_DisplaySkinsMenu, Client, TIMER_FLAG_NO_MAPCHANGE);
1031 }
1032
1033 else
1034 {
1035 g_Buffer = "";
1036
1037 for (iIter = 0; iIter < iSize; iIter++)
1038 {
1039 if (iIter == 0)
1040 continue;
1041
1042 hCSGO_ClearLine(pTokens[iIter]);
1043
1044 if (strlen(pTokens[iIter]) < 1)
1045 continue;
1046
1047 StrCat(g_Buffer, MAX_NAME_LENGTH, pTokens[iIter]);
1048
1049 if (iIter != iSize - 1)
1050 StrCat(g_Buffer, MAX_NAME_LENGTH, " ");
1051 }
1052
1053 hCSGO_ClearLine(g_Buffer);
1054
1055 if (strlen(g_Buffer) < 1)
1056 {
1057 xSaveUserNameTagForWeapon(Client, iWeaponID, "");
1058
1059 PrintToChat(Client, " \x04NAME TAG FOR\x0B %s\x07 REMOVED\x02 (NULL)", szClass);
1060
1061 CreateTimer(GetRandomFloat(0.025, 0.1575), TimerHandler_DisplaySkinsMenu, Client, TIMER_FLAG_NO_MAPCHANGE);
1062 }
1063
1064 else
1065 {
1066 xSaveUserNameTagForWeapon(Client, iWeaponID, g_Buffer);
1067
1068 PrintToChat(Client, " \x04NAME TAG FOR\x0B %s\x09 %s", szClass, g_Buffer);
1069 PrintToChat(Client, " \x05SAY\x07 !NameTag\x05 TO REMOVE\x02 (NULL)");
1070
1071 CreateTimer(GetRandomFloat(0.025, 0.1575), TimerHandler_DisplaySkinsMenu, Client, TIMER_FLAG_NO_MAPCHANGE);
1072 }
1073 }
1074 }
1075 }
1076
1077 else if (strncmp(Command, "Knife", 5, false) == 0 || strncmp(Command[1], "Knife", 5, false) == 0 || \
1078 strncmp(Command, "Knive", 5, false) == 0 || strncmp(Command[1], "Knive", 5, false) == 0 || \
1079 strncmp(Command, "Cutit", 5, false) == 0 || strncmp(Command[1], "Cutit", 5, false) == 0)
1080 {
1081 if (!IsPlayerAlive(Client))
1082 PrintToChat(Client, "* You must be\x04 Alive");
1083
1084 else
1085 CreateTimer(GetRandomFloat(0.025, 0.1575), TimerHandler_DisplayKnivesMenu, Client, TIMER_FLAG_NO_MAPCHANGE);
1086 }
1087
1088 else if (strcmp(Command, "ST", false) == 0 || strcmp(Command[1], "ST", false) == 0)
1089 {
1090 g_bMessageShown[Client] = true;
1091 g_pStatTrakOption[Client] = StatTrakOption_None;
1092
1093 CreateTimer(GetRandomFloat(0.025, 0.1575), \
1094 TimerHandler_DisplayStatTrakPanel, \
1095 Client, \
1096 TIMER_FLAG_NO_MAPCHANGE);
1097 }
1098 }
1099 }
1100
1101 return Plugin_Continue;
1102}
1103
1104public int MenuHandler_Skins(Handle pMenu, MenuAction pAction, int Client, int Selection)
1105{
1106 static int Weapon, iInfo, Id;
1107 static char Info[MAX_NAME_LENGTH];
1108 static bool bDefault;
1109
1110 if (pAction == MenuAction_Select && \
1111 g_bIsInGame[Client] && \
1112 IsPlayerAlive(Client))
1113 {
1114 Weapon = GetEntPropEnt(Client, Prop_Send, "m_hActiveWeapon");
1115
1116 if (Weapon != INVALID_ENT_REFERENCE)
1117 {
1118 Id = GetEntProp(Weapon, Prop_Send, "m_iItemDefinitionIndex");
1119
1120 if (Id != g_ItemDefinitionIndex[Client])
1121 PrintToChat(Client, "* Have you\x07 switched\x01 the\x09 weapon\x01 yet?");
1122
1123 else
1124 {
1125 bDefault = false;
1126
1127 GetMenuItem(pMenu, Selection, Info, sizeof(Info));
1128
1129 iInfo = StringToInt(Info);
1130
1131 switch (Id)
1132 {
1133 case 4:
1134 {
1135 if (iInfo >= sizeof(g_Glock18SkinIds))
1136 bDefault = true,
1137 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1138
1139 else
1140 {
1141 g_Skins[Client][Id] = g_Glock18SkinIds[iInfo];
1142 PrintToChat(Client, "* You selected\x05 %s", g_Glock18Skins[iInfo]);
1143 }
1144 }
1145 case 2:
1146 {
1147 if (iInfo >= sizeof(g_DualBerettasSkinIds))
1148 bDefault = true,
1149 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1150
1151 else
1152 {
1153 g_Skins[Client][Id] = g_DualBerettasSkinIds[iInfo];
1154 PrintToChat(Client, "* You selected\x05 %s", g_DualBerettasSkins[iInfo]);
1155 }
1156 }
1157 case 36:
1158 {
1159 if (iInfo >= sizeof(g_P250SkinIds))
1160 bDefault = true,
1161 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1162
1163 else
1164 {
1165 g_Skins[Client][Id] = g_P250SkinIds[iInfo];
1166 PrintToChat(Client, "* You selected\x05 %s", g_P250Skins[iInfo]);
1167 }
1168 }
1169 case 30:
1170 {
1171 if (iInfo >= sizeof(g_Tec9SkinIds))
1172 bDefault = true,
1173 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1174
1175 else
1176 {
1177 g_Skins[Client][Id] = g_Tec9SkinIds[iInfo];
1178 PrintToChat(Client, "* You selected\x05 %s", g_Tec9Skins[iInfo]);
1179 }
1180 }
1181 case 1:
1182 {
1183 if (iInfo >= sizeof(g_DEagleSkinIds))
1184 bDefault = true,
1185 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1186
1187 else
1188 {
1189 g_Skins[Client][Id] = g_DEagleSkinIds[iInfo];
1190 PrintToChat(Client, "* You selected\x05 %s", g_DEagleSkins[iInfo]);
1191 }
1192 }
1193 case 35:
1194 {
1195 if (iInfo >= sizeof(g_NovaSkinIds))
1196 bDefault = true,
1197 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1198
1199 else
1200 {
1201 g_Skins[Client][Id] = g_NovaSkinIds[iInfo];
1202 PrintToChat(Client, "* You selected\x05 %s", g_NovaSkins[iInfo]);
1203 }
1204 }
1205 case 25:
1206 {
1207 if (iInfo >= sizeof(g_XM1014SkinIds))
1208 bDefault = true,
1209 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1210
1211 else
1212 {
1213 g_Skins[Client][Id] = g_XM1014SkinIds[iInfo];
1214 PrintToChat(Client, "* You selected\x05 %s", g_XM1014Skins[iInfo]);
1215 }
1216 }
1217 case 29:
1218 {
1219 if (iInfo >= sizeof(g_SawedOffSkinIds))
1220 bDefault = true,
1221 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1222
1223 else
1224 {
1225 g_Skins[Client][Id] = g_SawedOffSkinIds[iInfo];
1226 PrintToChat(Client, "* You selected\x05 %s", g_SawedOffSkins[iInfo]);
1227 }
1228 }
1229 case 14:
1230 {
1231 if (iInfo >= sizeof(g_M249SkinIds))
1232 bDefault = true,
1233 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1234
1235 else
1236 {
1237 g_Skins[Client][Id] = g_M249SkinIds[iInfo];
1238 PrintToChat(Client, "* You selected\x05 %s", g_M249Skins[iInfo]);
1239 }
1240 }
1241 case 28:
1242 {
1243 if (iInfo >= sizeof(g_NegevSkinIds))
1244 bDefault = true,
1245 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1246
1247 else
1248 {
1249 g_Skins[Client][Id] = g_NegevSkinIds[iInfo];
1250 PrintToChat(Client, "* You selected\x05 %s", g_NegevSkins[iInfo]);
1251 }
1252 }
1253 case 17:
1254 {
1255 if (iInfo >= sizeof(g_Mac10SkinIds))
1256 bDefault = true,
1257 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1258
1259 else
1260 {
1261 g_Skins[Client][Id] = g_Mac10SkinIds[iInfo];
1262 PrintToChat(Client, "* You selected\x05 %s", g_Mac10Skins[iInfo]);
1263 }
1264 }
1265 case 33:
1266 {
1267 if (iInfo >= sizeof(g_Mp7SkinIds))
1268 bDefault = true,
1269 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1270
1271 else
1272 {
1273 g_Skins[Client][Id] = g_Mp7SkinIds[iInfo];
1274 PrintToChat(Client, "* You selected\x05 %s", g_Mp7Skins[iInfo]);
1275 }
1276 }
1277 case 24:
1278 {
1279 if (iInfo >= sizeof(g_Ump45SkinIds))
1280 bDefault = true,
1281 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1282
1283 else
1284 {
1285 g_Skins[Client][Id] = g_Ump45SkinIds[iInfo];
1286 PrintToChat(Client, "* You selected\x05 %s", g_Ump45Skins[iInfo]);
1287 }
1288 }
1289 case 19:
1290 {
1291 if (iInfo >= sizeof(g_P90SkinIds))
1292 bDefault = true,
1293 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1294
1295 else
1296 {
1297 g_Skins[Client][Id] = g_P90SkinIds[iInfo];
1298 PrintToChat(Client, "* You selected\x05 %s", g_P90Skins[iInfo]);
1299 }
1300 }
1301 case 26:
1302 {
1303 if (iInfo >= sizeof(g_PPBizonSkinIds))
1304 bDefault = true,
1305 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1306
1307 else
1308 {
1309 g_Skins[Client][Id] = g_PPBizonSkinIds[iInfo];
1310 PrintToChat(Client, "* You selected\x05 %s", g_PPBizonSkins[iInfo]);
1311 }
1312 }
1313 case 13:
1314 {
1315 if (iInfo >= sizeof(g_GalilARSkinIds))
1316 bDefault = true,
1317 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1318
1319 else
1320 {
1321 g_Skins[Client][Id] = g_GalilARSkinIds[iInfo];
1322 PrintToChat(Client, "* You selected\x05 %s", g_GalilARSkins[iInfo]);
1323 }
1324 }
1325 case 7:
1326 {
1327 if (iInfo >= sizeof(g_Ak47SkinIds))
1328 bDefault = true,
1329 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1330
1331 else
1332 {
1333 g_Skins[Client][Id] = g_Ak47SkinIds[iInfo];
1334 PrintToChat(Client, "* You selected\x05 %s", g_Ak47Skins[iInfo]);
1335 }
1336 }
1337 case 40:
1338 {
1339 if (iInfo >= sizeof(g_SSG08SkinIds))
1340 bDefault = true,
1341 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1342
1343 else
1344 {
1345 g_Skins[Client][Id] = g_SSG08SkinIds[iInfo];
1346 PrintToChat(Client, "* You selected\x05 %s", g_SSG08Skins[iInfo]);
1347 }
1348 }
1349 case 39:
1350 {
1351 if (iInfo >= sizeof(g_SG553SkinIds))
1352 bDefault = true,
1353 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1354
1355 else
1356 {
1357 g_Skins[Client][Id] = g_SG553SkinIds[iInfo];
1358 PrintToChat(Client, "* You selected\x05 %s", g_SG553Skins[iInfo]);
1359 }
1360 }
1361 case 9:
1362 {
1363 if (iInfo >= sizeof(g_AwpSkinIds))
1364 bDefault = true,
1365 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1366
1367 else
1368 {
1369 g_Skins[Client][Id] = g_AwpSkinIds[iInfo];
1370 PrintToChat(Client, "* You selected\x05 %s", g_AwpSkins[iInfo]);
1371 }
1372 }
1373 case 11:
1374 {
1375 if (iInfo >= sizeof(g_G3SG1SkinIds))
1376 bDefault = true,
1377 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1378
1379 else
1380 {
1381 g_Skins[Client][Id] = g_G3SG1SkinIds[iInfo];
1382 PrintToChat(Client, "* You selected\x05 %s", g_G3SG1Skins[iInfo]);
1383 }
1384 }
1385 case 61:
1386 {
1387 if (iInfo >= sizeof(g_UspSkinIds))
1388 bDefault = true,
1389 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1390
1391 else
1392 {
1393 g_Skins[Client][Id] = g_UspSkinIds[iInfo];
1394 PrintToChat(Client, "* You selected\x05 %s", g_UspSkins[iInfo]);
1395 }
1396 }
1397 case 3:
1398 {
1399 if (iInfo >= sizeof(g_FiveSeveNSKinIds))
1400 bDefault = true,
1401 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1402
1403 else
1404 {
1405 g_Skins[Client][Id] = g_FiveSeveNSKinIds[iInfo];
1406 PrintToChat(Client, "* You selected\x05 %s", g_FiveSeveNSKins[iInfo]);
1407 }
1408 }
1409 case 27:
1410 {
1411 if (iInfo >= sizeof(g_Mag7SkinIds))
1412 bDefault = true,
1413 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1414
1415 else
1416 {
1417 g_Skins[Client][Id] = g_Mag7SkinIds[iInfo];
1418 PrintToChat(Client, "* You selected\x05 %s", g_Mag7Skins[iInfo]);
1419 }
1420 }
1421 case 34:
1422 {
1423 if (iInfo >= sizeof(g_Mp9SkinIds))
1424 bDefault = true,
1425 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1426
1427 else
1428 {
1429 g_Skins[Client][Id] = g_Mp9SkinIds[iInfo];
1430 PrintToChat(Client, "* You selected\x05 %s", g_Mp9Skins[iInfo]);
1431 }
1432 }
1433 case 10:
1434 {
1435 if (iInfo >= sizeof(g_FamasSkinIds))
1436 bDefault = true,
1437 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1438
1439 else
1440 {
1441 g_Skins[Client][Id] = g_FamasSkinIds[iInfo];
1442 PrintToChat(Client, "* You selected\x05 %s", g_FamasSkins[iInfo]);
1443 }
1444 }
1445 case 60:
1446 {
1447 if (iInfo >= sizeof(g_M4A1SkinIds))
1448 bDefault = true,
1449 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1450
1451 else
1452 {
1453 g_Skins[Client][Id] = g_M4A1SkinIds[iInfo];
1454 PrintToChat(Client, "* You selected\x05 %s", g_M4A1Skins[iInfo]);
1455 }
1456 }
1457 case 8:
1458 {
1459 if (iInfo >= sizeof(g_AugSkinIds))
1460 bDefault = true,
1461 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1462
1463 else
1464 {
1465 g_Skins[Client][Id] = g_AugSkinIds[iInfo];
1466 PrintToChat(Client, "* You selected\x05 %s", g_AugSkins[iInfo]);
1467 }
1468 }
1469 case 38:
1470 {
1471 if (iInfo >= sizeof(g_Scar20SkinIds))
1472 bDefault = true,
1473 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1474
1475 else
1476 {
1477 g_Skins[Client][Id] = g_Scar20SkinIds[iInfo];
1478 PrintToChat(Client, "* You selected\x05 %s", g_Scar20Skins[iInfo]);
1479 }
1480 }
1481 case 32:
1482 {
1483 if (iInfo >= sizeof(g_P2000SkinIds))
1484 bDefault = true,
1485 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1486
1487 else
1488 {
1489 g_Skins[Client][Id] = g_P2000SkinIds[iInfo];
1490 PrintToChat(Client, "* You selected\x05 %s", g_P2000Skins[iInfo]);
1491 }
1492 }
1493 case 16:
1494 {
1495 if (iInfo >= sizeof(g_M4A4SkinIds))
1496 bDefault = true,
1497 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1498
1499 else
1500 {
1501 g_Skins[Client][Id] = g_M4A4SkinIds[iInfo];
1502 PrintToChat(Client, "* You selected\x05 %s", g_M4A4Skins[iInfo]);
1503 }
1504 }
1505 case 63:
1506 {
1507 if (iInfo >= sizeof(g_CZ75AutoSkinIds))
1508 bDefault = true,
1509 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1510
1511 else
1512 {
1513 g_Skins[Client][Id] = g_CZ75AutoSkinIds[iInfo];
1514 PrintToChat(Client, "* You selected\x05 %s", g_CZ75AutoSkins[iInfo]);
1515 }
1516 }
1517 case 64:
1518 {
1519 if (iInfo >= sizeof(g_RevolverSkinIds))
1520 bDefault = true,
1521 PrintToChat(Client, "*\x07 Invalid\x01 selection!");
1522
1523 else
1524 {
1525 g_Skins[Client][Id] = g_RevolverSkinIds[iInfo];
1526 PrintToChat(Client, "* You selected\x05 %s", g_RevolverSkins[iInfo]);
1527 }
1528 }
1529
1530 default:
1531 {
1532 PrintToChat(Client, "* You selected\x09 Default");
1533
1534 bDefault = true;
1535 }
1536 }
1537
1538 if (!bDefault && g_bIsInRound)
1539 {
1540 switch (Id)
1541 {
1542 case 4:
1543 {
1544 if (RemovePlayerItem(Client, Weapon))
1545 {
1546 my_Remove(Weapon);
1547
1548 if ((Weapon = GivePlayerItem(Client, "weapon_glock")) != INVALID_ENT_REFERENCE)
1549 applyWeaponData(Client, Weapon, Id);
1550 }
1551 }
1552 case 2:
1553 {
1554 if (RemovePlayerItem(Client, Weapon))
1555 {
1556 my_Remove(Weapon);
1557
1558 if ((Weapon = GivePlayerItem(Client, "weapon_elite")) != INVALID_ENT_REFERENCE)
1559 applyWeaponData(Client, Weapon, Id);
1560 }
1561 }
1562 case 36:
1563 {
1564 if (RemovePlayerItem(Client, Weapon))
1565 {
1566 my_Remove(Weapon);
1567
1568 if ((Weapon = GivePlayerItem(Client, "weapon_p250")) != INVALID_ENT_REFERENCE)
1569 applyWeaponData(Client, Weapon, Id);
1570 }
1571 }
1572 case 30:
1573 {
1574 if (RemovePlayerItem(Client, Weapon))
1575 {
1576 my_Remove(Weapon);
1577
1578 if ((Weapon = GivePlayerItem(Client, "weapon_tec9")) != INVALID_ENT_REFERENCE)
1579 applyWeaponData(Client, Weapon, Id);
1580 }
1581 }
1582 case 1:
1583 {
1584 if (RemovePlayerItem(Client, Weapon))
1585 {
1586 my_Remove(Weapon);
1587
1588 if ((Weapon = GivePlayerItem(Client, "weapon_deagle")) != INVALID_ENT_REFERENCE)
1589 applyWeaponData(Client, Weapon, Id);
1590 }
1591 }
1592 case 35:
1593 {
1594 if (RemovePlayerItem(Client, Weapon))
1595 {
1596 my_Remove(Weapon);
1597
1598 if ((Weapon = GivePlayerItem(Client, "weapon_nova")) != INVALID_ENT_REFERENCE)
1599 applyWeaponData(Client, Weapon, Id);
1600 }
1601 }
1602 case 25:
1603 {
1604 if (RemovePlayerItem(Client, Weapon))
1605 {
1606 my_Remove(Weapon);
1607
1608 if ((Weapon = GivePlayerItem(Client, "weapon_xm1014")) != INVALID_ENT_REFERENCE)
1609 applyWeaponData(Client, Weapon, Id);
1610 }
1611 }
1612 case 29:
1613 {
1614 if (RemovePlayerItem(Client, Weapon))
1615 {
1616 my_Remove(Weapon);
1617
1618 if ((Weapon = GivePlayerItem(Client, "weapon_sawedoff")) != INVALID_ENT_REFERENCE)
1619 applyWeaponData(Client, Weapon, Id);
1620 }
1621 }
1622 case 14:
1623 {
1624 if (RemovePlayerItem(Client, Weapon))
1625 {
1626 my_Remove(Weapon);
1627
1628 if ((Weapon = GivePlayerItem(Client, "weapon_m249")) != INVALID_ENT_REFERENCE)
1629 applyWeaponData(Client, Weapon, Id);
1630 }
1631 }
1632 case 28:
1633 {
1634 if (RemovePlayerItem(Client, Weapon))
1635 {
1636 my_Remove(Weapon);
1637
1638 if ((Weapon = GivePlayerItem(Client, "weapon_negev")) != INVALID_ENT_REFERENCE)
1639 applyWeaponData(Client, Weapon, Id);
1640 }
1641 }
1642 case 17:
1643 {
1644 if (RemovePlayerItem(Client, Weapon))
1645 {
1646 my_Remove(Weapon);
1647
1648 if ((Weapon = GivePlayerItem(Client, "weapon_mac10")) != INVALID_ENT_REFERENCE)
1649 applyWeaponData(Client, Weapon, Id);
1650 }
1651 }
1652 case 33:
1653 {
1654 if (RemovePlayerItem(Client, Weapon))
1655 {
1656 my_Remove(Weapon);
1657
1658 if ((Weapon = GivePlayerItem(Client, "weapon_mp7")) != INVALID_ENT_REFERENCE)
1659 applyWeaponData(Client, Weapon, Id);
1660 }
1661 }
1662 case 24:
1663 {
1664 if (RemovePlayerItem(Client, Weapon))
1665 {
1666 my_Remove(Weapon);
1667
1668 if ((Weapon = GivePlayerItem(Client, "weapon_ump45")) != INVALID_ENT_REFERENCE)
1669 applyWeaponData(Client, Weapon, Id);
1670 }
1671 }
1672 case 19:
1673 {
1674 if (RemovePlayerItem(Client, Weapon))
1675 {
1676 my_Remove(Weapon);
1677
1678 if ((Weapon = GivePlayerItem(Client, "weapon_p90")) != INVALID_ENT_REFERENCE)
1679 applyWeaponData(Client, Weapon, Id);
1680 }
1681 }
1682 case 26:
1683 {
1684 if (RemovePlayerItem(Client, Weapon))
1685 {
1686 my_Remove(Weapon);
1687
1688 if ((Weapon = GivePlayerItem(Client, "weapon_bizon")) != INVALID_ENT_REFERENCE)
1689 applyWeaponData(Client, Weapon, Id);
1690 }
1691 }
1692 case 13:
1693 {
1694 if (RemovePlayerItem(Client, Weapon))
1695 {
1696 my_Remove(Weapon);
1697
1698 if ((Weapon = GivePlayerItem(Client, "weapon_galilar")) != INVALID_ENT_REFERENCE)
1699 applyWeaponData(Client, Weapon, Id);
1700 }
1701 }
1702 case 7:
1703 {
1704 if (RemovePlayerItem(Client, Weapon))
1705 {
1706 my_Remove(Weapon);
1707
1708 if ((Weapon = GivePlayerItem(Client, "weapon_ak47")) != INVALID_ENT_REFERENCE)
1709 applyWeaponData(Client, Weapon, Id);
1710 }
1711 }
1712 case 40:
1713 {
1714 if (RemovePlayerItem(Client, Weapon))
1715 {
1716 my_Remove(Weapon);
1717
1718 if ((Weapon = GivePlayerItem(Client, "weapon_ssg08")) != INVALID_ENT_REFERENCE)
1719 applyWeaponData(Client, Weapon, Id);
1720 }
1721 }
1722 case 39:
1723 {
1724 if (RemovePlayerItem(Client, Weapon))
1725 {
1726 my_Remove(Weapon);
1727
1728 if ((Weapon = GivePlayerItem(Client, "weapon_sg556")) != INVALID_ENT_REFERENCE)
1729 applyWeaponData(Client, Weapon, Id);
1730 }
1731 }
1732 case 9:
1733 {
1734 if (RemovePlayerItem(Client, Weapon))
1735 {
1736 my_Remove(Weapon);
1737
1738 if ((Weapon = GivePlayerItem(Client, "weapon_awp")) != INVALID_ENT_REFERENCE)
1739 applyWeaponData(Client, Weapon, Id);
1740 }
1741 }
1742 case 11:
1743 {
1744 if (RemovePlayerItem(Client, Weapon))
1745 {
1746 my_Remove(Weapon);
1747
1748 if ((Weapon = GivePlayerItem(Client, "weapon_g3sg1")) != INVALID_ENT_REFERENCE)
1749 applyWeaponData(Client, Weapon, Id);
1750 }
1751 }
1752 case 61:
1753 {
1754 if (RemovePlayerItem(Client, Weapon))
1755 {
1756 my_Remove(Weapon);
1757
1758 if ((Weapon = GivePlayerItem(Client, "weapon_usp_silencer")) != INVALID_ENT_REFERENCE)
1759 applyWeaponData(Client, Weapon, Id);
1760 }
1761 }
1762 case 3:
1763 {
1764 if (RemovePlayerItem(Client, Weapon))
1765 {
1766 my_Remove(Weapon);
1767
1768 if ((Weapon = GivePlayerItem(Client, "weapon_fiveseven")) != INVALID_ENT_REFERENCE)
1769 applyWeaponData(Client, Weapon, Id);
1770 }
1771 }
1772 case 27:
1773 {
1774 if (RemovePlayerItem(Client, Weapon))
1775 {
1776 my_Remove(Weapon);
1777
1778 if ((Weapon = GivePlayerItem(Client, "weapon_mag7")) != INVALID_ENT_REFERENCE)
1779 applyWeaponData(Client, Weapon, Id);
1780 }
1781 }
1782 case 34:
1783 {
1784 if (RemovePlayerItem(Client, Weapon))
1785 {
1786 my_Remove(Weapon);
1787
1788 if ((Weapon = GivePlayerItem(Client, "weapon_mp9")) != INVALID_ENT_REFERENCE)
1789 applyWeaponData(Client, Weapon, Id);
1790 }
1791 }
1792 case 10:
1793 {
1794 if (RemovePlayerItem(Client, Weapon))
1795 {
1796 my_Remove(Weapon);
1797
1798 if ((Weapon = GivePlayerItem(Client, "weapon_famas")) != INVALID_ENT_REFERENCE)
1799 applyWeaponData(Client, Weapon, Id);
1800 }
1801 }
1802 case 60:
1803 {
1804 if (RemovePlayerItem(Client, Weapon))
1805 {
1806 my_Remove(Weapon);
1807
1808 if ((Weapon = GivePlayerItem(Client, "weapon_m4a1_silencer")) != INVALID_ENT_REFERENCE)
1809 applyWeaponData(Client, Weapon, Id);
1810 }
1811 }
1812 case 8:
1813 {
1814 if (RemovePlayerItem(Client, Weapon))
1815 {
1816 my_Remove(Weapon);
1817
1818 if ((Weapon = GivePlayerItem(Client, "weapon_aug")) != INVALID_ENT_REFERENCE)
1819 applyWeaponData(Client, Weapon, Id);
1820 }
1821 }
1822 case 38:
1823 {
1824 if (RemovePlayerItem(Client, Weapon))
1825 {
1826 my_Remove(Weapon);
1827
1828 if ((Weapon = GivePlayerItem(Client, "weapon_scar20")) != INVALID_ENT_REFERENCE)
1829 applyWeaponData(Client, Weapon, Id);
1830 }
1831 }
1832 case 32:
1833 {
1834 if (RemovePlayerItem(Client, Weapon))
1835 {
1836 my_Remove(Weapon);
1837
1838 if ((Weapon = GivePlayerItem(Client, "weapon_hkp2000")) != INVALID_ENT_REFERENCE)
1839 applyWeaponData(Client, Weapon, Id);
1840 }
1841 }
1842 case 16:
1843 {
1844 if (RemovePlayerItem(Client, Weapon))
1845 {
1846 my_Remove(Weapon);
1847
1848 if ((Weapon = GivePlayerItem(Client, "weapon_m4a1")) != INVALID_ENT_REFERENCE)
1849 applyWeaponData(Client, Weapon, Id);
1850 }
1851 }
1852 case 63:
1853 {
1854 if (RemovePlayerItem(Client, Weapon))
1855 {
1856 my_Remove(Weapon);
1857
1858 if ((Weapon = GivePlayerItem(Client, "weapon_cz75a")) != INVALID_ENT_REFERENCE)
1859 applyWeaponData(Client, Weapon, Id);
1860 }
1861 }
1862 case 64:
1863 {
1864 if (RemovePlayerItem(Client, Weapon))
1865 {
1866 my_Remove(Weapon);
1867
1868 if ((Weapon = GivePlayerItem(Client, "weapon_revolver")) != INVALID_ENT_REFERENCE)
1869 applyWeaponData(Client, Weapon, Id);
1870 }
1871 }
1872 }
1873 }
1874 }
1875 }
1876
1877 else
1878 PrintToChat(Client, "* You must have an\x05 Active\x09 Weapon");
1879 }
1880
1881 else if (pAction == MenuAction_End && \
1882 pMenu != INVALID_HANDLE)
1883 {
1884 CloseHandle(pMenu);
1885 pMenu = INVALID_HANDLE;
1886 }
1887}
1888
1889public int PanelHandler_StatTrakTech(Handle pPanel, MenuAction pAction, int Client, int Selection)
1890{
1891 if (pAction == MenuAction_Select && \
1892 g_bIsInGame[Client])
1893 {
1894 switch (Selection)
1895 {
1896 case 1:
1897 {
1898 g_bMessageShown[Client] = true;
1899 g_pStatTrakOption[Client] = StatTrakOption_Enabled;
1900
1901 SetClientCookie(Client, g_pStatTrakOptionCookie, "2");
1902
1903 PrintToChat(Client, ">>\x04 StatTrakâ„¢\x01 Technology\x05 ENABLED");
1904 }
1905
1906 case 2:
1907 {
1908 g_bMessageShown[Client] = true;
1909 g_pStatTrakOption[Client] = StatTrakOption_Disabled;
1910
1911 SetClientCookie(Client, g_pStatTrakOptionCookie, "1");
1912
1913 PrintToChat(Client, ">>\x04 StatTrakâ„¢\x01 Technology\x07 DISABLED");
1914 }
1915 }
1916 }
1917
1918 else if (pAction == MenuAction_End && \
1919 pPanel != INVALID_HANDLE)
1920 {
1921 CloseHandle(pPanel);
1922 pPanel = INVALID_HANDLE;
1923 }
1924}
1925
1926public Action TimerHandler_DisplayStatTrakPanel(Handle pTimer, any Client)
1927{
1928 static Handle pPanel;
1929
1930 if (g_bIsInGame[Client] && \
1931 g_pStatTrakOption[Client] == StatTrakOption_None)
1932 {
1933 pPanel = CreatePanel();
1934
1935 if (pPanel != INVALID_HANDLE)
1936 {
1937 SetPanelTitle(pPanel, "Use StatTrakâ„¢ Technology?");
1938
1939 SetPanelKeys(pPanel, 1 << 0 | 1 << 1);
1940 DrawPanelText(pPanel, "");
1941
1942 DrawPanelText(pPanel, "1. Yes");
1943 DrawPanelText(pPanel, "2. No");
1944
1945 if (!IsFakeClient(Client) && !IsClientSourceTV(Client))
1946 SendPanelToClient(pPanel, Client, PanelHandler_StatTrakTech, MENU_TIME_FOREVER);
1947
1948 CloseHandle(pPanel);
1949 pPanel = INVALID_HANDLE;
1950 }
1951 }
1952}
1953
1954public Action TimerHandler_DisplayKnivesMenu(Handle pTimer, any Client)
1955{
1956 static Handle pMenu;
1957
1958 if (g_bIsInGame[Client] && !IsFakeClient(Client) && !IsClientSourceTV(Client))
1959 {
1960 pMenu = CreateMenu(MenuHandler_Knives);
1961
1962 if (pMenu != INVALID_HANDLE)
1963 {
1964 SetMenuTitle(pMenu, "★ KNIVES MENU ★");
1965
1966 AddMenuItem(pMenu, "1", "Default (NO CHANGE)");
1967 AddMenuItem(pMenu, "2", "★ Bowie (SURViVAL)");
1968 AddMenuItem(pMenu, "3", "★ Shadow Daggers (PUSH)");
1969 AddMenuItem(pMenu, "4", "★ M9 Bayonet");
1970 AddMenuItem(pMenu, "5", "★ Karambit");
1971 AddMenuItem(pMenu, "6", "★ Bayonet");
1972 AddMenuItem(pMenu, "7", "★ Huntsman (TACTiCAL)");
1973 AddMenuItem(pMenu, "8", "★ Butterfly");
1974 AddMenuItem(pMenu, "9", "★ Gut");
1975 AddMenuItem(pMenu, "10", "★ Flip");
1976 AddMenuItem(pMenu, "11", "★ Falchion");
1977
1978 DisplayMenu(pMenu, Client, MENU_TIME_FOREVER);
1979 }
1980 }
1981}
1982
1983public int MenuHandler_KnifeSkins(Handle pMenu, MenuAction pAction, int Client, int Skin)
1984{
1985 static char Option[MAX_NAME_LENGTH / 8], Info[MAX_NAME_LENGTH / 8];
1986
1987 if (pAction == MenuAction_Select && \
1988 g_bIsInGame[Client])
1989 {
1990 GetMenuItem(pMenu, Skin, Info, sizeof(Info));
1991
1992 switch (StringToInt(Info))
1993 {
1994 case -1:
1995 {
1996 g_pKnifeSkin[Client] = Knife_Skin_Random;
1997
1998 IntToString(view_as<int>(Knife_Skin_Random), Option, sizeof(Option));
1999 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2000
2001 PrintToChat(Client, "* You selected\x05 » RANDOM «");
2002 replaceKnifeIfPossible(Client);
2003 }
2004
2005 case 0:
2006 {
2007 g_pKnifeSkin[Client] = Knife_Skin_Default;
2008
2009 IntToString(view_as<int>(Knife_Skin_Default), Option, sizeof(Option));
2010 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2011
2012 PrintToChat(Client, "* You selected\x09 » DEFAULT «");
2013 replaceKnifeIfPossible(Client);
2014 }
2015
2016 case 38:
2017 {
2018 g_pKnifeSkin[Client] = Knife_Skin_Fade;
2019
2020 IntToString(view_as<int>(Knife_Skin_Fade), Option, sizeof(Option));
2021 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2022
2023 PrintToChat(Client, "* You selected\x07 Fade");
2024 replaceKnifeIfPossible(Client);
2025 }
2026
2027 case 12:
2028 {
2029 g_pKnifeSkin[Client] = Knife_Skin_Webs;
2030
2031 IntToString(view_as<int>(Knife_Skin_Webs), Option, sizeof(Option));
2032 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2033
2034 PrintToChat(Client, "* You selected\x07 Crimson Web");
2035 replaceKnifeIfPossible(Client);
2036 }
2037
2038 case 232:
2039 {
2040 g_pKnifeSkin[Client] = Knife_Skin_WebsDarker;
2041
2042 IntToString(view_as<int>(Knife_Skin_WebsDarker), Option, sizeof(Option));
2043 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2044
2045 PrintToChat(Client, "* You selected\x07 Crimson Web (Darker)");
2046 replaceKnifeIfPossible(Client);
2047 }
2048
2049 case 98:
2050 {
2051 g_pKnifeSkin[Client] = Knife_Skin_Purple;
2052
2053 IntToString(view_as<int>(Knife_Skin_Purple), Option, sizeof(Option));
2054 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2055
2056 PrintToChat(Client, "* You selected\x07 Ultraviolet");
2057 replaceKnifeIfPossible(Client);
2058 }
2059
2060 case 44:
2061 {
2062 g_pKnifeSkin[Client] = Knife_Skin_Oiled;
2063
2064 IntToString(view_as<int>(Knife_Skin_Oiled), Option, sizeof(Option));
2065 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2066
2067 PrintToChat(Client, "* You selected\x07 Case Hardened");
2068 replaceKnifeIfPossible(Client);
2069 }
2070
2071 case 5:
2072 {
2073 g_pKnifeSkin[Client] = Knife_Skin_DDPat;
2074
2075 IntToString(view_as<int>(Knife_Skin_DDPat), Option, sizeof(Option));
2076 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2077
2078 PrintToChat(Client, "* You selected\x07 Forest DDPAT");
2079 replaceKnifeIfPossible(Client);
2080 }
2081
2082 case 40:
2083 {
2084 g_pKnifeSkin[Client] = Knife_Skin_Night;
2085
2086 IntToString(view_as<int>(Knife_Skin_Night), Option, sizeof(Option));
2087 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2088
2089 PrintToChat(Client, "* You selected\x07 Night");
2090 replaceKnifeIfPossible(Client);
2091 }
2092
2093 case 413:
2094 {
2095 g_pKnifeSkin[Client] = Knife_Skin_MarbleFade;
2096
2097 IntToString(view_as<int>(Knife_Skin_MarbleFade), Option, sizeof(Option));
2098 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2099
2100 PrintToChat(Client, "* You selected\x07 Marble Fade");
2101 replaceKnifeIfPossible(Client);
2102 }
2103
2104 case 77:
2105 {
2106 g_pKnifeSkin[Client] = Knife_Skin_ForestBoreal;
2107
2108 IntToString(view_as<int>(Knife_Skin_ForestBoreal), Option, sizeof(Option));
2109 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2110
2111 PrintToChat(Client, "* You selected\x07 Boreal Forest");
2112 replaceKnifeIfPossible(Client);
2113 }
2114
2115 case 418:
2116 {
2117 g_pKnifeSkin[Client] = Knife_Skin_DopplerPhase1;
2118
2119 IntToString(view_as<int>(Knife_Skin_DopplerPhase1), Option, sizeof(Option));
2120 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2121
2122 PrintToChat(Client, "* You selected\x07 Dopple Phase #1");
2123 replaceKnifeIfPossible(Client);
2124 }
2125
2126 case 419:
2127 {
2128 g_pKnifeSkin[Client] = Knife_Skin_DopplerPhase2;
2129
2130 IntToString(view_as<int>(Knife_Skin_DopplerPhase2), Option, sizeof(Option));
2131 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2132
2133 PrintToChat(Client, "* You selected\x07 Dopple Phase #2");
2134 replaceKnifeIfPossible(Client);
2135 }
2136
2137 case 420:
2138 {
2139 g_pKnifeSkin[Client] = Knife_Skin_DopplerPhase3;
2140
2141 IntToString(view_as<int>(Knife_Skin_DopplerPhase3), Option, sizeof(Option));
2142 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2143
2144 PrintToChat(Client, "* You selected\x07 Dopple Phase #3");
2145 replaceKnifeIfPossible(Client);
2146 }
2147
2148 case 421:
2149 {
2150 g_pKnifeSkin[Client] = Knife_Skin_DopplerPhase4;
2151
2152 IntToString(view_as<int>(Knife_Skin_DopplerPhase4), Option, sizeof(Option));
2153 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2154
2155 PrintToChat(Client, "* You selected\x07 Dopple Phase #4");
2156 replaceKnifeIfPossible(Client);
2157 }
2158
2159 case 59:
2160 {
2161 g_pKnifeSkin[Client] = Knife_Skin_Slaughter;
2162
2163 IntToString(view_as<int>(Knife_Skin_Slaughter), Option, sizeof(Option));
2164 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2165
2166 PrintToChat(Client, "* You selected\x07 Slaughter");
2167 replaceKnifeIfPossible(Client);
2168 }
2169
2170 case 42:
2171 {
2172 g_pKnifeSkin[Client] = Knife_Skin_Blued;
2173
2174 IntToString(view_as<int>(Knife_Skin_Blued), Option, sizeof(Option));
2175 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2176
2177 PrintToChat(Client, "* You selected\x07 Blue Steel");
2178 replaceKnifeIfPossible(Client);
2179 }
2180
2181 case 409:
2182 {
2183 g_pKnifeSkin[Client] = Knife_Skin_TigerOrange;
2184
2185 IntToString(view_as<int>(Knife_Skin_TigerOrange), Option, sizeof(Option));
2186 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2187
2188 PrintToChat(Client, "* You selected\x07 Tiger Tooth");
2189 replaceKnifeIfPossible(Client);
2190 }
2191
2192 case 410:
2193 {
2194 g_pKnifeSkin[Client] = Knife_Skin_Damascus;
2195
2196 IntToString(view_as<int>(Knife_Skin_Damascus), Option, sizeof(Option));
2197 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2198
2199 if (g_pKnife[Client] == Knife_M9)
2200 {
2201 g_pKnifeSkin[Client] = Knife_Skin_Damascus90;
2202
2203 IntToString(view_as<int>(Knife_Skin_Damascus90), Option, sizeof(Option));
2204 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2205 }
2206
2207 PrintToChat(Client, "* You selected\x07 Damascus Steel");
2208 replaceKnifeIfPossible(Client);
2209 }
2210
2211 case 415:
2212 {
2213 g_pKnifeSkin[Client] = Knife_Skin_DopplerRuby;
2214
2215 IntToString(view_as<int>(Knife_Skin_DopplerRuby), Option, sizeof(Option));
2216 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2217
2218 PrintToChat(Client, "* You selected\x07 Doppler (Ruby)");
2219 replaceKnifeIfPossible(Client);
2220 }
2221
2222 case 416:
2223 {
2224 g_pKnifeSkin[Client] = Knife_Skin_DopplerSapphire;
2225
2226 IntToString(view_as<int>(Knife_Skin_DopplerSapphire), Option, sizeof(Option));
2227 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2228
2229 PrintToChat(Client, "* You selected\x07 Doppler (Sapphire)");
2230 replaceKnifeIfPossible(Client);
2231 }
2232
2233 case 417:
2234 {
2235 g_pKnifeSkin[Client] = Knife_Skin_DopplerBlackpearl;
2236
2237 IntToString(view_as<int>(Knife_Skin_DopplerBlackpearl), Option, sizeof(Option));
2238 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2239
2240 PrintToChat(Client, "* You selected\x07 Doppler (Blackpearl)");
2241 replaceKnifeIfPossible(Client);
2242 }
2243
2244 case 411:
2245 {
2246 g_pKnifeSkin[Client] = Knife_Skin_Damascus90;
2247
2248 IntToString(view_as<int>(Knife_Skin_Damascus90), Option, sizeof(Option));
2249 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2250
2251 g_pKnife[Client] = Knife_M9;
2252 IntToString(view_as<int>(g_pKnife[Client]), Option, sizeof(Option));
2253 SetClientCookie(Client, g_pKnifeCookie, Option);
2254
2255 PrintToChat(Client, "* You selected\x07 M9 Bayonet* Damascus Steel");
2256 replaceKnifeIfPossible(Client);
2257 }
2258
2259 case 43:
2260 {
2261 g_pKnifeSkin[Client] = Knife_Skin_Stained;
2262
2263 IntToString(view_as<int>(Knife_Skin_Stained), Option, sizeof(Option));
2264 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2265
2266 PrintToChat(Client, "* You selected\x07 Stained");
2267 replaceKnifeIfPossible(Client);
2268 }
2269
2270 case 72:
2271 {
2272 g_pKnifeSkin[Client] = Knife_Skin_SafariMesh;
2273
2274 IntToString(view_as<int>(Knife_Skin_SafariMesh), Option, sizeof(Option));
2275 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2276
2277 PrintToChat(Client, "* You selected\x07 Safari Mesh");
2278 replaceKnifeIfPossible(Client);
2279 }
2280
2281 case 143:
2282 {
2283 g_pKnifeSkin[Client] = Knife_Skin_UrbanMasked;
2284
2285 IntToString(view_as<int>(Knife_Skin_UrbanMasked), Option, sizeof(Option));
2286 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2287
2288 PrintToChat(Client, "* You selected\x07 Urban Masked");
2289 replaceKnifeIfPossible(Client);
2290 }
2291
2292 case 175:
2293 {
2294 g_pKnifeSkin[Client] = Knife_Skin_Scorched;
2295
2296 IntToString(view_as<int>(Knife_Skin_Scorched), Option, sizeof(Option));
2297 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2298
2299 PrintToChat(Client, "* You selected\x07 Scorched");
2300 replaceKnifeIfPossible(Client);
2301 }
2302
2303 case 414:
2304 {
2305 g_pKnifeSkin[Client] = Knife_Skin_RustCoat;
2306
2307 IntToString(view_as<int>(Knife_Skin_RustCoat), Option, sizeof(Option));
2308 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2309
2310 PrintToChat(Client, "* You selected\x07 Rust Coat");
2311 replaceKnifeIfPossible(Client);
2312 }
2313
2314 case 558:
2315 {
2316 g_pKnifeSkin[Client] = Knife_Skin_Bayonet_Lore;
2317
2318 IntToString(view_as<int>(Knife_Skin_Bayonet_Lore), Option, sizeof(Option));
2319 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2320
2321 g_pKnife[Client] = Knife_Bayonet;
2322 IntToString(view_as<int>(g_pKnife[Client]), Option, sizeof(Option));
2323 SetClientCookie(Client, g_pKnifeCookie, Option);
2324
2325 PrintToChat(Client, "* You selected\x07 Bayonet* Lore");
2326 replaceKnifeIfPossible(Client);
2327 }
2328
2329 case 559:
2330 {
2331 g_pKnifeSkin[Client] = Knife_Skin_Flip_Lore;
2332
2333 IntToString(view_as<int>(Knife_Skin_Flip_Lore), Option, sizeof(Option));
2334 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2335
2336 g_pKnife[Client] = Knife_Flip;
2337 IntToString(view_as<int>(g_pKnife[Client]), Option, sizeof(Option));
2338 SetClientCookie(Client, g_pKnifeCookie, Option);
2339
2340 PrintToChat(Client, "* You selected\x07 Flip* Lore");
2341 replaceKnifeIfPossible(Client);
2342 }
2343
2344 case 560:
2345 {
2346 g_pKnifeSkin[Client] = Knife_Skin_Gut_Lore;
2347
2348 IntToString(view_as<int>(Knife_Skin_Gut_Lore), Option, sizeof(Option));
2349 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2350
2351 g_pKnife[Client] = Knife_Gut;
2352 IntToString(view_as<int>(g_pKnife[Client]), Option, sizeof(Option));
2353 SetClientCookie(Client, g_pKnifeCookie, Option);
2354
2355 PrintToChat(Client, "* You selected\x07 Gut* Lore");
2356 replaceKnifeIfPossible(Client);
2357 }
2358
2359 case 561:
2360 {
2361 g_pKnifeSkin[Client] = Knife_Skin_Karambit_Lore;
2362
2363 IntToString(view_as<int>(Knife_Skin_Karambit_Lore), Option, sizeof(Option));
2364 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2365
2366 g_pKnife[Client] = Knife_Karambit;
2367 IntToString(view_as<int>(g_pKnife[Client]), Option, sizeof(Option));
2368 SetClientCookie(Client, g_pKnifeCookie, Option);
2369
2370 PrintToChat(Client, "* You selected\x07 Karambit* Lore");
2371 replaceKnifeIfPossible(Client);
2372 }
2373
2374 case 562:
2375 {
2376 g_pKnifeSkin[Client] = Knife_Skin_M9_Bayonet_Lore;
2377
2378 IntToString(view_as<int>(Knife_Skin_M9_Bayonet_Lore), Option, sizeof(Option));
2379 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2380
2381 g_pKnife[Client] = Knife_M9;
2382 IntToString(view_as<int>(g_pKnife[Client]), Option, sizeof(Option));
2383 SetClientCookie(Client, g_pKnifeCookie, Option);
2384
2385 PrintToChat(Client, "* You selected\x07 M9 Bayonet* Lore");
2386 replaceKnifeIfPossible(Client);
2387 }
2388
2389 case 563:
2390 {
2391 g_pKnifeSkin[Client] = Knife_Skin_Bayonet_BLaminate;
2392
2393 IntToString(view_as<int>(Knife_Skin_Bayonet_BLaminate), Option, sizeof(Option));
2394 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2395
2396 g_pKnife[Client] = Knife_Bayonet;
2397 IntToString(view_as<int>(g_pKnife[Client]), Option, sizeof(Option));
2398 SetClientCookie(Client, g_pKnifeCookie, Option);
2399
2400 PrintToChat(Client, "* You selected\x07 Bayonet* Black Laminate");
2401 replaceKnifeIfPossible(Client);
2402 }
2403
2404 case 564:
2405 {
2406 g_pKnifeSkin[Client] = Knife_Skin_Flip_BLaminate;
2407
2408 IntToString(view_as<int>(Knife_Skin_Flip_BLaminate), Option, sizeof(Option));
2409 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2410
2411 g_pKnife[Client] = Knife_Flip;
2412 IntToString(view_as<int>(g_pKnife[Client]), Option, sizeof(Option));
2413 SetClientCookie(Client, g_pKnifeCookie, Option);
2414
2415 PrintToChat(Client, "* You selected\x07 Flip* Black Laminate");
2416 replaceKnifeIfPossible(Client);
2417 }
2418
2419 case 565:
2420 {
2421 g_pKnifeSkin[Client] = Knife_Skin_Gut_BLaminate;
2422
2423 IntToString(view_as<int>(Knife_Skin_Gut_BLaminate), Option, sizeof(Option));
2424 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2425
2426 g_pKnife[Client] = Knife_Gut;
2427 IntToString(view_as<int>(g_pKnife[Client]), Option, sizeof(Option));
2428 SetClientCookie(Client, g_pKnifeCookie, Option);
2429
2430 PrintToChat(Client, "* You selected\x07 Gut* Black Laminate");
2431 replaceKnifeIfPossible(Client);
2432 }
2433
2434 case 566:
2435 {
2436 g_pKnifeSkin[Client] = Knife_Skin_Karambit_BLaminate;
2437
2438 IntToString(view_as<int>(Knife_Skin_Karambit_BLaminate), Option, sizeof(Option));
2439 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2440
2441 g_pKnife[Client] = Knife_Karambit;
2442 IntToString(view_as<int>(g_pKnife[Client]), Option, sizeof(Option));
2443 SetClientCookie(Client, g_pKnifeCookie, Option);
2444
2445 PrintToChat(Client, "* You selected\x07 Karambit* Black Laminate");
2446 replaceKnifeIfPossible(Client);
2447 }
2448
2449 case 567:
2450 {
2451 g_pKnifeSkin[Client] = Knife_Skin_M9_Bayonet_BLaminate;
2452
2453 IntToString(view_as<int>(Knife_Skin_M9_Bayonet_BLaminate), Option, sizeof(Option));
2454 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2455
2456 g_pKnife[Client] = Knife_M9;
2457 IntToString(view_as<int>(g_pKnife[Client]), Option, sizeof(Option));
2458 SetClientCookie(Client, g_pKnifeCookie, Option);
2459
2460 PrintToChat(Client, "* You selected\x07 M9 Bayonet* Black Laminate");
2461 replaceKnifeIfPossible(Client);
2462 }
2463
2464 case 568:
2465 {
2466 g_pKnifeSkin[Client] = Knife_Skin_EmeraldMarbleized;
2467
2468 IntToString(view_as<int>(Knife_Skin_EmeraldMarbleized), Option, sizeof(Option));
2469 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2470
2471 PrintToChat(Client, "* You selected\x07 G. Doppler (Emerald)");
2472 replaceKnifeIfPossible(Client);
2473 }
2474
2475 case 569:
2476 {
2477 g_pKnifeSkin[Client] = Knife_Skin_GDoppler_P1;
2478
2479 IntToString(view_as<int>(Knife_Skin_GDoppler_P1), Option, sizeof(Option));
2480 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2481
2482 PrintToChat(Client, "* You selected\x07 G. Doppler Phase #1");
2483 replaceKnifeIfPossible(Client);
2484 }
2485
2486 case 570:
2487 {
2488 g_pKnifeSkin[Client] = Knife_Skin_GDoppler_P2;
2489
2490 IntToString(view_as<int>(Knife_Skin_GDoppler_P2), Option, sizeof(Option));
2491 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2492
2493 PrintToChat(Client, "* You selected\x07 G. Doppler Phase #2");
2494 replaceKnifeIfPossible(Client);
2495 }
2496
2497 case 571:
2498 {
2499 g_pKnifeSkin[Client] = Knife_Skin_GDoppler_P3;
2500
2501 IntToString(view_as<int>(Knife_Skin_GDoppler_P3), Option, sizeof(Option));
2502 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2503
2504 PrintToChat(Client, "* You selected\x07 G. Doppler Phase #3");
2505 replaceKnifeIfPossible(Client);
2506 }
2507
2508 case 572:
2509 {
2510 g_pKnifeSkin[Client] = Knife_Skin_GDoppler_P4;
2511
2512 IntToString(view_as<int>(Knife_Skin_GDoppler_P4), Option, sizeof(Option));
2513 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2514
2515 PrintToChat(Client, "* You selected\x07 G. Doppler Phase #4");
2516 replaceKnifeIfPossible(Client);
2517 }
2518
2519 case 573:
2520 {
2521 g_pKnifeSkin[Client] = Knife_Skin_Bayonet_Auto;
2522
2523 IntToString(view_as<int>(Knife_Skin_Bayonet_Auto), Option, sizeof(Option));
2524 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2525
2526 g_pKnife[Client] = Knife_Bayonet;
2527 IntToString(view_as<int>(g_pKnife[Client]), Option, sizeof(Option));
2528 SetClientCookie(Client, g_pKnifeCookie, Option);
2529
2530 PrintToChat(Client, "* You selected\x07 Bayonet* Autotronic");
2531 replaceKnifeIfPossible(Client);
2532 }
2533
2534 case 574:
2535 {
2536 g_pKnifeSkin[Client] = Knife_Skin_Flip_Auto;
2537
2538 IntToString(view_as<int>(Knife_Skin_Flip_Auto), Option, sizeof(Option));
2539 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2540
2541 g_pKnife[Client] = Knife_Flip;
2542 IntToString(view_as<int>(g_pKnife[Client]), Option, sizeof(Option));
2543 SetClientCookie(Client, g_pKnifeCookie, Option);
2544
2545 PrintToChat(Client, "* You selected\x07 Flip* Autotronic");
2546 replaceKnifeIfPossible(Client);
2547 }
2548
2549 case 575:
2550 {
2551 g_pKnifeSkin[Client] = Knife_Skin_Gut_Auto;
2552
2553 IntToString(view_as<int>(Knife_Skin_Gut_Auto), Option, sizeof(Option));
2554 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2555
2556 g_pKnife[Client] = Knife_Gut;
2557 IntToString(view_as<int>(g_pKnife[Client]), Option, sizeof(Option));
2558 SetClientCookie(Client, g_pKnifeCookie, Option);
2559
2560 PrintToChat(Client, "* You selected\x07 Gut* Autotronic");
2561 replaceKnifeIfPossible(Client);
2562 }
2563
2564 case 576:
2565 {
2566 g_pKnifeSkin[Client] = Knife_Skin_Karambit_Auto;
2567
2568 IntToString(view_as<int>(Knife_Skin_Karambit_Auto), Option, sizeof(Option));
2569 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2570
2571 g_pKnife[Client] = Knife_Karambit;
2572 IntToString(view_as<int>(g_pKnife[Client]), Option, sizeof(Option));
2573 SetClientCookie(Client, g_pKnifeCookie, Option);
2574
2575 PrintToChat(Client, "* You selected\x07 Karambit* Autotronic");
2576 replaceKnifeIfPossible(Client);
2577 }
2578
2579 case 577:
2580 {
2581 g_pKnifeSkin[Client] = Knife_Skin_M9_Bayonet_Auto;
2582
2583 IntToString(view_as<int>(Knife_Skin_M9_Bayonet_Auto), Option, sizeof(Option));
2584 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2585
2586 g_pKnife[Client] = Knife_M9;
2587 IntToString(view_as<int>(g_pKnife[Client]), Option, sizeof(Option));
2588 SetClientCookie(Client, g_pKnifeCookie, Option);
2589
2590 PrintToChat(Client, "* You selected\x07 M9 Bayonet* Autotronic");
2591 replaceKnifeIfPossible(Client);
2592 }
2593
2594 case 578:
2595 {
2596 g_pKnifeSkin[Client] = Knife_Skin_BrightWater;
2597
2598 IntToString(view_as<int>(Knife_Skin_BrightWater), Option, sizeof(Option));
2599 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2600
2601 if (g_pKnife[Client] == Knife_M9)
2602 {
2603 g_pKnifeSkin[Client] = Knife_Skin_BrightWater_M9;
2604
2605 IntToString(view_as<int>(Knife_Skin_BrightWater_M9), Option, sizeof(Option));
2606 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2607 }
2608
2609 PrintToChat(Client, "* You selected\x07 Bright Water");
2610 replaceKnifeIfPossible(Client);
2611 }
2612
2613 case 579:
2614 {
2615 g_pKnifeSkin[Client] = Knife_Skin_BrightWater_M9;
2616
2617 IntToString(view_as<int>(Knife_Skin_BrightWater_M9), Option, sizeof(Option));
2618 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2619
2620 g_pKnife[Client] = Knife_M9;
2621 IntToString(view_as<int>(g_pKnife[Client]), Option, sizeof(Option));
2622 SetClientCookie(Client, g_pKnifeCookie, Option);
2623
2624 PrintToChat(Client, "* You selected\x07 M9 Bayonet* Bright Water");
2625 replaceKnifeIfPossible(Client);
2626 }
2627
2628 case 580:
2629 {
2630 g_pKnifeSkin[Client] = Knife_Skin_FreeHand;
2631
2632 IntToString(view_as<int>(Knife_Skin_FreeHand), Option, sizeof(Option));
2633 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2634
2635 if (g_pKnife[Client] == Knife_M9)
2636 {
2637 g_pKnifeSkin[Client] = Knife_Skin_FreeHand_M9;
2638
2639 IntToString(view_as<int>(Knife_Skin_FreeHand_M9), Option, sizeof(Option));
2640 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2641 }
2642
2643 if (g_pKnife[Client] == Knife_Karambit)
2644 {
2645 g_pKnifeSkin[Client] = Knife_Skin_FreeHand_Karambit;
2646
2647 IntToString(view_as<int>(Knife_Skin_FreeHand_Karambit), Option, sizeof(Option));
2648 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2649 }
2650
2651 PrintToChat(Client, "* You selected\x07 Freehand");
2652 replaceKnifeIfPossible(Client);
2653 }
2654
2655 case 581:
2656 {
2657 g_pKnifeSkin[Client] = Knife_Skin_FreeHand_M9;
2658
2659 IntToString(view_as<int>(Knife_Skin_FreeHand_M9), Option, sizeof(Option));
2660 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2661
2662 g_pKnife[Client] = Knife_M9;
2663 IntToString(view_as<int>(g_pKnife[Client]), Option, sizeof(Option));
2664 SetClientCookie(Client, g_pKnifeCookie, Option);
2665
2666 PrintToChat(Client, "* You selected\x07 M9 Bayonet* Freehand");
2667 replaceKnifeIfPossible(Client);
2668 }
2669
2670 case 582:
2671 {
2672 g_pKnifeSkin[Client] = Knife_Skin_FreeHand_Karambit;
2673
2674 IntToString(view_as<int>(Knife_Skin_FreeHand_Karambit), Option, sizeof(Option));
2675 SetClientCookie(Client, g_pKnifeSkinCookie, Option);
2676
2677 g_pKnife[Client] = Knife_Karambit;
2678 IntToString(view_as<int>(g_pKnife[Client]), Option, sizeof(Option));
2679 SetClientCookie(Client, g_pKnifeCookie, Option);
2680
2681 PrintToChat(Client, "* You selected\x07 Karambit* Freehand");
2682 replaceKnifeIfPossible(Client);
2683 }
2684 }
2685 }
2686
2687 else if (pAction == MenuAction_End && \
2688 pMenu != INVALID_HANDLE)
2689 {
2690 CloseHandle(pMenu);
2691 pMenu = INVALID_HANDLE;
2692 }
2693}
2694
2695public int MenuHandler_Knives(Handle pMenu, MenuAction pAction, int Client, int Knife)
2696{
2697 static char Option[MAX_NAME_LENGTH / 8], Info[MAX_NAME_LENGTH / 8];
2698
2699 if (pAction == MenuAction_Select && \
2700 g_bIsInGame[Client])
2701 {
2702 GetMenuItem(pMenu, Knife, Info, sizeof(Info));
2703
2704 switch (StringToInt(Info))
2705 {
2706 case 1:
2707 {
2708 g_pKnife[Client] = Knife_Default;
2709
2710 IntToString(view_as<int>(Knife_Default), Option, sizeof(Option));
2711 SetClientCookie(Client, g_pKnifeCookie, Option);
2712
2713 PrintToChat(Client, "* You selected\x09 Default\x05 (NO CHANGE)");
2714 replaceKnifeIfPossible(Client);
2715 }
2716
2717 case 2:
2718 {
2719 g_pKnife[Client] = Knife_Bowie;
2720
2721 IntToString(view_as<int>(Knife_Bowie), Option, sizeof(Option));
2722 SetClientCookie(Client, g_pKnifeCookie, Option);
2723
2724 PrintToChat(Client, "* You selected\x07 ★ Bowie (SURViVAL)\x01. You can also type\x04 WS\x01 now.");
2725 replaceKnifeIfPossible(Client);
2726 }
2727
2728 case 3:
2729 {
2730 g_pKnife[Client] = Knife_Push;
2731
2732 IntToString(view_as<int>(Knife_Push), Option, sizeof(Option));
2733 SetClientCookie(Client, g_pKnifeCookie, Option);
2734
2735 PrintToChat(Client, "* You selected\x07 ★ Shadow Daggers\x05 (PUSH)\x01. You can also type\x04 WS\x01 now.");
2736 replaceKnifeIfPossible(Client);
2737 }
2738
2739 case 4:
2740 {
2741 g_pKnife[Client] = Knife_M9;
2742
2743 IntToString(view_as<int>(Knife_M9), Option, sizeof(Option));
2744 SetClientCookie(Client, g_pKnifeCookie, Option);
2745
2746 PrintToChat(Client, "* You selected\x07 ★ M9 Bayonet\x01. You can also type\x04 WS\x01 now.");
2747 replaceKnifeIfPossible(Client);
2748 }
2749
2750 case 5:
2751 {
2752 g_pKnife[Client] = Knife_Karambit;
2753
2754 IntToString(view_as<int>(Knife_Karambit), Option, sizeof(Option));
2755 SetClientCookie(Client, g_pKnifeCookie, Option);
2756
2757 PrintToChat(Client, "* You selected\x07 ★ Karambit\x01. You can also type\x04 WS\x01 now.");
2758 replaceKnifeIfPossible(Client);
2759 }
2760
2761 case 6:
2762 {
2763 g_pKnife[Client] = Knife_Bayonet;
2764
2765 IntToString(view_as<int>(Knife_Bayonet), Option, sizeof(Option));
2766 SetClientCookie(Client, g_pKnifeCookie, Option);
2767
2768 PrintToChat(Client, "* You selected\x07 ★ Bayonet\x01. You can also type\x04 WS\x01 now.");
2769 replaceKnifeIfPossible(Client);
2770 }
2771
2772 case 7:
2773 {
2774 g_pKnife[Client] = Knife_Tactical;
2775
2776 IntToString(view_as<int>(Knife_Tactical), Option, sizeof(Option));
2777 SetClientCookie(Client, g_pKnifeCookie, Option);
2778
2779 PrintToChat(Client, "* You selected\x07 ★ Huntsman\x05 (TACTiCAL)\x01. You can also type\x04 WS\x01 now.");
2780 replaceKnifeIfPossible(Client);
2781 }
2782
2783 case 8:
2784 {
2785 g_pKnife[Client] = Knife_Butterfly;
2786
2787 IntToString(view_as<int>(Knife_Butterfly), Option, sizeof(Option));
2788 SetClientCookie(Client, g_pKnifeCookie, Option);
2789
2790 PrintToChat(Client, "* You selected\x07 ★ Butterfly\x01. You can also type\x04 WS\x01 now.");
2791 replaceKnifeIfPossible(Client);
2792 }
2793
2794 case 9:
2795 {
2796 g_pKnife[Client] = Knife_Gut;
2797
2798 IntToString(view_as<int>(Knife_Gut), Option, sizeof(Option));
2799 SetClientCookie(Client, g_pKnifeCookie, Option);
2800
2801 PrintToChat(Client, "* You selected\x07 ★ Gut\x01. You can also type\x04 WS\x01 now.");
2802 replaceKnifeIfPossible(Client);
2803 }
2804
2805 case 10:
2806 {
2807 g_pKnife[Client] = Knife_Flip;
2808
2809 IntToString(view_as<int>(Knife_Flip), Option, sizeof(Option));
2810 SetClientCookie(Client, g_pKnifeCookie, Option);
2811
2812 PrintToChat(Client, "* You selected\x07 ★ Flip\x01. You can also type\x04 WS\x01 now.");
2813 replaceKnifeIfPossible(Client);
2814 }
2815
2816 case 11:
2817 {
2818 g_pKnife[Client] = Knife_Falchion;
2819
2820 IntToString(view_as<int>(Knife_Falchion), Option, sizeof(Option));
2821 SetClientCookie(Client, g_pKnifeCookie, Option);
2822
2823 PrintToChat(Client, "* You selected\x07 ★ Falchion\x01. You can also type\x04 WS\x01 now.");
2824 replaceKnifeIfPossible(Client);
2825 }
2826 }
2827 }
2828
2829 else if (pAction == MenuAction_End && \
2830 pMenu != INVALID_HANDLE)
2831 {
2832 CloseHandle(pMenu);
2833 pMenu = INVALID_HANDLE;
2834 }
2835}
2836
2837public int __EquipKnife(Handle pPlugin, int iParams)
2838{
2839 static int iId = INVALID_ENT_REFERENCE, Entity, Id;
2840 static char Class[MAX_NAME_LENGTH] = "";
2841
2842 iId = GetNativeCell(1);
2843
2844 if (IsClientInGame(iId) && IsPlayerAlive(iId))
2845 {
2846 if (g_iFakeClient != INVALID_ENT_REFERENCE)
2847 {
2848 KnifeClassByOption(iId, Class, sizeof(Class));
2849 Entity = GivePlayerItem(g_pKnife[iId] == Knife_None || g_pKnife[iId] == Knife_Default ? \
2850 iId : g_iFakeClient, Class);
2851
2852 if (Entity != INVALID_ENT_REFERENCE)
2853 {
2854 Id = IDIByClass(Class);
2855
2856 if (g_pKnife[iId] != Knife_None && g_pKnife[iId] != Knife_Default)
2857 SetEntProp(Entity, Prop_Send, "m_iItemDefinitionIndex", Id);
2858
2859 applyKnifeData(iId, Entity, Id);
2860 EquipPlayerWeapon(iId, Entity);
2861 }
2862 }
2863 }
2864}
2865
2866public Action Timer_ReplaceKnife(Handle pTimer, any _Data)
2867{
2868 static int iId = INVALID_ENT_REFERENCE;
2869 static bool bSkipInRound = false;
2870
2871 ResetPack(_Data);
2872
2873 iId = ReadPackCell(_Data);
2874 bSkipInRound = ReadPackCell(_Data) ? true : false;
2875
2876 CloseHandle(_Data);
2877 _Data = INVALID_HANDLE;
2878
2879 replaceKnifeIfPossible(iId, bSkipInRound);
2880}
2881
2882void replaceKnifeIfPossible(int Client, bool bSkipInRound = false)
2883{
2884 static char Class[MAX_NAME_LENGTH];
2885 static int Entity, Tries, Id;
2886 static float fGameTime = 0.0;
2887 static Handle pData = INVALID_HANDLE;
2888
2889 if ((bSkipInRound == false || g_bIsInRound) && Client >= 1 && Client <= MaxClients && IsClientInGame(Client) && IsPlayerAlive(Client))
2890 {
2891 fGameTime = GetEngineTime();
2892
2893 if (fGameTime - g_fDelay < 0.075)
2894 {
2895 pData = CreateDataPack();
2896
2897 if (pData != INVALID_HANDLE)
2898 {
2899 WritePackCell(pData, Client);
2900 WritePackCell(pData, bSkipInRound ? 1 : 0);
2901
2902 CreateTimer(GetRandomFloat(0.05, 0.075), Timer_ReplaceKnife, pData);
2903 }
2904 }
2905
2906 else
2907 {
2908 Entity = INVALID_ENT_REFERENCE;
2909 Tries = 0;
2910
2911 while ((Entity = GetPlayerWeaponSlot(Client, CS_SLOT_KNIFE)) != INVALID_ENT_REFERENCE)
2912 {
2913 if (GetEdictClassname(Entity, Class, sizeof(Class)) && \
2914 (StrContains(Class, "Knife", false) != -1 || \
2915 StrContains(Class, "Bayonet", false) != -1))
2916 {
2917 if (RemovePlayerItem(Client, Entity))
2918 {
2919 my_Remove(Entity);
2920
2921 if (g_iFakeClient != INVALID_ENT_REFERENCE)
2922 {
2923 KnifeClassByOption(Client, Class, sizeof(Class));
2924 Entity = GivePlayerItem(g_pKnife[Client] == Knife_None || g_pKnife[Client] == Knife_Default ? \
2925 Client : g_iFakeClient, Class);
2926
2927 if (Entity != INVALID_ENT_REFERENCE)
2928 {
2929 Id = IDIByClass(Class);
2930
2931 if (g_pKnife[Client] != Knife_None && g_pKnife[Client] != Knife_Default)
2932 SetEntProp(Entity, Prop_Send, "m_iItemDefinitionIndex", Id);
2933
2934 applyKnifeData(Client, Entity, Id);
2935 EquipPlayerWeapon(Client, Entity);
2936 }
2937 }
2938 }
2939
2940 break;
2941 }
2942
2943 if (++Tries >= 4)
2944 break;
2945 }
2946
2947 SaveMe(Client);
2948
2949 g_fDelay = fGameTime;
2950 }
2951 }
2952}
2953
2954public Action TimerHandler_DisplaySkinsMenu(Handle pTimer, any Client)
2955{
2956 static Handle pMenu;
2957 static int WeaponId, Id, Iter;
2958 static char Buffer[PLATFORM_MAX_PATH], Info[MAX_NAME_LENGTH / 4], \
2959 Class[MAX_NAME_LENGTH];
2960
2961 if (g_bIsInGame[Client] && !IsFakeClient(Client) && !IsClientSourceTV(Client))
2962 {
2963 if (IsPlayerAlive(Client))
2964 WeaponId = GetEntPropEnt(Client, Prop_Send, "m_hActiveWeapon");
2965
2966 else
2967 WeaponId = INVALID_ENT_REFERENCE;
2968
2969 if (g_pKnifeSkin[Client] == Knife_Skin_None)
2970 {
2971 PrintToChat(Client, "* FiRST, PiCK UP A\x07 KNiFE\x05 PAiNT KiT\x09 OPTiON");
2972
2973 pMenu = CreateMenu(MenuHandler_KnifeSkins);
2974
2975 if (pMenu != INVALID_HANDLE)
2976 {
2977 SetMenuTitle(pMenu, "★ SELECT KNiFE SKiN ★");
2978
2979 AddMenuItem(pMenu, "-1", "» RANDOM «");
2980 AddMenuItem(pMenu, "0", "» DEFAULT «");
2981
2982 AddMenuItem(pMenu, "411", "M9 Bayonet* Damascus Steel");
2983 AddMenuItem(pMenu, "562", "M9 Bayonet* Lore");
2984 AddMenuItem(pMenu, "567", "M9 Bayonet* Black Laminate");
2985 AddMenuItem(pMenu, "577", "M9 Bayonet* Autotronic");
2986 AddMenuItem(pMenu, "579", "M9 Bayonet* Bright Water");
2987 AddMenuItem(pMenu, "581", "M9 Bayonet* Freehand");
2988
2989 AddMenuItem(pMenu, "558", "Bayonet* Lore");
2990 AddMenuItem(pMenu, "563", "Bayonet* Black Laminate");
2991 AddMenuItem(pMenu, "573", "Bayonet* Autotronic");
2992
2993 AddMenuItem(pMenu, "559", "Flip* Lore");
2994 AddMenuItem(pMenu, "564", "Flip* Black Laminate");
2995 AddMenuItem(pMenu, "574", "Flip* Autotronic");
2996
2997 AddMenuItem(pMenu, "560", "Gut* Lore");
2998 AddMenuItem(pMenu, "565", "Gut* Black Laminate");
2999 AddMenuItem(pMenu, "575", "Gut* Autotronic");
3000
3001 AddMenuItem(pMenu, "561", "Karambit* Lore");
3002 AddMenuItem(pMenu, "566", "Karambit* Black Laminate");
3003 AddMenuItem(pMenu, "576", "Karambit* Autotronic");
3004 AddMenuItem(pMenu, "582", "Karambit* Freehand");
3005
3006 AddMenuItem(pMenu, "580", "Any* Freehand");
3007 AddMenuItem(pMenu, "578", "Any* Bright Water");
3008
3009 AddMenuItem(pMenu, "569", "Any* G. Doppler Phase #1");
3010 AddMenuItem(pMenu, "570", "Any* G. Doppler Phase #2");
3011 AddMenuItem(pMenu, "571", "Any* G. Doppler Phase #3");
3012 AddMenuItem(pMenu, "572", "Any* G. Doppler Phase #4");
3013 AddMenuItem(pMenu, "568", "Any* G. Doppler (Emerald)");
3014
3015 AddMenuItem(pMenu, "418", "Any* Doppler Phase #1");
3016 AddMenuItem(pMenu, "419", "Any* Doppler Phase #2");
3017 AddMenuItem(pMenu, "420", "Any* Doppler Phase #3");
3018 AddMenuItem(pMenu, "421", "Any* Doppler Phase #4");
3019 AddMenuItem(pMenu, "415", "Any* Doppler (Ruby)");
3020 AddMenuItem(pMenu, "416", "Any* Doppler (Sapphire)");
3021 AddMenuItem(pMenu, "417", "Any* Doppler (Blackpearl)");
3022
3023 AddMenuItem(pMenu, "38", "Any* Fade");
3024 AddMenuItem(pMenu, "413", "Any* Marble Fade");
3025 AddMenuItem(pMenu, "44", "Any* Case Hardened");
3026 AddMenuItem(pMenu, "59", "Any* Slaughter");
3027 AddMenuItem(pMenu, "12", "Any* Crimson Web");
3028 AddMenuItem(pMenu, "232", "Any* Crimson Web (Darker)");
3029 AddMenuItem(pMenu, "98", "Any* Ultraviolet");
3030 AddMenuItem(pMenu, "40", "Any* Night");
3031 AddMenuItem(pMenu, "5", "Any* Forest DDPAT");
3032 AddMenuItem(pMenu, "77", "Any* Boreal Forest");
3033 AddMenuItem(pMenu, "42", "Any* Blue Steel");
3034 AddMenuItem(pMenu, "410", "Any* Damascus Steel");
3035 AddMenuItem(pMenu, "43", "Any* Stained");
3036 AddMenuItem(pMenu, "72", "Any* Safari Mesh");
3037 AddMenuItem(pMenu, "143", "Any* Urban Masked");
3038 AddMenuItem(pMenu, "175", "Any* Scorched");
3039 AddMenuItem(pMenu, "414", "Any* Rust Coat");
3040 AddMenuItem(pMenu, "409", "Any* Tiger Tooth");
3041
3042 DisplayMenu(pMenu, Client, MENU_TIME_FOREVER);
3043 }
3044 }
3045
3046 else if (WeaponId != INVALID_ENT_REFERENCE && \
3047 GetEdictClassname(WeaponId, Class, sizeof(Class)) && \
3048 (StrContains(Class, "Knife", false) != -1 || StrContains(Class, "Bayonet", false) != -1))
3049 {
3050 pMenu = CreateMenu(MenuHandler_KnifeSkins);
3051
3052 if (g_pKnife[Client] == Knife_None)
3053 {
3054 if (pMenu != INVALID_HANDLE)
3055 {
3056 SetMenuTitle(pMenu, "★ SELECT KNiFE SKiN ★");
3057
3058 AddMenuItem(pMenu, "-1", "» RANDOM «");
3059 AddMenuItem(pMenu, "0", "» DEFAULT «");
3060
3061 AddMenuItem(pMenu, "411", "M9 Bayonet* Damascus Steel");
3062 AddMenuItem(pMenu, "562", "M9 Bayonet* Lore");
3063 AddMenuItem(pMenu, "567", "M9 Bayonet* Black Laminate");
3064 AddMenuItem(pMenu, "577", "M9 Bayonet* Autotronic");
3065 AddMenuItem(pMenu, "579", "M9 Bayonet* Bright Water");
3066 AddMenuItem(pMenu, "581", "M9 Bayonet* Freehand");
3067
3068 AddMenuItem(pMenu, "558", "Bayonet* Lore");
3069 AddMenuItem(pMenu, "563", "Bayonet* Black Laminate");
3070 AddMenuItem(pMenu, "573", "Bayonet* Autotronic");
3071
3072 AddMenuItem(pMenu, "559", "Flip* Lore");
3073 AddMenuItem(pMenu, "564", "Flip* Black Laminate");
3074 AddMenuItem(pMenu, "574", "Flip* Autotronic");
3075
3076 AddMenuItem(pMenu, "560", "Gut* Lore");
3077 AddMenuItem(pMenu, "565", "Gut* Black Laminate");
3078 AddMenuItem(pMenu, "575", "Gut* Autotronic");
3079
3080 AddMenuItem(pMenu, "561", "Karambit* Lore");
3081 AddMenuItem(pMenu, "566", "Karambit* Black Laminate");
3082 AddMenuItem(pMenu, "576", "Karambit* Autotronic");
3083 AddMenuItem(pMenu, "582", "Karambit* Freehand");
3084
3085 AddMenuItem(pMenu, "580", "Any* Freehand");
3086 AddMenuItem(pMenu, "578", "Any* Bright Water");
3087
3088 AddMenuItem(pMenu, "569", "Any* G. Doppler Phase #1");
3089 AddMenuItem(pMenu, "570", "Any* G. Doppler Phase #2");
3090 AddMenuItem(pMenu, "571", "Any* G. Doppler Phase #3");
3091 AddMenuItem(pMenu, "572", "Any* G. Doppler Phase #4");
3092 AddMenuItem(pMenu, "568", "Any* G. Doppler (Emerald)");
3093
3094 AddMenuItem(pMenu, "418", "Any* Doppler Phase #1");
3095 AddMenuItem(pMenu, "419", "Any* Doppler Phase #2");
3096 AddMenuItem(pMenu, "420", "Any* Doppler Phase #3");
3097 AddMenuItem(pMenu, "421", "Any* Doppler Phase #4");
3098 AddMenuItem(pMenu, "415", "Any* Doppler (Ruby)");
3099 AddMenuItem(pMenu, "416", "Any* Doppler (Sapphire)");
3100 AddMenuItem(pMenu, "417", "Any* Doppler (Blackpearl)");
3101
3102 AddMenuItem(pMenu, "38", "Any* Fade");
3103 AddMenuItem(pMenu, "413", "Any* Marble Fade");
3104 AddMenuItem(pMenu, "44", "Any* Case Hardened");
3105 AddMenuItem(pMenu, "59", "Any* Slaughter");
3106 AddMenuItem(pMenu, "12", "Any* Crimson Web");
3107 AddMenuItem(pMenu, "232", "Any* Crimson Web (Darker)");
3108 AddMenuItem(pMenu, "98", "Any* Ultraviolet");
3109 AddMenuItem(pMenu, "40", "Any* Night");
3110 AddMenuItem(pMenu, "5", "Any* Forest DDPAT");
3111 AddMenuItem(pMenu, "77", "Any* Boreal Forest");
3112 AddMenuItem(pMenu, "42", "Any* Blue Steel");
3113 AddMenuItem(pMenu, "410", "Any* Damascus Steel");
3114 AddMenuItem(pMenu, "43", "Any* Stained");
3115 AddMenuItem(pMenu, "72", "Any* Safari Mesh");
3116 AddMenuItem(pMenu, "143", "Any* Urban Masked");
3117 AddMenuItem(pMenu, "175", "Any* Scorched");
3118 AddMenuItem(pMenu, "414", "Any* Rust Coat");
3119 AddMenuItem(pMenu, "409", "Any* Tiger Tooth");
3120
3121 DisplayMenu(pMenu, Client, MENU_TIME_FOREVER);
3122 }
3123 }
3124
3125 else
3126 {
3127 if (pMenu != INVALID_HANDLE)
3128 {
3129 SetMenuTitle(pMenu, "★ SELECT KNiFE SKiN ★");
3130
3131 AddMenuItem(pMenu, "-1", "» RANDOM «");
3132 AddMenuItem(pMenu, "0", "» DEFAULT «");
3133
3134 if (g_pKnife[Client] == Knife_M9)
3135 {
3136 AddMenuItem(pMenu, "411", "M9 Bayonet* Damascus Steel");
3137 AddMenuItem(pMenu, "562", "M9 Bayonet* Lore");
3138 AddMenuItem(pMenu, "567", "M9 Bayonet* Black Laminate");
3139 AddMenuItem(pMenu, "577", "M9 Bayonet* Autotronic");
3140 AddMenuItem(pMenu, "579", "M9 Bayonet* Bright Water");
3141 AddMenuItem(pMenu, "581", "M9 Bayonet* Freehand");
3142 }
3143
3144 if (g_pKnife[Client] == Knife_Bayonet)
3145 {
3146 AddMenuItem(pMenu, "558", "Bayonet* Lore");
3147 AddMenuItem(pMenu, "563", "Bayonet* Black Laminate");
3148 AddMenuItem(pMenu, "573", "Bayonet* Autotronic");
3149 }
3150
3151 if (g_pKnife[Client] == Knife_Flip)
3152 {
3153 AddMenuItem(pMenu, "559", "Flip* Lore");
3154 AddMenuItem(pMenu, "564", "Flip* Black Laminate");
3155 AddMenuItem(pMenu, "574", "Flip* Autotronic");
3156 }
3157
3158 if (g_pKnife[Client] == Knife_Gut)
3159 {
3160 AddMenuItem(pMenu, "560", "Gut* Lore");
3161 AddMenuItem(pMenu, "565", "Gut* Black Laminate");
3162 AddMenuItem(pMenu, "575", "Gut* Autotronic");
3163 }
3164
3165 if (g_pKnife[Client] == Knife_Karambit)
3166 {
3167 AddMenuItem(pMenu, "561", "Karambit* Lore");
3168 AddMenuItem(pMenu, "566", "Karambit* Black Laminate");
3169 AddMenuItem(pMenu, "576", "Karambit* Autotronic");
3170 AddMenuItem(pMenu, "582", "Karambit* Freehand");
3171 }
3172
3173 AddMenuItem(pMenu, "580", "Any* Freehand");
3174 AddMenuItem(pMenu, "578", "Any* Bright Water");
3175
3176 AddMenuItem(pMenu, "569", "Any* G. Doppler Phase #1");
3177 AddMenuItem(pMenu, "570", "Any* G. Doppler Phase #2");
3178 AddMenuItem(pMenu, "571", "Any* G. Doppler Phase #3");
3179 AddMenuItem(pMenu, "572", "Any* G. Doppler Phase #4");
3180 AddMenuItem(pMenu, "568", "Any* G. Doppler (Emerald)");
3181
3182 AddMenuItem(pMenu, "418", "Any* Doppler Phase #1");
3183 AddMenuItem(pMenu, "419", "Any* Doppler Phase #2");
3184 AddMenuItem(pMenu, "420", "Any* Doppler Phase #3");
3185 AddMenuItem(pMenu, "421", "Any* Doppler Phase #4");
3186 AddMenuItem(pMenu, "415", "Any* Doppler (Ruby)");
3187 AddMenuItem(pMenu, "416", "Any* Doppler (Sapphire)");
3188 AddMenuItem(pMenu, "417", "Any* Doppler (Blackpearl)");
3189
3190 AddMenuItem(pMenu, "38", "Any* Fade");
3191 AddMenuItem(pMenu, "413", "Any* Marble Fade");
3192 AddMenuItem(pMenu, "44", "Any* Case Hardened");
3193 AddMenuItem(pMenu, "59", "Any* Slaughter");
3194 AddMenuItem(pMenu, "12", "Any* Crimson Web");
3195 AddMenuItem(pMenu, "232", "Any* Crimson Web (Darker)");
3196 AddMenuItem(pMenu, "98", "Any* Ultraviolet");
3197 AddMenuItem(pMenu, "40", "Any* Night");
3198 AddMenuItem(pMenu, "5", "Any* Forest DDPAT");
3199 AddMenuItem(pMenu, "77", "Any* Boreal Forest");
3200 AddMenuItem(pMenu, "42", "Any* Blue Steel");
3201 AddMenuItem(pMenu, "410", "Any* Damascus Steel");
3202 AddMenuItem(pMenu, "43", "Any* Stained");
3203 AddMenuItem(pMenu, "72", "Any* Safari Mesh");
3204 AddMenuItem(pMenu, "143", "Any* Urban Masked");
3205 AddMenuItem(pMenu, "175", "Any* Scorched");
3206 AddMenuItem(pMenu, "414", "Any* Rust Coat");
3207 AddMenuItem(pMenu, "409", "Any* Tiger Tooth");
3208
3209 DisplayMenu(pMenu, Client, MENU_TIME_FOREVER);
3210 }
3211 }
3212 }
3213
3214 else if (!IsPlayerAlive(Client))
3215 PrintToChat(Client, "* You must be\x05 Alive");
3216
3217 else
3218 {
3219 if (WeaponId == INVALID_ENT_REFERENCE)
3220 PrintToChat(Client, "* You must have an\x05 Active\x09 Weapon");
3221
3222 else
3223 {
3224 Id = GetEntProp(WeaponId, Prop_Send, "m_iItemDefinitionIndex");
3225
3226 pMenu = CreateMenu(MenuHandler_Skins);
3227
3228 if (pMenu != INVALID_HANDLE)
3229 {
3230 switch (Id)
3231 {
3232 case 4:
3233 {
3234 SetMenuTitle(pMenu, "Select Glock-18 Skin");
3235
3236 for (Iter = 0; Iter < sizeof(g_Glock18Skins); Iter++)
3237 FormatEx(Buffer, sizeof(Buffer), g_Glock18Skins[Iter]),
3238 IntToString(Iter, Info, sizeof(Info)),
3239 AddMenuItem(pMenu, Info, Buffer);
3240 }
3241 case 2:
3242 {
3243 SetMenuTitle(pMenu, "Select Dual Berettas Skin");
3244
3245 for (Iter = 0; Iter < sizeof(g_DualBerettasSkins); Iter++)
3246 FormatEx(Buffer, sizeof(Buffer), g_DualBerettasSkins[Iter]),
3247 IntToString(Iter, Info, sizeof(Info)),
3248 AddMenuItem(pMenu, Info, Buffer);
3249 }
3250 case 36:
3251 {
3252 SetMenuTitle(pMenu, "Select P250 Skin");
3253
3254 for (Iter = 0; Iter < sizeof(g_P250Skins); Iter++)
3255 FormatEx(Buffer, sizeof(Buffer), g_P250Skins[Iter]),
3256 IntToString(Iter, Info, sizeof(Info)),
3257 AddMenuItem(pMenu, Info, Buffer);
3258 }
3259 case 30:
3260 {
3261 SetMenuTitle(pMenu, "Select Tec-9 Skin");
3262
3263 for (Iter = 0; Iter < sizeof(g_Tec9Skins); Iter++)
3264 FormatEx(Buffer, sizeof(Buffer), g_Tec9Skins[Iter]),
3265 IntToString(Iter, Info, sizeof(Info)),
3266 AddMenuItem(pMenu, Info, Buffer);
3267 }
3268 case 1:
3269 {
3270 SetMenuTitle(pMenu, "Select Desert Eagle Skin");
3271
3272 for (Iter = 0; Iter < sizeof(g_DEagleSkins); Iter++)
3273 FormatEx(Buffer, sizeof(Buffer), g_DEagleSkins[Iter]),
3274 IntToString(Iter, Info, sizeof(Info)),
3275 AddMenuItem(pMenu, Info, Buffer);
3276 }
3277 case 35:
3278 {
3279 SetMenuTitle(pMenu, "Select Nova Skin");
3280
3281 for (Iter = 0; Iter < sizeof(g_NovaSkins); Iter++)
3282 FormatEx(Buffer, sizeof(Buffer), g_NovaSkins[Iter]),
3283 IntToString(Iter, Info, sizeof(Info)),
3284 AddMenuItem(pMenu, Info, Buffer);
3285 }
3286 case 25:
3287 {
3288 SetMenuTitle(pMenu, "Select XM1014 Skin");
3289
3290 for (Iter = 0; Iter < sizeof(g_XM1014Skins); Iter++)
3291 FormatEx(Buffer, sizeof(Buffer), g_XM1014Skins[Iter]),
3292 IntToString(Iter, Info, sizeof(Info)),
3293 AddMenuItem(pMenu, Info, Buffer);
3294 }
3295 case 29:
3296 {
3297 SetMenuTitle(pMenu, "Select Sawed-Off Skin");
3298
3299 for (Iter = 0; Iter < sizeof(g_SawedOffSkins); Iter++)
3300 FormatEx(Buffer, sizeof(Buffer), g_SawedOffSkins[Iter]),
3301 IntToString(Iter, Info, sizeof(Info)),
3302 AddMenuItem(pMenu, Info, Buffer);
3303 }
3304 case 14:
3305 {
3306 SetMenuTitle(pMenu, "Select M249 Skin");
3307
3308 for (Iter = 0; Iter < sizeof(g_M249Skins); Iter++)
3309 FormatEx(Buffer, sizeof(Buffer), g_M249Skins[Iter]),
3310 IntToString(Iter, Info, sizeof(Info)),
3311 AddMenuItem(pMenu, Info, Buffer);
3312 }
3313 case 28:
3314 {
3315 SetMenuTitle(pMenu, "Select Negev Skin");
3316
3317 for (Iter = 0; Iter < sizeof(g_NegevSkins); Iter++)
3318 FormatEx(Buffer, sizeof(Buffer), g_NegevSkins[Iter]),
3319 IntToString(Iter, Info, sizeof(Info)),
3320 AddMenuItem(pMenu, Info, Buffer);
3321 }
3322 case 17:
3323 {
3324 SetMenuTitle(pMenu, "Select MAC-10 Skin");
3325
3326 for (Iter = 0; Iter < sizeof(g_Mac10Skins); Iter++)
3327 FormatEx(Buffer, sizeof(Buffer), g_Mac10Skins[Iter]),
3328 IntToString(Iter, Info, sizeof(Info)),
3329 AddMenuItem(pMenu, Info, Buffer);
3330 }
3331 case 33:
3332 {
3333 SetMenuTitle(pMenu, "Select MP7 Skin");
3334
3335 for (Iter = 0; Iter < sizeof(g_Mp7Skins); Iter++)
3336 FormatEx(Buffer, sizeof(Buffer), g_Mp7Skins[Iter]),
3337 IntToString(Iter, Info, sizeof(Info)),
3338 AddMenuItem(pMenu, Info, Buffer);
3339 }
3340 case 24:
3341 {
3342 SetMenuTitle(pMenu, "Select UMP-45 Skin");
3343
3344 for (Iter = 0; Iter < sizeof(g_Ump45Skins); Iter++)
3345 FormatEx(Buffer, sizeof(Buffer), g_Ump45Skins[Iter]),
3346 IntToString(Iter, Info, sizeof(Info)),
3347 AddMenuItem(pMenu, Info, Buffer);
3348 }
3349 case 19:
3350 {
3351 SetMenuTitle(pMenu, "Select P90 Skin");
3352
3353 for (Iter = 0; Iter < sizeof(g_P90Skins); Iter++)
3354 FormatEx(Buffer, sizeof(Buffer), g_P90Skins[Iter]),
3355 IntToString(Iter, Info, sizeof(Info)),
3356 AddMenuItem(pMenu, Info, Buffer);
3357 }
3358 case 26:
3359 {
3360 SetMenuTitle(pMenu, "Select PP-Bizon Skin");
3361
3362 for (Iter = 0; Iter < sizeof(g_PPBizonSkins); Iter++)
3363 FormatEx(Buffer, sizeof(Buffer), g_PPBizonSkins[Iter]),
3364 IntToString(Iter, Info, sizeof(Info)),
3365 AddMenuItem(pMenu, Info, Buffer);
3366 }
3367 case 13:
3368 {
3369 SetMenuTitle(pMenu, "Select Galil AR Skin");
3370
3371 for (Iter = 0; Iter < sizeof(g_GalilARSkins); Iter++)
3372 FormatEx(Buffer, sizeof(Buffer), g_GalilARSkins[Iter]),
3373 IntToString(Iter, Info, sizeof(Info)),
3374 AddMenuItem(pMenu, Info, Buffer);
3375 }
3376 case 7:
3377 {
3378 SetMenuTitle(pMenu, "Select AK-47 Skin");
3379
3380 for (Iter = 0; Iter < sizeof(g_Ak47Skins); Iter++)
3381 FormatEx(Buffer, sizeof(Buffer), g_Ak47Skins[Iter]),
3382 IntToString(Iter, Info, sizeof(Info)),
3383 AddMenuItem(pMenu, Info, Buffer);
3384 }
3385 case 40:
3386 {
3387 SetMenuTitle(pMenu, "Select SSG 08 Skin");
3388
3389 for (Iter = 0; Iter < sizeof(g_SSG08Skins); Iter++)
3390 FormatEx(Buffer, sizeof(Buffer), g_SSG08Skins[Iter]),
3391 IntToString(Iter, Info, sizeof(Info)),
3392 AddMenuItem(pMenu, Info, Buffer);
3393 }
3394 case 39:
3395 {
3396 SetMenuTitle(pMenu, "Select SG 553 Skin");
3397
3398 for (Iter = 0; Iter < sizeof(g_SG553Skins); Iter++)
3399 FormatEx(Buffer, sizeof(Buffer), g_SG553Skins[Iter]),
3400 IntToString(Iter, Info, sizeof(Info)),
3401 AddMenuItem(pMenu, Info, Buffer);
3402 }
3403 case 9:
3404 {
3405 SetMenuTitle(pMenu, "Select AWP Skin");
3406
3407 for (Iter = 0; Iter < sizeof(g_AwpSkins); Iter++)
3408 FormatEx(Buffer, sizeof(Buffer), g_AwpSkins[Iter]),
3409 IntToString(Iter, Info, sizeof(Info)),
3410 AddMenuItem(pMenu, Info, Buffer);
3411 }
3412 case 11:
3413 {
3414 SetMenuTitle(pMenu, "Select G3SG1 Skin");
3415
3416 for (Iter = 0; Iter < sizeof(g_G3SG1Skins); Iter++)
3417 FormatEx(Buffer, sizeof(Buffer), g_G3SG1Skins[Iter]),
3418 IntToString(Iter, Info, sizeof(Info)),
3419 AddMenuItem(pMenu, Info, Buffer);
3420 }
3421 case 61:
3422 {
3423 SetMenuTitle(pMenu, "Select USP-S Skin");
3424
3425 for (Iter = 0; Iter < sizeof(g_UspSkins); Iter++)
3426 FormatEx(Buffer, sizeof(Buffer), g_UspSkins[Iter]),
3427 IntToString(Iter, Info, sizeof(Info)),
3428 AddMenuItem(pMenu, Info, Buffer);
3429 }
3430 case 3:
3431 {
3432 SetMenuTitle(pMenu, "Select Five-SeveN Skin");
3433
3434 for (Iter = 0; Iter < sizeof(g_FiveSeveNSKins); Iter++)
3435 FormatEx(Buffer, sizeof(Buffer), g_FiveSeveNSKins[Iter]),
3436 IntToString(Iter, Info, sizeof(Info)),
3437 AddMenuItem(pMenu, Info, Buffer);
3438 }
3439 case 27:
3440 {
3441 SetMenuTitle(pMenu, "Select MAG-7 Skin");
3442
3443 for (Iter = 0; Iter < sizeof(g_Mag7Skins); Iter++)
3444 FormatEx(Buffer, sizeof(Buffer), g_Mag7Skins[Iter]),
3445 IntToString(Iter, Info, sizeof(Info)),
3446 AddMenuItem(pMenu, Info, Buffer);
3447 }
3448 case 34:
3449 {
3450 SetMenuTitle(pMenu, "Select MP9 Skin");
3451
3452 for (Iter = 0; Iter < sizeof(g_Mp9Skins); Iter++)
3453 FormatEx(Buffer, sizeof(Buffer), g_Mp9Skins[Iter]),
3454 IntToString(Iter, Info, sizeof(Info)),
3455 AddMenuItem(pMenu, Info, Buffer);
3456 }
3457 case 10:
3458 {
3459 SetMenuTitle(pMenu, "Select FAMAS Skin");
3460
3461 for (Iter = 0; Iter < sizeof(g_FamasSkins); Iter++)
3462 FormatEx(Buffer, sizeof(Buffer), g_FamasSkins[Iter]),
3463 IntToString(Iter, Info, sizeof(Info)),
3464 AddMenuItem(pMenu, Info, Buffer);
3465 }
3466 case 60:
3467 {
3468 SetMenuTitle(pMenu, "Select M4A1-S Skin");
3469
3470 for (Iter = 0; Iter < sizeof(g_M4A1Skins); Iter++)
3471 FormatEx(Buffer, sizeof(Buffer), g_M4A1Skins[Iter]),
3472 IntToString(Iter, Info, sizeof(Info)),
3473 AddMenuItem(pMenu, Info, Buffer);
3474 }
3475 case 8:
3476 {
3477 SetMenuTitle(pMenu, "Select AUG Skin");
3478
3479 for (Iter = 0; Iter < sizeof(g_AugSkins); Iter++)
3480 FormatEx(Buffer, sizeof(Buffer), g_AugSkins[Iter]),
3481 IntToString(Iter, Info, sizeof(Info)),
3482 AddMenuItem(pMenu, Info, Buffer);
3483 }
3484 case 38:
3485 {
3486 SetMenuTitle(pMenu, "Select SCAR-20 Skin");
3487
3488 for (Iter = 0; Iter < sizeof(g_Scar20Skins); Iter++)
3489 FormatEx(Buffer, sizeof(Buffer), g_Scar20Skins[Iter]),
3490 IntToString(Iter, Info, sizeof(Info)),
3491 AddMenuItem(pMenu, Info, Buffer);
3492 }
3493 case 32:
3494 {
3495 SetMenuTitle(pMenu, "Select P2000 Skin");
3496
3497 for (Iter = 0; Iter < sizeof(g_P2000Skins); Iter++)
3498 FormatEx(Buffer, sizeof(Buffer), g_P2000Skins[Iter]),
3499 IntToString(Iter, Info, sizeof(Info)),
3500 AddMenuItem(pMenu, Info, Buffer);
3501 }
3502 case 16:
3503 {
3504 SetMenuTitle(pMenu, "Select M4A4 Skin");
3505
3506 for (Iter = 0; Iter < sizeof(g_M4A4Skins); Iter++)
3507 FormatEx(Buffer, sizeof(Buffer), g_M4A4Skins[Iter]),
3508 IntToString(Iter, Info, sizeof(Info)),
3509 AddMenuItem(pMenu, Info, Buffer);
3510 }
3511 case 63:
3512 {
3513 SetMenuTitle(pMenu, "Select CZ75-Auto Skin");
3514
3515 for (Iter = 0; Iter < sizeof(g_CZ75AutoSkins); Iter++)
3516 FormatEx(Buffer, sizeof(Buffer), g_CZ75AutoSkins[Iter]),
3517 IntToString(Iter, Info, sizeof(Info)),
3518 AddMenuItem(pMenu, Info, Buffer);
3519 }
3520 case 64:
3521 {
3522 SetMenuTitle(pMenu, "Select R8 Revolver Skin");
3523
3524 for (Iter = 0; Iter < sizeof(g_RevolverSkins); Iter++)
3525 FormatEx(Buffer, sizeof(Buffer), g_RevolverSkins[Iter]),
3526 IntToString(Iter, Info, sizeof(Info)),
3527 AddMenuItem(pMenu, Info, Buffer);
3528 }
3529
3530 default:
3531 {
3532 SetMenuTitle(pMenu, "Select <???> Skin");
3533 AddMenuItem(pMenu, "0", "Default");
3534 }
3535 }
3536
3537 g_ItemDefinitionIndex[Client] = Id;
3538
3539 DisplayMenu(pMenu, Client, MENU_TIME_FOREVER);
3540 }
3541 }
3542 }
3543 }
3544}
3545
3546public Action TimerHandler_DisplayStatTrakDetails(Handle pTimer, any Client)
3547{
3548 if (g_bIsInGame[Client] && !g_bMessageShown[Client])
3549 {
3550 PrintHintText(Client, "Type <font color='#00FF00'>!ST</font> for <font color='#FF0000'>StatTrakâ„¢</font> weapons.");
3551 PrintToChat(Client, ">> Type\x07 !ST\x01 for\x09 StatTrakâ„¢\x01 weapons.");
3552
3553 g_bMessageShown[Client] = true;
3554 }
3555}
3556
3557void my_Remove(int Data)
3558{
3559 AcceptEntityInput(Data, "KillHierarchy");
3560}
3561
3562bool ClassById(int Id, char[] Class, int Size)
3563{
3564 switch (Id)
3565 {
3566 case 4: FormatEx(Class, Size, "weapon_glock");
3567 case 2: FormatEx(Class, Size, "weapon_elite");
3568 case 36: FormatEx(Class, Size, "weapon_p250");
3569 case 30: FormatEx(Class, Size, "weapon_tec9");
3570 case 1: FormatEx(Class, Size, "weapon_deagle");
3571 case 35: FormatEx(Class, Size, "weapon_nova");
3572 case 25: FormatEx(Class, Size, "weapon_xm1014");
3573 case 29: FormatEx(Class, Size, "weapon_sawedoff");
3574 case 14: FormatEx(Class, Size, "weapon_m249");
3575 case 28: FormatEx(Class, Size, "weapon_negev");
3576 case 17: FormatEx(Class, Size, "weapon_mac10");
3577 case 33: FormatEx(Class, Size, "weapon_mp7");
3578 case 24: FormatEx(Class, Size, "weapon_ump45");
3579 case 19: FormatEx(Class, Size, "weapon_p90");
3580 case 26: FormatEx(Class, Size, "weapon_bizon");
3581 case 13: FormatEx(Class, Size, "weapon_galilar");
3582 case 7: FormatEx(Class, Size, "weapon_ak47");
3583 case 40: FormatEx(Class, Size, "weapon_ssg08");
3584 case 39: FormatEx(Class, Size, "weapon_sg556");
3585 case 9: FormatEx(Class, Size, "weapon_awp");
3586 case 11: FormatEx(Class, Size, "weapon_g3sg1");
3587 case 61: FormatEx(Class, Size, "weapon_usp_silencer");
3588 case 3: FormatEx(Class, Size, "weapon_fiveseven");
3589 case 27: FormatEx(Class, Size, "weapon_mag7");
3590 case 34: FormatEx(Class, Size, "weapon_mp9");
3591 case 10: FormatEx(Class, Size, "weapon_famas");
3592 case 60: FormatEx(Class, Size, "weapon_m4a1_silencer");
3593 case 8: FormatEx(Class, Size, "weapon_aug");
3594 case 38: FormatEx(Class, Size, "weapon_scar20");
3595 case 32: FormatEx(Class, Size, "weapon_hkp2000");
3596 case 16: FormatEx(Class, Size, "weapon_m4a1");
3597 case 63: FormatEx(Class, Size, "weapon_cz75a");
3598 case 64: FormatEx(Class, Size, "weapon_revolver");
3599 case 500: FormatEx(Class, Size, "weapon_bayonet");
3600 case 505: FormatEx(Class, Size, "weapon_knife_flip");
3601 case 506: FormatEx(Class, Size, "weapon_knife_gut");
3602 case 507: FormatEx(Class, Size, "weapon_knife_karambit");
3603 case 508: FormatEx(Class, Size, "weapon_knife_m9_bayonet");
3604 case 509: FormatEx(Class, Size, "weapon_knife_tactical");
3605 case 512: FormatEx(Class, Size, "weapon_knife_falchion");
3606 case 514: FormatEx(Class, Size, "weapon_knife_survival_bowie");
3607 case 515: FormatEx(Class, Size, "weapon_knife_butterfly");
3608 case 516: FormatEx(Class, Size, "weapon_knife_push");
3609 case 42: FormatEx(Class, Size, "weapon_knife");
3610 case 59: FormatEx(Class, Size, "weapon_knife_t");
3611
3612 default: Class[0] = EOS;
3613 }
3614
3615 return Class[0] != EOS ? true : false;
3616}
3617
3618int IDIByClass(char[] szClass)
3619{
3620 if (!strcmp(szClass, "weapon_bayonet")) return 500;
3621
3622 else if (!strcmp(szClass, "weapon_knife_flip")) return 505;
3623 else if (!strcmp(szClass, "weapon_knife_gut")) return 506;
3624 else if (!strcmp(szClass, "weapon_knife_karambit")) return 507;
3625 else if (!strcmp(szClass, "weapon_knife_m9_bayonet")) return 508;
3626 else if (!strcmp(szClass, "weapon_knife_tactical")) return 509;
3627 else if (!strcmp(szClass, "weapon_knife_falchion")) return 512;
3628 else if (!strcmp(szClass, "weapon_knife_survival_bowie")) return 514;
3629 else if (!strcmp(szClass, "weapon_knife_butterfly")) return 515;
3630 else if (!strcmp(szClass, "weapon_knife_push")) return 516;
3631 else if (!strcmp(szClass, "weapon_knife")) return 42;
3632 else if (!strcmp(szClass, "weapon_knife_t")) return 59;
3633
3634 return 0;
3635}
3636
3637#if !defined _hattrick_csgo_included
3638 int hCSGO_PureChatCommand(char[] Input, char[] Output, int Size)
3639 {
3640 static int m_Iterator, m_Length;
3641
3642 m_Iterator = 0;
3643 m_Length = 0;
3644
3645 Output[0] = EOS;
3646
3647 for (; m_Iterator < strlen(Input); m_Iterator++)
3648 {
3649 if (Input[m_Iterator] == '!' || Input[m_Iterator] == '/' || \
3650 IsCharAlpha(Input[m_Iterator]) || IsCharNumeric(Input[m_Iterator]))
3651 {
3652 m_Length = Format(Output, Size, "%s%c", Output, Input[m_Iterator]);
3653 }
3654 }
3655
3656 return m_Length;
3657 }
3658#endif