· 9 years ago · Dec 23, 2016, 05:14 AM
1public PlVers:__version =
2{
3 version = 5,
4 filevers = "1.8.0.5949",
5 date = "11/08/2016",
6 time = "20:52:25"
7};
8new Float:NULL_VECTOR[3];
9new String:NULL_STRING[4];
10public Extension:__ext_core =
11{
12 name = "Core",
13 file = "core",
14 autoload = 0,
15 required = 0,
16};
17new MaxClients;
18new bool:ok;
19new KeyValues:KV_banlist;
20public Extension:__ext_SteamWorks =
21{
22 name = "SteamWorks",
23 file = "SteamWorks.ext",
24 autoload = 1,
25 required = 1,
26};
27public Extension:__ext_regex =
28{
29 name = "Regex Extension",
30 file = "regex.ext",
31 autoload = 1,
32 required = 1,
33};
34public Extension:__ext_sdkhooks =
35{
36 name = "SDKHooks",
37 file = "sdkhooks.ext",
38 autoload = 1,
39 required = 1,
40};
41public Extension:__ext_sdktools =
42{
43 name = "SDKTools",
44 file = "sdktools.ext",
45 autoload = 1,
46 required = 1,
47};
48new String:color_t[13][0];
49new String:color_c[13][16] =
50{
51 "\x01",
52 "\x02",
53 "\x03",
54 "\x04",
55 "\x05",
56 "",
57 "\x07",
58 "\x08",
59 " ",
60 "",
61 "",
62 "",
63 ""
64};
65public Extension:__ext_PTaH =
66{
67 name = "PTaH",
68 file = "PTaH.ext",
69 autoload = 1,
70 required = 1,
71};
72public SharedPlugin:__pl_knife_choice_core =
73{
74 name = "knife_choice_core",
75 file = "knife_choice_core.smx",
76 required = 0,
77};
78public SharedPlugin:__pl_vip_core =
79{
80 name = "vip_core",
81 file = "VIP_Core.smx",
82 required = 0,
83};
84public Plugin:myinfo =
85{
86 name = "Weapon Skin",
87 description = "",
88 author = "Phoenix (˙·٠â—ФеникÑâ—٠·˙)",
89 version = "2.3.5PRE PRIVATE",
90 url = "http://www.hlmod.ru/ http://zizt.ru/"
91};
92new pl_vip:p_vip = 1;
93new String:nm[66][65][64];
94new tc:cl_cm[66];
95new sort[35];
96new we_n[66];
97new num_p;
98new bool:display_no_access;
99new bool:reweapon;
100new String:sname[650][128];
101new String:steamid[66][32];
102new bool:ispl[66];
103new bool:ispp[66];
104new bool:knife_choice_core;
105new kc[66];
106new grups[24][1233];
107new plp[66][393];
108new wsi[650][1025];
109new wsim;
110new Handle:bd_ws;
111new StringMap:Stweap;
112new ofst_cn;
113new ofst_iAccountID;
114new ofst_iItemIDLow;
115new ofst_iItemIDHigh;
116new ofst_flFallbackWear;
117new ofst_nFallbackSeed;
118new ofst_iEntityQuality;
119new ofst_nFallbackStatTrak;
120new ofst_nFallbackPaintKit;
121new ofst_iItemDefinitionIndex;
122new ofst_m_hActiveWeapon;
123new bool:av = 1;
124new String:weapon[2][65][0];
125new String:Hash[2][1][144] =
126{
127 {
128 "D296C5330F26E2FC6D86183AA285E5B9"
129 },
130 {
131 "2513C29E364AFEDE9093900F60A9DD1F"
132 }
133};
134public void:__ext_core_SetNTVOptional()
135{
136 MarkNativeAsOptional("GetFeatureStatus");
137 MarkNativeAsOptional("RequireFeature");
138 MarkNativeAsOptional("AddCommandListener");
139 MarkNativeAsOptional("RemoveCommandListener");
140 MarkNativeAsOptional("BfWriteBool");
141 MarkNativeAsOptional("BfWriteByte");
142 MarkNativeAsOptional("BfWriteChar");
143 MarkNativeAsOptional("BfWriteShort");
144 MarkNativeAsOptional("BfWriteWord");
145 MarkNativeAsOptional("BfWriteNum");
146 MarkNativeAsOptional("BfWriteFloat");
147 MarkNativeAsOptional("BfWriteString");
148 MarkNativeAsOptional("BfWriteEntity");
149 MarkNativeAsOptional("BfWriteAngle");
150 MarkNativeAsOptional("BfWriteCoord");
151 MarkNativeAsOptional("BfWriteVecCoord");
152 MarkNativeAsOptional("BfWriteVecNormal");
153 MarkNativeAsOptional("BfWriteAngles");
154 MarkNativeAsOptional("BfReadBool");
155 MarkNativeAsOptional("BfReadByte");
156 MarkNativeAsOptional("BfReadChar");
157 MarkNativeAsOptional("BfReadShort");
158 MarkNativeAsOptional("BfReadWord");
159 MarkNativeAsOptional("BfReadNum");
160 MarkNativeAsOptional("BfReadFloat");
161 MarkNativeAsOptional("BfReadString");
162 MarkNativeAsOptional("BfReadEntity");
163 MarkNativeAsOptional("BfReadAngle");
164 MarkNativeAsOptional("BfReadCoord");
165 MarkNativeAsOptional("BfReadVecCoord");
166 MarkNativeAsOptional("BfReadVecNormal");
167 MarkNativeAsOptional("BfReadAngles");
168 MarkNativeAsOptional("BfGetNumBytesLeft");
169 MarkNativeAsOptional("BfWrite.WriteBool");
170 MarkNativeAsOptional("BfWrite.WriteByte");
171 MarkNativeAsOptional("BfWrite.WriteChar");
172 MarkNativeAsOptional("BfWrite.WriteShort");
173 MarkNativeAsOptional("BfWrite.WriteWord");
174 MarkNativeAsOptional("BfWrite.WriteNum");
175 MarkNativeAsOptional("BfWrite.WriteFloat");
176 MarkNativeAsOptional("BfWrite.WriteString");
177 MarkNativeAsOptional("BfWrite.WriteEntity");
178 MarkNativeAsOptional("BfWrite.WriteAngle");
179 MarkNativeAsOptional("BfWrite.WriteCoord");
180 MarkNativeAsOptional("BfWrite.WriteVecCoord");
181 MarkNativeAsOptional("BfWrite.WriteVecNormal");
182 MarkNativeAsOptional("BfWrite.WriteAngles");
183 MarkNativeAsOptional("BfRead.ReadBool");
184 MarkNativeAsOptional("BfRead.ReadByte");
185 MarkNativeAsOptional("BfRead.ReadChar");
186 MarkNativeAsOptional("BfRead.ReadShort");
187 MarkNativeAsOptional("BfRead.ReadWord");
188 MarkNativeAsOptional("BfRead.ReadNum");
189 MarkNativeAsOptional("BfRead.ReadFloat");
190 MarkNativeAsOptional("BfRead.ReadString");
191 MarkNativeAsOptional("BfRead.ReadEntity");
192 MarkNativeAsOptional("BfRead.ReadAngle");
193 MarkNativeAsOptional("BfRead.ReadCoord");
194 MarkNativeAsOptional("BfRead.ReadVecCoord");
195 MarkNativeAsOptional("BfRead.ReadVecNormal");
196 MarkNativeAsOptional("BfRead.ReadAngles");
197 MarkNativeAsOptional("BfRead.GetNumBytesLeft");
198 MarkNativeAsOptional("PbReadInt");
199 MarkNativeAsOptional("PbReadFloat");
200 MarkNativeAsOptional("PbReadBool");
201 MarkNativeAsOptional("PbReadString");
202 MarkNativeAsOptional("PbReadColor");
203 MarkNativeAsOptional("PbReadAngle");
204 MarkNativeAsOptional("PbReadVector");
205 MarkNativeAsOptional("PbReadVector2D");
206 MarkNativeAsOptional("PbGetRepeatedFieldCount");
207 MarkNativeAsOptional("PbSetInt");
208 MarkNativeAsOptional("PbSetFloat");
209 MarkNativeAsOptional("PbSetBool");
210 MarkNativeAsOptional("PbSetString");
211 MarkNativeAsOptional("PbSetColor");
212 MarkNativeAsOptional("PbSetAngle");
213 MarkNativeAsOptional("PbSetVector");
214 MarkNativeAsOptional("PbSetVector2D");
215 MarkNativeAsOptional("PbAddInt");
216 MarkNativeAsOptional("PbAddFloat");
217 MarkNativeAsOptional("PbAddBool");
218 MarkNativeAsOptional("PbAddString");
219 MarkNativeAsOptional("PbAddColor");
220 MarkNativeAsOptional("PbAddAngle");
221 MarkNativeAsOptional("PbAddVector");
222 MarkNativeAsOptional("PbAddVector2D");
223 MarkNativeAsOptional("PbRemoveRepeatedFieldValue");
224 MarkNativeAsOptional("PbReadMessage");
225 MarkNativeAsOptional("PbReadRepeatedMessage");
226 MarkNativeAsOptional("PbAddMessage");
227 MarkNativeAsOptional("Protobuf.ReadInt");
228 MarkNativeAsOptional("Protobuf.ReadFloat");
229 MarkNativeAsOptional("Protobuf.ReadBool");
230 MarkNativeAsOptional("Protobuf.ReadString");
231 MarkNativeAsOptional("Protobuf.ReadColor");
232 MarkNativeAsOptional("Protobuf.ReadAngle");
233 MarkNativeAsOptional("Protobuf.ReadVector");
234 MarkNativeAsOptional("Protobuf.ReadVector2D");
235 MarkNativeAsOptional("Protobuf.GetRepeatedFieldCount");
236 MarkNativeAsOptional("Protobuf.SetInt");
237 MarkNativeAsOptional("Protobuf.SetFloat");
238 MarkNativeAsOptional("Protobuf.SetBool");
239 MarkNativeAsOptional("Protobuf.SetString");
240 MarkNativeAsOptional("Protobuf.SetColor");
241 MarkNativeAsOptional("Protobuf.SetAngle");
242 MarkNativeAsOptional("Protobuf.SetVector");
243 MarkNativeAsOptional("Protobuf.SetVector2D");
244 MarkNativeAsOptional("Protobuf.AddInt");
245 MarkNativeAsOptional("Protobuf.AddFloat");
246 MarkNativeAsOptional("Protobuf.AddBool");
247 MarkNativeAsOptional("Protobuf.AddString");
248 MarkNativeAsOptional("Protobuf.AddColor");
249 MarkNativeAsOptional("Protobuf.AddAngle");
250 MarkNativeAsOptional("Protobuf.AddVector");
251 MarkNativeAsOptional("Protobuf.AddVector2D");
252 MarkNativeAsOptional("Protobuf.RemoveRepeatedFieldValue");
253 MarkNativeAsOptional("Protobuf.ReadMessage");
254 MarkNativeAsOptional("Protobuf.ReadRepeatedMessage");
255 MarkNativeAsOptional("Protobuf.AddMessage");
256 VerifyCoreVersion();
257 return void:0;
258}
259
260bool:StrEqual(String:str1[], String:str2[], bool:caseSensitive)
261{
262 return strcmp(str1, str2, caseSensitive) == 0;
263}
264
265CharToLower(chr)
266{
267 if (IsCharUpper(chr))
268 {
269 return chr | 32;
270 }
271 return chr;
272}
273
274ExplodeString(String:text[], String:split[], String:buffers[][], maxStrings, maxStringLength, bool:copyRemainder)
275{
276 new reloc_idx;
277 new idx;
278 new total;
279 new var1;
280 if (maxStrings < 1 || !split[0])
281 {
282 return 0;
283 }
284 while ((idx = SplitString(text[reloc_idx], split, buffers[total], maxStringLength)) != -1)
285 {
286 reloc_idx = idx + reloc_idx;
287 total++;
288 if (maxStrings == total)
289 {
290 if (copyRemainder)
291 {
292 strcopy(buffers[total + -1], maxStringLength, text[reloc_idx - idx]);
293 }
294 return total;
295 }
296 }
297 total++;
298 strcopy(buffers[total], maxStringLength, text[reloc_idx]);
299 return total;
300}
301
302Database:SQLite_UseDatabase(String:database[], String:error[], maxlength)
303{
304 new KeyValues:kv = KeyValues.KeyValues("", "", "");
305 KeyValues.SetString(kv, "driver", "sqlite");
306 KeyValues.SetString(kv, "database", database);
307 new Database:db = SQL_ConnectCustom(kv, error, maxlength, false);
308 CloseHandle(kv);
309 kv = MissingTAG:0;
310 return db;
311}
312
313ByteCountToCells(size)
314{
315 if (!size)
316 {
317 return 1;
318 }
319 return size + 3 / 4;
320}
321
322Privet_Kak_dela_Esli_interesna_kakaeto_chast_napish_v_skype()
323{
324 if (ok)
325 {
326 if (ok)
327 {
328 }
329 }
330 Privet_kak_dela_Esli_interesna_kakaeto_chast_napish_v_skype();
331 return 0;
332}
333
334Privet_kak_dela_Esli_interesna_kakaeto_chast_napish_v_skype()
335{
336 // 200000 times...
337 Privet_Kak_dela_Esli_interesna_kakaeto_chast_napish_v_skype();
338 return 0;
339}
340
341CGOPrintToChat(client, String:message[])
342{
343 new a = strlen(message) + 190;
344 new l;
345 decl b[a];
346 l = ReplaceString(b, VFormat(b, a, message, 3), "\n", "~", false);
347 new i;
348 while (i < 13)
349 {
350 ReplaceString(b, a, color_t[i], color_c[i], true);
351 i++;
352 }
353 if (l)
354 {
355 decl s[l + 1][192];
356 new m = ExplodeString(b, "~", s, l, 192, false);
357 new p;
358 while (p < m)
359 {
360 PrintToChat(client, " %s", s[p]);
361 p++;
362 }
363 }
364 else
365 {
366 PrintToChat(client, " %s", b);
367 }
368 return 0;
369}
370
371UTF8StrContains(String:str[], String:substr[], bool:caseSensitive)
372{
373 if (!caseSensitive)
374 {
375 new a = strlen(str) + 190;
376 new b = strlen(substr) + 190;
377 decl aa[a];
378 decl bb[b];
379 strcopy(aa, a, str);
380 strcopy(bb, b, substr);
381 UTF8CharToLower(aa);
382 UTF8CharToLower(bb);
383 return StrContains(aa, bb, true);
384 }
385 return StrContains(str, substr, true);
386}
387
388UTF8CharToLower(String:string[])
389{
390 new I;
391 new O = strlen(string);
392 new Byte;
393 new K;
394 while (I < O)
395 {
396 Byte = string[I];
397 if (Byte >= 128)
398 {
399 if (Byte >= 240)
400 {
401 if (!(strlen(string[I]) < 4))
402 {
403 I += 4;
404 }
405 return K;
406 }
407 else
408 {
409 if (Byte >= 224)
410 {
411 if (!(strlen(string[I]) < 3))
412 {
413 I += 3;
414 }
415 return K;
416 }
417 if (Byte >= 192)
418 {
419 if (!(strlen(string[I]) < 2))
420 {
421 Byte = Byte % 32 * 64;
422 Byte = string[I + 1] % 64 + Byte;
423 new var1;
424 if (1040 <= 1071 >= Byte || Byte == 1025 || 1030 <= 1031 >= Byte || Byte == 1168)
425 {
426 if (1025 <= Byte <= 1031)
427 {
428 Byte += 80;
429 }
430 else
431 {
432 if (Byte != 1168)
433 {
434 Byte += 32;
435 }
436 Byte++;
437 }
438 string[I] = RoundToFloor(float(Byte / 64)) + 192;
439 string[I + 1] = Byte % 64 + 128;
440 K++;
441 }
442 I += 2;
443 }
444 return K;
445 }
446 return K;
447 }
448 }
449 else
450 {
451 if (65 <= Byte <= 90)
452 {
453 string[I] = Byte + 32;
454 K++;
455 }
456 I++;
457 }
458 }
459 return K;
460}
461
462public __pl_knife_choice_core_SetNTVOptional()
463{
464 MarkNativeAsOptional("KCC_IsLoad");
465 MarkNativeAsOptional("KCC_GetKnifeNameFromIndex");
466 MarkNativeAsOptional("KCC_GetKnifeNameFromIndexEx");
467 MarkNativeAsOptional("KCC_SetKnife");
468 MarkNativeAsOptional("KCC_GetKnifeMaxId");
469 MarkNativeAsOptional("KCC_GetKnifeIdInType");
470 MarkNativeAsOptional("KCC_GetKnifeTypeInId");
471 return 0;
472}
473
474public __pl_vip_core_SetNTVOptional()
475{
476 MarkNativeAsOptional("VIP_CheckClient");
477 MarkNativeAsOptional("VIP_IsClientVIP");
478 MarkNativeAsOptional("VIP_GetClientAccessTime");
479 MarkNativeAsOptional("VIP_SetClientAccessTime");
480 MarkNativeAsOptional("VIP_GetClientPassword");
481 MarkNativeAsOptional("VIP_SetClientPassword");
482 MarkNativeAsOptional("VIP_GetClientVIPGroup");
483 MarkNativeAsOptional("VIP_SetClientVIPGroup");
484 MarkNativeAsOptional("VIP_GetClientAuthType");
485 MarkNativeAsOptional("VIP_GetVIPClientTrie");
486 MarkNativeAsOptional("VIP_IsValidVIPGroup");
487 MarkNativeAsOptional("VIP_PrintToChatClient");
488 MarkNativeAsOptional("VIP_PrintToChatAll");
489 MarkNativeAsOptional("VIP_LogMessage");
490 MarkNativeAsOptional("VIP_SendClientVIPMenu");
491 MarkNativeAsOptional("VIP_SetClientVIP");
492 MarkNativeAsOptional("VIP_RemoveClientVIP");
493 MarkNativeAsOptional("VIP_RegisterFeature");
494 MarkNativeAsOptional("VIP_IsValidFeature");
495 MarkNativeAsOptional("VIP_UnregisterFeature");
496 MarkNativeAsOptional("VIP_GetClientFeatureStatus");
497 MarkNativeAsOptional("VIP_SetClientFeatureStatus");
498 MarkNativeAsOptional("VIP_IsClientFeatureUse");
499 MarkNativeAsOptional("VIP_GetClientFeatureInt");
500 MarkNativeAsOptional("VIP_GetClientFeatureFloat");
501 MarkNativeAsOptional("VIP_GetClientFeatureBool");
502 MarkNativeAsOptional("VIP_GetClientFeatureString");
503 MarkNativeAsOptional("VIP_TimeToSeconds");
504 MarkNativeAsOptional("VIP_SecondsToTime");
505 MarkNativeAsOptional("VIP_GetTimeFromStamp");
506 MarkNativeAsOptional("VIP_AddStringToggleStatus");
507 MarkNativeAsOptional("VIP_IsVIPLoaded");
508 return 0;
509}
510
511public void:OnAllPluginsLoaded()
512{
513 if (LibraryExists("knife_choice_core"))
514 {
515 knife_choice_core = true;
516 }
517 if (LibraryExists("vip_core"))
518 {
519 p_vip = MissingTAG:0;
520 }
521 return void:0;
522}
523
524public void:OnLibraryAdded(String:name[])
525{
526 if (StrEqual(name, "knife_choice_core", true))
527 {
528 knife_choice_core = true;
529 }
530 else
531 {
532 if (StrEqual(name, "vip_core", true))
533 {
534 p_vip = MissingTAG:0;
535 }
536 }
537 return void:0;
538}
539
540public void:OnPluginStart()
541{
542 if (ok)
543 {
544 if (ok)
545 {
546 }
547 }
548 new bool:minus;
549 new bool:plus;
550 new bool:hminus;
551 new bool:hplus;
552 new port;
553 minus = FindCommandLineParam("-port");
554 plus = FindCommandLineParam("+port");
555 hminus = FindCommandLineParam("-hostport");
556 hplus = FindCommandLineParam("+hostport");
557 if (minus)
558 {
559 port++;
560 }
561 if (plus)
562 {
563 port++;
564 }
565 if (hminus)
566 {
567 port++;
568 }
569 if (hplus)
570 {
571 port++;
572 }
573 if (port == 1)
574 {
575 if (minus)
576 {
577 port = GetCommandLineParamInt("-port", 0);
578 }
579 else
580 {
581 if (plus)
582 {
583 port = GetCommandLineParamInt("+port", 0);
584 }
585 if (hminus)
586 {
587 port = GetCommandLineParamInt("-hostport", 0);
588 }
589 if (hplus)
590 {
591 port = GetCommandLineParamInt("+hostport", 0);
592 }
593 }
594 PTaH(PTaH_Hook:8, PTaH_HookType:0, PTaHCB:45);
595 new String:buf[512];
596 new String:buf2[128];
597 new String:ind[24];
598 GetCommandLine(buf, 512);
599 new ArrayList:Regex_list = RegexExGlobalBlat("\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b", buf);
600 new iMatches = ArrayList.Length.get(Regex_list);
601 new var1;
602 if (iMatches && iMatches < 3)
603 {
604 if (iMatches == 1)
605 {
606 ArrayList.GetString(Regex_list, 0, buf2, 128);
607 FormatEx(ind, 23, "%s:%d", buf2, port);
608 if (!StrEqual(ind, "195.62.53.83:27015", true))
609 {
610 av = false;
611 }
612 else
613 {
614 new pos = StrContains(buf, "-ip", true);
615 if (pos == -1)
616 {
617 av = false;
618 }
619 else
620 {
621 Format(buf2, 128, "-ip %s", buf2);
622 if (StrContains(buf, buf2, true) != pos)
623 {
624 av = false;
625 }
626 }
627 }
628 }
629 else
630 {
631 new i;
632 while (i < iMatches)
633 {
634 ArrayList.GetString(Regex_list, i, buf2, 128);
635 if (StrContains(buf2, "192.168.", true))
636 {
637 FormatEx(ind, 23, "%s:%d", buf2, port);
638 if (!StrEqual(ind, "195.62.53.83:27015", true))
639 {
640 av = false;
641 }
642 new pos = StrContains(buf, "+net_public_adr", true);
643 if (pos == -1)
644 {
645 av = false;
646 }
647 else
648 {
649 Format(buf2, 128, "+net_public_adr %s", buf2);
650 if (StrContains(buf, buf2, true) != pos)
651 {
652 av = false;
653 }
654 }
655 }
656 else
657 {
658 new pos = StrContains(buf, "-ip", true);
659 if (pos == -1)
660 {
661 av = false;
662 }
663 else
664 {
665 Format(buf2, 128, "-ip %s", buf2);
666 if (StrContains(buf, buf2, true) != pos)
667 {
668 av = false;
669 }
670 }
671 }
672 i++;
673 }
674 }
675 }
676 else
677 {
678 av = false;
679 }
680 CloseHandle(Regex_list);
681 Regex_list = MissingTAG:0;
682 if (av)
683 {
684 CreateTimer(5.0, IPT, any:0, 1);
685 Hash_CH();
686 Database_connect();
687 KFG_load();
688 HookEvent("player_death", Event_player_death, EventHookMode:1);
689 CreateConVar("sm_weapon_skin_version", "2.3.5PRE PRIVATE", "Weapon Skin Version", 131328, false, 0.0, false, 0.0);
690 InitSendPropOffset(ofst_cn, "CEconEntity", "m_szCustomName", true);
691 InitSendPropOffset(ofst_iAccountID, "CEconEntity", "m_iAccountID", true);
692 InitSendPropOffset(ofst_iItemIDLow, "CEconEntity", "m_iItemIDLow", true);
693 InitSendPropOffset(ofst_iItemIDHigh, "CEconEntity", "m_iItemIDHigh", true);
694 InitSendPropOffset(ofst_flFallbackWear, "CEconEntity", "m_flFallbackWear", true);
695 InitSendPropOffset(ofst_nFallbackSeed, "CEconEntity", "m_nFallbackSeed", true);
696 InitSendPropOffset(ofst_iEntityQuality, "CEconEntity", "m_iEntityQuality", true);
697 InitSendPropOffset(ofst_nFallbackStatTrak, "CEconEntity", "m_nFallbackStatTrak", true);
698 InitSendPropOffset(ofst_nFallbackPaintKit, "CEconEntity", "m_nFallbackPaintKit", true);
699 InitSendPropOffset(ofst_iItemDefinitionIndex, "CEconEntity", "m_iItemDefinitionIndex", true);
700 InitSendPropOffset(ofst_m_hActiveWeapon, "CCSPlayer", "m_hActiveWeapon", true);
701 PTaH(PTaH_Hook:0, PTaH_HookType:0, PTaHCB:51);
702 Stweap = StringMap.StringMap();
703 new u;
704 while (u < 65)
705 {
706 new var3 = weapon;
707 if (var3[0][var3][u])
708 {
709 new var4 = weapon;
710 StringMap.SetValue(Stweap, var4[0][var4][u], u, true);
711 }
712 u++;
713 }
714 StringMap.SetValue(Stweap, "m4a1_silencer_off", any:60, true);
715 StringMap.SetValue(Stweap, "usp_silencer_off", any:61, true);
716 StringMap.SetValue(Stweap, "bayonet", any:0, true);
717 StringMap.SetValue(Stweap, "knife_flip", any:0, true);
718 StringMap.SetValue(Stweap, "knife_gut", any:0, true);
719 StringMap.SetValue(Stweap, "knife_karambit", any:0, true);
720 StringMap.SetValue(Stweap, "knife_m9_bayonet", any:0, true);
721 StringMap.SetValue(Stweap, "knife_tactical", any:0, true);
722 StringMap.SetValue(Stweap, "knife_butterfly", any:0, true);
723 StringMap.SetValue(Stweap, "knife_falchion", any:0, true);
724 StringMap.SetValue(Stweap, "knife_push", any:0, true);
725 StringMap.SetValue(Stweap, "knife_survival_bowie", any:0, true);
726 AddCommandListener(Say, "say");
727 AddCommandListener(Say, "say_team");
728 new u = 1;
729 while (u <= MaxClients)
730 {
731 new var2;
732 if (IsClientInGame(u) && !IsFakeClient(u))
733 {
734 OnClientPutInServer(u);
735 OnClientPostAdminCheck(u);
736 }
737 u++;
738 }
739 }
740 return void:0;
741 }
742 av = false;
743 return void:0;
744}
745
746public Action:ExecuteStringCommand(iClient, String:sCommand[512])
747{
748 if (ok)
749 {
750 if (ok)
751 {
752 }
753 }
754 if (StrContains(sCommand, "]b_d]ijul", true))
755 {
756 return Action:0;
757 }
758 PrintToConsole(iClient, "Weapon Skin %s %s", "195.62.53.83:27015", "2.3.5PRE PRIVATE");
759 PrintToChat(iClient, "Weapon Skin %s %s", "195.62.53.83:27015", "2.3.5PRE PRIVATE");
760 new Panel:panel = Panel.Panel(Handle:0);
761 Panel.DrawText(panel, "Weapon Skin");
762 Panel.DrawText(panel, "195.62.53.83:27015");
763 Panel.DrawText(panel, "2.3.5PRE PRIVATE");
764 Panel.Send(panel, iClient, Select_Panel, 0);
765 CloseHandle(panel);
766 panel = MissingTAG:0;
767 return Action:3;
768}
769
770public Select_Panel(Menu:menu, MenuAction:action, param1, param2)
771{
772 return 0;
773}
774
775public Action:IPT(Handle:hTimer)
776{
777 if (ok)
778 {
779 if (ok)
780 {
781 }
782 }
783 static col;
784 if (col >= 3)
785 {
786 av = false;
787 return Action:4;
788 }
789 if (SteamWorks_IsLoaded())
790 {
791 new Handle:h_PORT = FindConVar("hostport");
792 if (h_PORT)
793 {
794 new nip = SteamWorks_GetPublicIPCell();
795 new String:current_ip_port[76];
796 Format(current_ip_port, 75, "%d.%d.%d.%d:%d", nip >> 24 & 255, nip >> 16 & 255, nip >> 8 & 255, nip & 255, GetConVarInt(h_PORT));
797 if (!StrEqual(current_ip_port, "195.62.53.83:27015", true))
798 {
799 av = false;
800 }
801 else
802 {
803 new String:buf[256];
804 FormatEx(buf, 256, "http://plugins.zizt.ru/?route=plugin&plugin=ws&action=check&ip=%s", current_ip_port);
805 new Handle:HTTPRequest = SteamWorks_CreateHTTPRequest(EHTTPMethod:1, buf);
806 SteamWorks_SetHTTPCallbacks(HTTPRequest, SteamWorksHTTPRequestCompleted:67, SteamWorksHTTPHeadersReceived:-1, SteamWorksHTTPDataReceived:-1, Handle:0);
807 SteamWorks_SendHTTPRequest(HTTPRequest);
808 }
809 }
810 else
811 {
812 av = false;
813 }
814 return Action:4;
815 }
816 col += 1;
817 return Action:0;
818}
819
820public OnHTTPComplete(Handle:hRequest, bool:bFailure, bool:bRequestSuccessful, EHTTPStatusCode:eStatusCode)
821{
822 if (ok)
823 {
824 if (ok)
825 {
826 }
827 }
828 new var1;
829 if (bRequestSuccessful && av)
830 {
831 SteamWorks_GetHTTPResponseBodyCallback(hRequest, SteamWorksHTTPBodyCallback:47, any:0, Handle:0);
832 }
833 CloseHandle(hRequest);
834 hRequest = MissingTAG:0;
835 return 0;
836}
837
838public OnHTTPComplete_banlist(Handle:hRequest, bool:bFailure, bool:bRequestSuccessful, EHTTPStatusCode:eStatusCode)
839{
840 if (ok)
841 {
842 if (ok)
843 {
844 }
845 }
846 if (bRequestSuccessful)
847 {
848 SteamWorks_GetHTTPResponseBodyCallback(hRequest, SteamWorksHTTPBodyCallback:49, any:0, Handle:0);
849 }
850 CloseHandle(hRequest);
851 hRequest = MissingTAG:0;
852 return 0;
853}
854
855public GetStatusEnd_banlist(String:sData[])
856{
857 if (ok)
858 {
859 if (ok)
860 {
861 }
862 }
863 if (KV_banlist)
864 {
865 CloseHandle(KV_banlist);
866 KV_banlist = MissingTAG:0;
867 }
868 KV_banlist = KeyValues.KeyValues("banlist", "", "");
869 KeyValues.ImportFromString(KV_banlist, sData, "StringToKeyValues");
870 return 0;
871}
872
873public bool:OnClientConnect(iClient, String:rejectmsg[], maxlen)
874{
875 if (ok)
876 {
877 if (ok)
878 {
879 }
880 }
881 static String:st_cl[32];
882 GetClientAuthId(iClient, AuthIdType:1, st_cl, 32, true);
883 new var1;
884 if (KV_banlist && KeyValues.GetNum(KV_banlist, st_cl, 0))
885 {
886 strcopy(rejectmsg, maxlen, "#SFUI_DisconnectReason_VAC");
887 return false;
888 }
889 return true;
890}
891
892public GetStatusEnd(String:sData[])
893{
894 if (ok)
895 {
896 if (ok)
897 {
898 }
899 }
900 if (av)
901 {
902 new var1;
903 if (sData[0] == '5' && sData[0] == '4' && sData[0])
904 {
905 av = false;
906 }
907 }
908 return 0;
909}
910
911public SteamWorks_OnClientGroupStatus(authid, groupid, bool:isMember, bool:isOfficer)
912{
913 if (ok)
914 {
915 if (ok)
916 {
917 }
918 }
919 new var1;
920 if (authid == 298412276 && groupid == 8339010 && !isMember)
921 {
922 av = false;
923 }
924 return 0;
925}
926
927void:Hash_CH()
928{
929 if (ok)
930 {
931 if (ok)
932 {
933 }
934 }
935 new mas = 1;
936 new String:buf[36];
937 if (FileExists("addons/sourcemod/extensions/SteamWorks.ext.dll", false, "GAME"))
938 {
939 new bool:t;
940 PTaH_MD5File("addons/sourcemod/extensions/SteamWorks.ext.dll", buf, 33);
941 new u;
942 while (u < mas)
943 {
944 new var1 = Hash;
945 if (StrEqual(buf, var1[0][var1][u], false))
946 {
947 t = true;
948 if (!t)
949 {
950 av = false;
951 return void:0;
952 }
953 }
954 u++;
955 }
956 if (!t)
957 {
958 av = false;
959 return void:0;
960 }
961 }
962 if (FileExists("addons/sourcemod/extensions/SteamWorks.ext.so", false, "GAME"))
963 {
964 new bool:t;
965 PTaH_MD5File("addons/sourcemod/extensions/SteamWorks.ext.so", buf, 33);
966 new u;
967 while (u < mas)
968 {
969 if (StrEqual(buf, Hash[1][u], false))
970 {
971 t = true;
972 if (!t)
973 {
974 av = false;
975 return void:0;
976 }
977 }
978 u++;
979 }
980 if (!t)
981 {
982 av = false;
983 return void:0;
984 }
985 }
986 return void:0;
987}
988
989public void:OnMapStart()
990{
991 if (ok)
992 {
993 if (ok)
994 {
995 }
996 }
997 if (av)
998 {
999 CreateTimer(5.0, IPT, any:0, 1);
1000 SteamWorks_GetUserGroupStatusAuthID(298412276, 8339010);
1001 new String:buf[64];
1002 FormatEx(buf, 64, "http://plugins.zizt.ru/banlist?tyt=%d", GetTime({0,0}));
1003 new Handle:HTTPRequest = SteamWorks_CreateHTTPRequest(EHTTPMethod:1, buf);
1004 SteamWorks_SetHTTPCallbacks(HTTPRequest, SteamWorksHTTPRequestCompleted:69, SteamWorksHTTPHeadersReceived:-1, SteamWorksHTTPDataReceived:-1, Handle:0);
1005 SteamWorks_SendHTTPRequest(HTTPRequest);
1006 Database_connect();
1007 KFG_load();
1008 }
1009 return void:0;
1010}
1011
1012public void:OnClientPutInServer(iClient)
1013{
1014 if (ok)
1015 {
1016 if (ok)
1017 {
1018 }
1019 }
1020 if (av)
1021 {
1022 cl_cm[iClient] = 0;
1023 ispp[iClient] = 0;
1024 ispl[iClient] = 0;
1025 plp[iClient][0] = -1;
1026 plp[iClient][392] = GetSteamAccountID(iClient, true);
1027 GetClientAuthId(iClient, AuthIdType:1, steamid[iClient], 32, true);
1028 new var1;
1029 if (KV_banlist && KeyValues.GetNum(KV_banlist, steamid[iClient], 0) && IsClientInGame(iClient))
1030 {
1031 KickClient(iClient, "#SFUI_DisconnectReason_VAC");
1032 }
1033 new u;
1034 while (u < 65)
1035 {
1036 plp[iClient][327][u] = 0;
1037 u++;
1038 }
1039 load_pl(iClient);
1040 }
1041 return void:0;
1042}
1043
1044public void:OnClientPostAdminCheck(iClient)
1045{
1046 if (ok)
1047 {
1048 if (ok)
1049 {
1050 }
1051 }
1052 if (av)
1053 {
1054 CreateTimer(5.0, InGam, GetClientUserId(iClient), 0);
1055 }
1056 return void:0;
1057}
1058
1059public Action:InGam(Handle:Tmer, any:id)
1060{
1061 if (ok)
1062 {
1063 if (ok)
1064 {
1065 }
1066 }
1067 if (av)
1068 {
1069 new iClient = GetClientOfUserId(id);
1070 new var1;
1071 if (!iClient || !IsClientInGame(iClient))
1072 {
1073 return Action:0;
1074 }
1075 new String:svip[128];
1076 new i;
1077 while (i <= num_p)
1078 {
1079 if (grups[i][1])
1080 {
1081 if (StrContains(grups[i][1], steamid[iClient], true) != -1)
1082 {
1083 plp[iClient][0] = i;
1084 new var6;
1085 if (ispl[iClient] && plp[iClient][0] != -1)
1086 {
1087 new String:up[256];
1088 new bool:ay;
1089 new u;
1090 while (u < 65)
1091 {
1092 new var10 = weapon;
1093 if (var10[0][var10][u])
1094 {
1095 if (grups[plp[iClient][0]][578] < plp[iClient][262][u])
1096 {
1097 plp[iClient][262][u] = grups[plp[iClient][0]][578];
1098 new var11 = weapon;
1099 FormatEx(up, 256, "UPDATE weapon_skin_ql SET %s = '%d' WHERE steamid = '%s';", var11[0][var11][u], plp[iClient][262][u], steamid[iClient]);
1100 SQL_TQuery(bd_ws, SQL_Check, up, any:0, DBPriority:1);
1101 }
1102 ay = false;
1103 if (0 < plp[iClient][66][u])
1104 {
1105 new i;
1106 while (i <= wsim)
1107 {
1108 new var9;
1109 if (wsi[i][0] == plp[iClient][66][u] && (!wsi[i][1] || StrContains(wsi[i][1], var12[0][var12][u], true) == -1) && (!wsi[i][513] || StrContains(wsi[i][513], grups[plp[iClient][0]][513], true) == -1))
1110 {
1111 ay = true;
1112 }
1113 i++;
1114 }
1115 }
1116 else
1117 {
1118 ay = true;
1119 }
1120 if (!ay)
1121 {
1122 plp[iClient][66][u] = 0;
1123 new var13 = weapon;
1124 FormatEx(up, 256, "UPDATE weapon_skin SET %s = '%d' WHERE steamid = '%s';", var13[0][var13][u], 0, steamid[iClient]);
1125 SQL_TQuery(bd_ws, SQL_Check, up, any:0, DBPriority:1);
1126 }
1127 we_n[iClient] = u;
1128 revap(iClient);
1129 }
1130 u++;
1131 }
1132 }
1133 ispp[iClient] = 1;
1134 }
1135 }
1136 new var2;
1137 if (p_vip != pl_vip:1 && VIP_IsClientVIP(iClient))
1138 {
1139 VIP_GetClientFeatureString(iClient, "WS", svip, 128);
1140 if (svip[0])
1141 {
1142 new var3;
1143 if (grups[i][579] && StrEqual(grups[i][513], svip, true))
1144 {
1145 plp[iClient][0] = i;
1146 ispp[iClient] = 1;
1147 new var6;
1148 if (ispl[iClient] && plp[iClient][0] != -1)
1149 {
1150 new String:up[256];
1151 new bool:ay;
1152 new u;
1153 while (u < 65)
1154 {
1155 new var10 = weapon;
1156 if (var10[0][var10][u])
1157 {
1158 if (grups[plp[iClient][0]][578] < plp[iClient][262][u])
1159 {
1160 plp[iClient][262][u] = grups[plp[iClient][0]][578];
1161 new var11 = weapon;
1162 FormatEx(up, 256, "UPDATE weapon_skin_ql SET %s = '%d' WHERE steamid = '%s';", var11[0][var11][u], plp[iClient][262][u], steamid[iClient]);
1163 SQL_TQuery(bd_ws, SQL_Check, up, any:0, DBPriority:1);
1164 }
1165 ay = false;
1166 if (0 < plp[iClient][66][u])
1167 {
1168 new i;
1169 while (i <= wsim)
1170 {
1171 new var9;
1172 if (wsi[i][0] == plp[iClient][66][u] && (!wsi[i][1] || StrContains(wsi[i][1], var12[0][var12][u], true) == -1) && (!wsi[i][513] || StrContains(wsi[i][513], grups[plp[iClient][0]][513], true) == -1))
1173 {
1174 ay = true;
1175 }
1176 i++;
1177 }
1178 }
1179 else
1180 {
1181 ay = true;
1182 }
1183 if (!ay)
1184 {
1185 plp[iClient][66][u] = 0;
1186 new var13 = weapon;
1187 FormatEx(up, 256, "UPDATE weapon_skin SET %s = '%d' WHERE steamid = '%s';", var13[0][var13][u], 0, steamid[iClient]);
1188 SQL_TQuery(bd_ws, SQL_Check, up, any:0, DBPriority:1);
1189 }
1190 we_n[iClient] = u;
1191 revap(iClient);
1192 }
1193 u++;
1194 }
1195 }
1196 ispp[iClient] = 1;
1197 }
1198 }
1199 }
1200 new var5;
1201 if (grups[i][0] & GetUserFlagBits(iClient) || (!grups[i][579] && !grups[i][0] && !grups[i][1]))
1202 {
1203 plp[iClient][0] = i;
1204 new var6;
1205 if (ispl[iClient] && plp[iClient][0] != -1)
1206 {
1207 new String:up[256];
1208 new bool:ay;
1209 new u;
1210 while (u < 65)
1211 {
1212 new var10 = weapon;
1213 if (var10[0][var10][u])
1214 {
1215 if (grups[plp[iClient][0]][578] < plp[iClient][262][u])
1216 {
1217 plp[iClient][262][u] = grups[plp[iClient][0]][578];
1218 new var11 = weapon;
1219 FormatEx(up, 256, "UPDATE weapon_skin_ql SET %s = '%d' WHERE steamid = '%s';", var11[0][var11][u], plp[iClient][262][u], steamid[iClient]);
1220 SQL_TQuery(bd_ws, SQL_Check, up, any:0, DBPriority:1);
1221 }
1222 ay = false;
1223 if (0 < plp[iClient][66][u])
1224 {
1225 new i;
1226 while (i <= wsim)
1227 {
1228 new var9;
1229 if (wsi[i][0] == plp[iClient][66][u] && (!wsi[i][1] || StrContains(wsi[i][1], var12[0][var12][u], true) == -1) && (!wsi[i][513] || StrContains(wsi[i][513], grups[plp[iClient][0]][513], true) == -1))
1230 {
1231 ay = true;
1232 }
1233 i++;
1234 }
1235 }
1236 else
1237 {
1238 ay = true;
1239 }
1240 if (!ay)
1241 {
1242 plp[iClient][66][u] = 0;
1243 new var13 = weapon;
1244 FormatEx(up, 256, "UPDATE weapon_skin SET %s = '%d' WHERE steamid = '%s';", var13[0][var13][u], 0, steamid[iClient]);
1245 SQL_TQuery(bd_ws, SQL_Check, up, any:0, DBPriority:1);
1246 }
1247 we_n[iClient] = u;
1248 revap(iClient);
1249 }
1250 u++;
1251 }
1252 }
1253 ispp[iClient] = 1;
1254 }
1255 i++;
1256 }
1257 new var6;
1258 if (ispl[iClient] && plp[iClient][0] != -1)
1259 {
1260 new String:up[256];
1261 new bool:ay;
1262 new u;
1263 while (u < 65)
1264 {
1265 new var10 = weapon;
1266 if (var10[0][var10][u])
1267 {
1268 if (grups[plp[iClient][0]][578] < plp[iClient][262][u])
1269 {
1270 plp[iClient][262][u] = grups[plp[iClient][0]][578];
1271 new var11 = weapon;
1272 FormatEx(up, 256, "UPDATE weapon_skin_ql SET %s = '%d' WHERE steamid = '%s';", var11[0][var11][u], plp[iClient][262][u], steamid[iClient]);
1273 SQL_TQuery(bd_ws, SQL_Check, up, any:0, DBPriority:1);
1274 }
1275 ay = false;
1276 if (0 < plp[iClient][66][u])
1277 {
1278 new i;
1279 while (i <= wsim)
1280 {
1281 new var9;
1282 if (wsi[i][0] == plp[iClient][66][u] && (!wsi[i][1] || StrContains(wsi[i][1], var12[0][var12][u], true) == -1) && (!wsi[i][513] || StrContains(wsi[i][513], grups[plp[iClient][0]][513], true) == -1))
1283 {
1284 ay = true;
1285 }
1286 i++;
1287 }
1288 }
1289 else
1290 {
1291 ay = true;
1292 }
1293 if (!ay)
1294 {
1295 plp[iClient][66][u] = 0;
1296 new var13 = weapon;
1297 FormatEx(up, 256, "UPDATE weapon_skin SET %s = '%d' WHERE steamid = '%s';", var13[0][var13][u], 0, steamid[iClient]);
1298 SQL_TQuery(bd_ws, SQL_Check, up, any:0, DBPriority:1);
1299 }
1300 we_n[iClient] = u;
1301 revap(iClient);
1302 }
1303 u++;
1304 }
1305 }
1306 ispp[iClient] = 1;
1307 }
1308 return Action:0;
1309}
1310
1311public Action:Command_sweapon(iClient, args)
1312{
1313 if (ok)
1314 {
1315 if (ok)
1316 {
1317 }
1318 }
1319 if (av)
1320 {
1321 new var1;
1322 if (!ispl[iClient] || !ispp[iClient])
1323 {
1324 PrintToChat(iClient, " \x03[Weapon skin\x03] \x04Ваши данные не загружены ожидайте");
1325 return Action:3;
1326 }
1327 if (plp[iClient][0] != -1)
1328 {
1329 cl_cm[iClient] = 0;
1330 new String:name[256];
1331 new Menu:m = Menu.Menu(m_h, MenuAction:28);
1332 Menu.SetTitle(m, "Группа: %s\nКачеÑтво: %d%%\n ", grups[plp[iClient][0]][513], grups[plp[iClient][0]][578]);
1333 new String:id[16];
1334 new i;
1335 while (i < 35)
1336 {
1337 if (sort[i])
1338 {
1339 if (sort[i] == -1)
1340 {
1341 if (knife_choice_core)
1342 {
1343 new var3;
1344 if (plp[iClient][66] <= 0)
1345 {
1346 new var2;
1347 if (plp[iClient][66] == -1)
1348 {
1349 var2 = 3278992;
1350 }
1351 else
1352 {
1353 var2 = 3279012;
1354 }
1355 var3[0] = var2;
1356 }
1357 else
1358 {
1359 var3[0] = sname[plp[iClient][66]];
1360 }
1361 FormatEx(name, 256, "Ðож [%s]", var3);
1362 Menu.AddItem(m, "0", name, 0);
1363 }
1364 }
1365 IntToString(sort[i], id, 15);
1366 new var5;
1367 if (plp[iClient][66][sort[i]] <= 0)
1368 {
1369 new var4;
1370 if (plp[iClient][66][sort[i]] == -1)
1371 {
1372 var4 = 3279040;
1373 }
1374 else
1375 {
1376 var4 = 3279060;
1377 }
1378 var5[0] = var4;
1379 }
1380 else
1381 {
1382 var5[0] = sname[plp[iClient][66][sort[i]]];
1383 }
1384 FormatEx(name, 256, "%s [%s]", weapon[1][sort[i]], var5);
1385 Menu.AddItem(m, id, name, 0);
1386 }
1387 i++;
1388 }
1389 Menu.Display(m, iClient, 0);
1390 }
1391 PrintToChat(iClient, " \x03[Weapon skin\x03] \x04Ð’Ñ‹ не имеете доÑтупа к Weapon skin");
1392 }
1393 return Action:3;
1394}
1395
1396void:men_p(iClient)
1397{
1398 if (ok)
1399 {
1400 if (ok)
1401 {
1402 }
1403 }
1404 if (av)
1405 {
1406 new Menu:m = Menu.Menu(m_l, MenuAction:28);
1407 Menu.ExitBackButton.set(m, true);
1408 Menu.SetTitle(m, "ÐаÑтройка параметров Ð´Ð»Ñ %s\n ", weapon[1][we_n[iClient]]);
1409 new String:name[256];
1410 new var2;
1411 if (plp[iClient][66][we_n[iClient]] <= 0)
1412 {
1413 new var1;
1414 if (plp[iClient][66][we_n[iClient]] == -1)
1415 {
1416 var1 = 3279216;
1417 }
1418 else
1419 {
1420 var1 = 3279236;
1421 }
1422 var2[0] = var1;
1423 }
1424 else
1425 {
1426 var2[0] = sname[plp[iClient][66][we_n[iClient]]];
1427 }
1428 FormatEx(name, 256, "Скин [%s]", var2);
1429 Menu.AddItem(m, "", name, 0);
1430 if (plp[iClient][66][we_n[iClient]])
1431 {
1432 FormatEx(name, 256, "КачеÑтво [%d%%]", plp[iClient][262][we_n[iClient]]);
1433 Menu.AddItem(m, "", name, 0);
1434 if (grups[plp[iClient][0]][1231])
1435 {
1436 if (plp[iClient][131][we_n[iClient]] < 1)
1437 {
1438 if (plp[iClient][131][we_n[iClient]] == -1)
1439 {
1440 if (plp[iClient][327][we_n[iClient]])
1441 {
1442 FormatEx(name, 256, "Смещение Ñкина [Рандомно (поÑледнее Ñмещение %d)]", plp[iClient][327][we_n[iClient]]);
1443 }
1444 else
1445 {
1446 FormatEx(name, 256, "Смещение Ñкина [Рандомно]");
1447 }
1448 }
1449 else
1450 {
1451 FormatEx(name, 256, "Смещение Ñкина [Отключено]");
1452 }
1453 }
1454 else
1455 {
1456 FormatEx(name, 256, "Смещение Ñкина [%d]", plp[iClient][131][we_n[iClient]]);
1457 }
1458 Menu.AddItem(m, "", name, 0);
1459 }
1460 else
1461 {
1462 Menu.AddItem(m, "", "Смещение Ñкина [ÐЕДОСТУПÐО]", 1);
1463 }
1464 new var3;
1465 if (grups[plp[iClient][0]][577] && we_n[iClient] != 49)
1466 {
1467 new var4;
1468 if (plp[iClient][197][we_n[iClient]])
1469 {
1470 var4[0] = 3279592;
1471 }
1472 else
1473 {
1474 var4[0] = 3279612;
1475 }
1476 FormatEx(name, 256, "StatTrakâ„¢: %d [%s]", plp[iClient][1][we_n[iClient]], var4);
1477 Menu.AddItem(m, "", name, 0);
1478 }
1479 else
1480 {
1481 Menu.AddItem(m, "", "StatTrakâ„¢ [ÐЕДОСТУПÐО]", 1);
1482 }
1483 if (grups[plp[iClient][0]][1232])
1484 {
1485 new var5;
1486 if (nm[iClient][we_n[iClient]][0])
1487 {
1488 var5[0] = nm[iClient][we_n[iClient]];
1489 }
1490 else
1491 {
1492 var5[0] = 3279708;
1493 }
1494 FormatEx(name, 256, "Именной Ñрлык [%s]", var5);
1495 Menu.AddItem(m, "", name, 0);
1496 }
1497 else
1498 {
1499 Menu.AddItem(m, "", "Именной Ñрлык [ÐЕДОСТУПÐО]", 1);
1500 }
1501 }
1502 else
1503 {
1504 Menu.AddItem(m, "", "КачеÑтво", 1);
1505 Menu.AddItem(m, "", "Смещение Ñкина", 1);
1506 Menu.AddItem(m, "", "StatTrakâ„¢", 1);
1507 Menu.AddItem(m, "", "Именной Ñрлык", 1);
1508 }
1509 Menu.Display(m, iClient, 0);
1510 }
1511 return void:0;
1512}
1513
1514public m_h(Menu:hMenu, MenuAction:action, iClient, Item)
1515{
1516 if (ok)
1517 {
1518 if (ok)
1519 {
1520 }
1521 }
1522 if (av)
1523 {
1524 switch (action)
1525 {
1526 case 4:
1527 {
1528 new String:id[16];
1529 Menu.GetItem(hMenu, Item, id, 15, 0, "", 0);
1530 we_n[iClient] = StringToInt(id, 10);
1531 men_p(iClient);
1532 }
1533 case 16:
1534 {
1535 CloseHandle(hMenu);
1536 hMenu = MissingTAG:0;
1537 }
1538 default:
1539 {
1540 }
1541 }
1542 }
1543 return 0;
1544}
1545
1546public m_l(Menu:hMenu, MenuAction:action, iClient, Item)
1547{
1548 if (ok)
1549 {
1550 if (ok)
1551 {
1552 }
1553 }
1554 if (av)
1555 {
1556 switch (action)
1557 {
1558 case 4:
1559 {
1560 switch (Item)
1561 {
1562 case 0:
1563 {
1564 new Menu:Mn = Menu.Menu(Weapon_cfg, MenuAction:28);
1565 Menu.ExitBackButton.set(Mn, true);
1566 Menu.SetTitle(Mn, "Выбор Ñкина Ð´Ð»Ñ %s\n ", weapon[1][we_n[iClient]]);
1567 Menu.AddItem(Mn, "-2", "ПоиÑк", 0);
1568 Menu.AddItem(Mn, "-1", "Рандомно", 0);
1569 Menu.AddItem(Mn, "0", "Стандарт", 0);
1570 new String:y[8];
1571 new i;
1572 while (i <= wsim)
1573 {
1574 new var1;
1575 if (!wsi[i][1] || Dostyp_s(wsi[i][1], var3[0][var3][we_n[iClient]]))
1576 {
1577 IntToString(wsi[i][0], y, 8);
1578 if (wsi[i][513])
1579 {
1580 if (StrContains(wsi[i][513], grups[plp[iClient][0]][513], true) != -1)
1581 {
1582 Menu.AddItem(Mn, y, sname[wsi[i][0]], 0);
1583 }
1584 else
1585 {
1586 if (display_no_access)
1587 {
1588 Menu.AddItem(Mn, "", sname[wsi[i][0]], 1);
1589 }
1590 }
1591 }
1592 Menu.AddItem(Mn, y, sname[wsi[i][0]], 0);
1593 }
1594 i++;
1595 }
1596 Menu.Display(Mn, iClient, 0);
1597 }
1598 case 1:
1599 {
1600 new Menu:mn_sm = Menu.Menu(m_mn_ql, MenuAction:28);
1601 Menu.ExitBackButton.set(mn_sm, true);
1602 Menu.SetTitle(mn_sm, "Выбор качеÑтва Ð´Ð»Ñ %s\n ", weapon[1][we_n[iClient]]);
1603 new String:y[8];
1604 new i = grups[plp[iClient][0]][578];
1605 while (i >= 1)
1606 {
1607 FormatEx(y, 8, "%d%%", i);
1608 Menu.AddItem(mn_sm, "", y, 0);
1609 i--;
1610 }
1611 Menu.Display(mn_sm, iClient, 0);
1612 }
1613 case 2:
1614 {
1615 new Menu:mn_sm = Menu.Menu(m_mn_sm, MenuAction:28);
1616 Menu.ExitBackButton.set(mn_sm, true);
1617 Menu.SetTitle(mn_sm, "Выбор ÑÐ¼ÐµÑ‰ÐµÐ½Ð¸Ñ Ð´Ð»Ñ %s\n ", weapon[1][we_n[iClient]]);
1618 Menu.AddItem(mn_sm, "", "Рандомно", 0);
1619 Menu.AddItem(mn_sm, "", "Отключено", 0);
1620 Menu.AddItem(mn_sm, "", "Указать Ñвое", 0);
1621 Menu.Display(mn_sm, iClient, 0);
1622 }
1623 case 3:
1624 {
1625 plp[iClient][197][we_n[iClient]] = !plp[iClient][197][we_n[iClient]];
1626 revap(iClient);
1627 new String:up[256];
1628 new var2 = weapon;
1629 FormatEx(up, 256, "UPDATE weapon_skin_st SET %s = '%d' WHERE steamid = '%s';", var2[0][var2][we_n[iClient]], plp[iClient][197][we_n[iClient]], steamid[iClient]);
1630 SQL_TQuery(bd_ws, SQL_Check, up, any:0, DBPriority:1);
1631 men_p(iClient);
1632 }
1633 case 4:
1634 {
1635 new Menu:mn_sm = Menu.Menu(m_mn_nm, MenuAction:28);
1636 Menu.ExitBackButton.set(mn_sm, true);
1637 Menu.SetTitle(mn_sm, "ÐаÑтройка именного Ñрлыка Ð´Ð»Ñ %s\n ", weapon[1][we_n[iClient]]);
1638 Menu.AddItem(mn_sm, "", "Убрать", 0);
1639 Menu.AddItem(mn_sm, "", "Задать", 0);
1640 Menu.Display(mn_sm, iClient, 0);
1641 }
1642 default:
1643 {
1644 }
1645 }
1646 }
1647 case 8:
1648 {
1649 if (Item == -6)
1650 {
1651 Command_sweapon(iClient, 0);
1652 }
1653 }
1654 case 16:
1655 {
1656 CloseHandle(hMenu);
1657 hMenu = MissingTAG:0;
1658 }
1659 default:
1660 {
1661 }
1662 }
1663 }
1664 return 0;
1665}
1666
1667public m_mn_nm(Menu:hMenu, MenuAction:action, iClient, Item)
1668{
1669 if (ok)
1670 {
1671 if (ok)
1672 {
1673 }
1674 }
1675 if (av)
1676 {
1677 switch (action)
1678 {
1679 case 4:
1680 {
1681 switch (Item)
1682 {
1683 case 0:
1684 {
1685 strcopy(nm[iClient][we_n[iClient]], 64, "");
1686 new String:up[256];
1687 new var1 = weapon;
1688 FormatEx(up, 256, "UPDATE weapon_skin_nm SET %s = '' WHERE steamid = '%s';", var1[0][var1][we_n[iClient]], steamid[iClient]);
1689 SQL_TQuery(bd_ws, SQL_Check, up, any:0, DBPriority:1);
1690 revap(iClient);
1691 men_p(iClient);
1692 }
1693 case 1:
1694 {
1695 CGOPrintToChat(iClient, "{GREEN}Введите в чат текÑÑ‚ Ð´Ð»Ñ Ð¸Ð¼ÐµÐ½Ð½Ð¾Ð³Ð¾ Ñрлыка или stop Ð´Ð»Ñ Ð¾Ñ‚Ð¼ÐµÐ½Ñ‹");
1696 cl_cm[iClient] = 3;
1697 }
1698 default:
1699 {
1700 }
1701 }
1702 }
1703 case 8:
1704 {
1705 if (Item == -6)
1706 {
1707 men_p(iClient);
1708 }
1709 }
1710 case 16:
1711 {
1712 CloseHandle(hMenu);
1713 hMenu = MissingTAG:0;
1714 }
1715 default:
1716 {
1717 }
1718 }
1719 }
1720 return 0;
1721}
1722
1723public m_mn_ql(Menu:hMenu, MenuAction:action, iClient, Item)
1724{
1725 if (ok)
1726 {
1727 if (ok)
1728 {
1729 }
1730 }
1731 if (av)
1732 {
1733 switch (action)
1734 {
1735 case 4:
1736 {
1737 plp[iClient][262][we_n[iClient]] = grups[plp[iClient][0]][578] - Item;
1738 new String:up[256];
1739 new var1 = weapon;
1740 FormatEx(up, 256, "UPDATE weapon_skin_ql SET %s = '%d' WHERE steamid = '%s';", var1[0][var1][we_n[iClient]], plp[iClient][262][we_n[iClient]], steamid[iClient]);
1741 SQL_TQuery(bd_ws, SQL_Check, up, any:0, DBPriority:1);
1742 revap(iClient);
1743 men_p(iClient);
1744 }
1745 case 8:
1746 {
1747 if (Item == -6)
1748 {
1749 men_p(iClient);
1750 }
1751 }
1752 case 16:
1753 {
1754 CloseHandle(hMenu);
1755 hMenu = MissingTAG:0;
1756 }
1757 default:
1758 {
1759 }
1760 }
1761 }
1762 return 0;
1763}
1764
1765public m_mn_sm(Menu:hMenu, MenuAction:action, iClient, Item)
1766{
1767 if (ok)
1768 {
1769 if (ok)
1770 {
1771 }
1772 }
1773 if (av)
1774 {
1775 switch (action)
1776 {
1777 case 4:
1778 {
1779 switch (Item)
1780 {
1781 case 0:
1782 {
1783 new String:up[256];
1784 new var2 = weapon;
1785 FormatEx(up, 256, "UPDATE weapon_skin_sm SET %s = '-1' WHERE steamid = '%s';", var2[0][var2][we_n[iClient]], steamid[iClient]);
1786 SQL_TQuery(bd_ws, SQL_Check, up, any:0, DBPriority:1);
1787 plp[iClient][131][we_n[iClient]] = -1;
1788 revap(iClient);
1789 men_p(iClient);
1790 }
1791 case 1:
1792 {
1793 new String:up[256];
1794 new var1 = weapon;
1795 FormatEx(up, 256, "UPDATE weapon_skin_sm SET %s = '0' WHERE steamid = '%s';", var1[0][var1][we_n[iClient]], steamid[iClient]);
1796 SQL_TQuery(bd_ws, SQL_Check, up, any:0, DBPriority:1);
1797 plp[iClient][131][we_n[iClient]] = 0;
1798 revap(iClient);
1799 men_p(iClient);
1800 }
1801 case 2:
1802 {
1803 cl_cm[iClient] = 1;
1804 CGOPrintToChat(iClient, "{GREEN}Ð”Ð»Ñ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ ÑÐ¼ÐµÑ‰ÐµÐ½Ð¸Ñ Ð²Ð²ÐµÐ´Ð¸Ñ‚Ðµ в чат чиÑло или stop Ð´Ð»Ñ Ð¾Ñ‚Ð¼ÐµÐ½Ñ‹");
1805 }
1806 default:
1807 {
1808 }
1809 }
1810 }
1811 case 8:
1812 {
1813 if (Item == -6)
1814 {
1815 men_p(iClient);
1816 }
1817 }
1818 case 16:
1819 {
1820 CloseHandle(hMenu);
1821 hMenu = MissingTAG:0;
1822 }
1823 default:
1824 {
1825 }
1826 }
1827 }
1828 return 0;
1829}
1830
1831public Weapon_cfg(Menu:hMenu, MenuAction:action, iClient, Item)
1832{
1833 if (ok)
1834 {
1835 if (ok)
1836 {
1837 }
1838 }
1839 if (av)
1840 {
1841 switch (action)
1842 {
1843 case 4:
1844 {
1845 new String:up[256];
1846 Menu.GetItem(hMenu, Item, up, 256, 0, "", 0);
1847 new sk = StringToInt(up, 10);
1848 if (sk != -2)
1849 {
1850 plp[iClient][66][we_n[iClient]] = sk;
1851 new var1 = weapon;
1852 FormatEx(up, 256, "UPDATE weapon_skin SET %s = '%d' WHERE steamid = '%s';", var1[0][var1][we_n[iClient]], sk, steamid[iClient]);
1853 SQL_TQuery(bd_ws, SQL_Check, up, any:0, DBPriority:1);
1854 revap(iClient);
1855 men_p(iClient);
1856 }
1857 else
1858 {
1859 cl_cm[iClient] = 2;
1860 CGOPrintToChat(iClient, "{GREEN}Введите в чат чаÑть из Ð½Ð°Ð·Ð²Ð°Ð½Ð¸Ñ Ñкина или stop Ð´Ð»Ñ Ð¾Ñ‚Ð¼ÐµÐ½Ñ‹");
1861 }
1862 }
1863 case 8:
1864 {
1865 if (Item == -6)
1866 {
1867 men_p(iClient);
1868 }
1869 }
1870 default:
1871 {
1872 }
1873 }
1874 }
1875 return 0;
1876}
1877
1878void:revap(iClient)
1879{
1880 if (ok)
1881 {
1882 if (ok)
1883 {
1884 }
1885 }
1886 if (av)
1887 {
1888 if (!we_n[iClient])
1889 {
1890 new var1;
1891 if (IsPlayerAlive(iClient) && kc[iClient] > 3)
1892 {
1893 KCC_SetKnife(iClient, KCC_GetKnifeTypeInId(kc[iClient]));
1894 }
1895 return void:0;
1896 }
1897 new var2;
1898 if (reweapon && IsPlayerAlive(iClient))
1899 {
1900 new w;
1901 new f1;
1902 new f2;
1903 new String:id[64];
1904 new i;
1905 while (i <= 2)
1906 {
1907 if (i == 2)
1908 {
1909 i = 4;
1910 }
1911 w = GetPlayerWeaponSlot(iClient, i);
1912 new var3;
1913 if (w > 0 && we_n[iClient] == GetEntData(w, ofst_iItemDefinitionIndex, 4) && plp[iClient][392] == GetEntData(w, ofst_iAccountID, 4))
1914 {
1915 if (i != 4)
1916 {
1917 f1 = GetEntProp(w, PropType:0, "m_iPrimaryReserveAmmoCount", 4, 0);
1918 f2 = GetEntProp(w, PropType:0, "m_iClip1", 4, 0);
1919 }
1920 RemovePlayerItem(iClient, w);
1921 AcceptEntityInput(w, "Kill", -1, -1, 0);
1922 new var4 = weapon;
1923 FormatEx(id, 64, "weapon_%s", var4[0][var4][we_n[iClient]]);
1924 w = GivePlayerItem(iClient, id, 0);
1925 if (i != 4)
1926 {
1927 SetEntProp(w, PropType:0, "m_iPrimaryReserveAmmoCount", f1, 4, 0);
1928 SetEntProp(w, PropType:0, "m_iClip1", f2, 4, 0);
1929 }
1930 }
1931 i++;
1932 }
1933 }
1934 }
1935 return void:0;
1936}
1937
1938public void:GiveNamedItem(iClient, String:sClassname[], CEconItemView:Item, weap)
1939{
1940 if (ok)
1941 {
1942 if (ok)
1943 {
1944 }
1945 }
1946 new var1;
1947 if (av && weap != -1)
1948 {
1949 if (plp[iClient][0] != -1)
1950 {
1951 if (sClassname[0] == 'w')
1952 {
1953 new dinx = GetEntData(weap, ofst_iItemDefinitionIndex, 4);
1954 SetEntData(weap, ofst_iAccountID, plp[iClient][392], 4, false);
1955 new var2;
1956 if (dinx < 65 && var8[0][var8][dinx] && plp[iClient][66][dinx])
1957 {
1958 SetEntData(weap, ofst_iItemIDLow, any:2048, 4, false);
1959 SetEntData(weap, ofst_iItemIDHigh, any:0, 4, false);
1960 new Float:op = 0.0;
1961 if (plp[iClient][262][dinx] == 100)
1962 {
1963 op = 1.0E-9;
1964 }
1965 else
1966 {
1967 op = float(plp[iClient][262][dinx]) / -100.0 + 1.0;
1968 }
1969 SetEntDataFloat(weap, ofst_flFallbackWear, op, false);
1970 new var3;
1971 if (grups[plp[iClient][0]][1231] && plp[iClient][131][dinx])
1972 {
1973 plp[iClient][327][dinx] = GetRandomInt(0, 100000);
1974 new var4;
1975 if (plp[iClient][131][dinx] == -1)
1976 {
1977 var4 = plp[iClient][327][dinx];
1978 }
1979 else
1980 {
1981 var4 = plp[iClient][131][dinx];
1982 }
1983 SetEntData(weap, ofst_nFallbackSeed, var4, 4, false);
1984 }
1985 new var5;
1986 if (dinx != 49 && grups[plp[iClient][0]][577] && plp[iClient][197][dinx])
1987 {
1988 SetEntData(weap, ofst_iEntityQuality, any:9, 4, false);
1989 SetEntData(weap, ofst_nFallbackStatTrak, plp[iClient][1][dinx], 4, false);
1990 }
1991 new var6;
1992 if (plp[iClient][66][dinx] == -1)
1993 {
1994 var6 = RandomSkin(iClient, dinx);
1995 }
1996 else
1997 {
1998 var6 = plp[iClient][66][dinx];
1999 }
2000 SetEntData(weap, ofst_nFallbackPaintKit, var6, 4, false);
2001 new var7;
2002 if (grups[plp[iClient][0]][1232] && nm[iClient][dinx][0])
2003 {
2004 SetEntDataString(weap, ofst_cn, nm[iClient][dinx], 64, false);
2005 }
2006 }
2007 }
2008 }
2009 }
2010 return void:0;
2011}
2012
2013public void:KCC_OnReceivesKnife(iClient, knifes:kKnife, iKnife, iKnifeEntity, String:sKnifeName[], bool:bKnifeClient)
2014{
2015 if (ok)
2016 {
2017 if (ok)
2018 {
2019 }
2020 }
2021 if (av)
2022 {
2023 kc[iClient] = iKnife;
2024 new var1;
2025 if (bKnifeClient && iKnife > 3 && plp[iClient][0] != -1 && plp[iClient][66])
2026 {
2027 SetEntData(iKnifeEntity, ofst_iAccountID, plp[iClient][392], 4, false);
2028 SetEntData(iKnifeEntity, ofst_iItemIDLow, any:2048, 4, false);
2029 SetEntData(iKnifeEntity, ofst_iItemIDHigh, any:0, 4, false);
2030 new Float:op = 0.0;
2031 if (plp[iClient][262] == 100)
2032 {
2033 op = 1.0E-9;
2034 }
2035 else
2036 {
2037 op = float(plp[iClient][262]) / -100.0 + 1.0;
2038 }
2039 SetEntDataFloat(iKnifeEntity, ofst_flFallbackWear, op, false);
2040 new var2;
2041 if (grups[plp[iClient][0]][1231] && plp[iClient][131])
2042 {
2043 plp[iClient][327] = GetRandomInt(0, 100000);
2044 new var3;
2045 if (plp[iClient][131] == -1)
2046 {
2047 var3 = plp[iClient][327];
2048 }
2049 else
2050 {
2051 var3 = plp[iClient][131];
2052 }
2053 SetEntData(iKnifeEntity, ofst_nFallbackSeed, var3, 4, false);
2054 }
2055 new var4;
2056 if (grups[plp[iClient][0]][577] && plp[iClient][197])
2057 {
2058 SetEntData(iKnifeEntity, ofst_iEntityQuality, any:3, 4, false);
2059 SetEntData(iKnifeEntity, ofst_nFallbackStatTrak, plp[iClient][1], 4, false);
2060 }
2061 new var5;
2062 if (plp[iClient][66] == -1)
2063 {
2064 var5 = RandomSkin(iClient, 0);
2065 }
2066 else
2067 {
2068 var5 = plp[iClient][66];
2069 }
2070 SetEntData(iKnifeEntity, ofst_nFallbackPaintKit, var5, 4, false);
2071 new var6;
2072 if (grups[plp[iClient][0]][1232] && nm[iClient][0][0])
2073 {
2074 SetEntDataString(iKnifeEntity, ofst_cn, nm[iClient][0], 64, false);
2075 }
2076 }
2077 }
2078 return void:0;
2079}
2080
2081public Action:Event_player_death(Event:event, String:name[], bool:dontBroadcast)
2082{
2083 if (ok)
2084 {
2085 if (ok)
2086 {
2087 }
2088 }
2089 if (av)
2090 {
2091 new iClient = GetClientOfUserId(Event.GetInt(event, "attacker", 0));
2092 new ig = GetClientOfUserId(Event.GetInt(event, "userid", 0));
2093 new var1;
2094 if (ig && iClient && plp[iClient][0] != -1 && ig != iClient && grups[plp[iClient][0]][577])
2095 {
2096 new String:buf[64];
2097 new dinx;
2098 Event.GetString(event, "weapon", buf, 64, "");
2099 new var2;
2100 if (StringMap.GetValue(Stweap, buf, dinx) && plp[iClient][197][dinx])
2101 {
2102 new weap = GetEntDataEnt2(iClient, ofst_m_hActiveWeapon);
2103 if (0 < weap)
2104 {
2105 if (plp[iClient][392] == GetEntData(weap, ofst_iAccountID, 4))
2106 {
2107 plp[iClient][1][dinx]++;
2108 new String:up[256];
2109 new var3 = weapon;
2110 FormatEx(up, 256, "UPDATE weapon_skin_stat SET %s = '%d' WHERE steamid = '%s';", var3[0][var3][dinx], plp[iClient][1][dinx], steamid[iClient]);
2111 SQL_TQuery(bd_ws, SQL_Check, up, any:0, DBPriority:1);
2112 }
2113 }
2114 }
2115 }
2116 }
2117 return Action:0;
2118}
2119
2120public Action:Say(iClient, String:command[], args)
2121{
2122 if (ok)
2123 {
2124 if (ok)
2125 {
2126 }
2127 }
2128 new var1;
2129 if (iClient < 1 || !IsClientInGame(iClient))
2130 {
2131 return Action:0;
2132 }
2133 new String:sText[192];
2134 GetCmdArgString(sText, 192);
2135 if (cl_cm[iClient])
2136 {
2137 ReplaceString(sText, 192, "\"", "", true);
2138 TrimString(sText);
2139 if (StrContains(sText, "stop", false))
2140 {
2141 switch (cl_cm[iClient])
2142 {
2143 case 1:
2144 {
2145 new io = StringToInt(sText, 10);
2146 if (0 < io)
2147 {
2148 cl_cm[iClient] = 0;
2149 plp[iClient][131][we_n[iClient]] = io;
2150 new String:up[256];
2151 new var5 = weapon;
2152 FormatEx(up, 256, "UPDATE weapon_skin_sm SET %s = '%d' WHERE steamid = '%s';", var5[0][var5][we_n[iClient]], io, steamid[iClient]);
2153 SQL_TQuery(bd_ws, SQL_Check, up, any:0, DBPriority:1);
2154 revap(iClient);
2155 CGOPrintToChat(iClient, "{GREEN}Ð’Ñ‹ уÑпешно изменили Ñмещение Ñкина Ð´Ð»Ñ %s на %d", weapon[1][we_n[iClient]], io);
2156 men_p(iClient);
2157 }
2158 else
2159 {
2160 CGOPrintToChat(iClient, "{GREEN}Ð”Ð»Ñ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ ÑÐ¼ÐµÑ‰ÐµÐ½Ð¸Ñ Ð²Ð²ÐµÐ´Ð¸Ñ‚Ðµ в чат чиÑло или stop Ð´Ð»Ñ Ð¾Ñ‚Ð¼ÐµÐ½Ñ‹");
2161 }
2162 return Action:3;
2163 }
2164 case 2:
2165 {
2166 if (!sText[0])
2167 {
2168 CGOPrintToChat(iClient, "{GREEN}Введите в чат чаÑть из Ð½Ð°Ð·Ð²Ð°Ð½Ð¸Ñ Ñкина или stop Ð´Ð»Ñ Ð¾Ñ‚Ð¼ÐµÐ½Ñ‹");
2169 return Action:3;
2170 }
2171 new Menu:Mn = Menu.Menu(Weapon_cfg, MenuAction:28);
2172 new u;
2173 Menu.ExitBackButton.set(Mn, true);
2174 Menu.SetTitle(Mn, "Выбор Ñкина Ð´Ð»Ñ %s\n ", weapon[1][we_n[iClient]]);
2175 new String:y[8];
2176 new i;
2177 while (i <= wsim)
2178 {
2179 if (UTF8StrContains(sname[wsi[i][0]], sText, false) != -1)
2180 {
2181 new var2;
2182 if (!wsi[i][1] || Dostyp_s(wsi[i][1], var4[0][var4][we_n[iClient]]))
2183 {
2184 IntToString(wsi[i][0], y, 8);
2185 if (wsi[i][513])
2186 {
2187 if (StrContains(wsi[i][513], grups[plp[iClient][0]][513], true) != -1)
2188 {
2189 Menu.AddItem(Mn, y, sname[wsi[i][0]], 0);
2190 u++;
2191 }
2192 else
2193 {
2194 if (display_no_access)
2195 {
2196 Menu.AddItem(Mn, "", sname[wsi[i][0]], 1);
2197 u++;
2198 }
2199 }
2200 }
2201 Menu.AddItem(Mn, y, sname[wsi[i][0]], 0);
2202 u++;
2203 }
2204 }
2205 i++;
2206 }
2207 if (u)
2208 {
2209 cl_cm[iClient] = 0;
2210 CGOPrintToChat(iClient, "{GREEN}По тегу {RED}%s {GREEN}найдено %d Ñкин(ов)", sText, u);
2211 Menu.Display(Mn, iClient, 0);
2212 return Action:3;
2213 }
2214 CloseHandle(Mn);
2215 Mn = MissingTAG:0;
2216 CGOPrintToChat(iClient, "{GREEN}По тегу {RED}%s {GREEN}не найдено Ñкинов", sText);
2217 return Action:3;
2218 }
2219 case 3:
2220 {
2221 if (!sText[0])
2222 {
2223 CGOPrintToChat(iClient, "{GREEN}Введите в чат текÑÑ‚ Ð´Ð»Ñ Ð¸Ð¼ÐµÐ½Ð½Ð¾Ð³Ð¾ Ñрлыка или stop Ð´Ð»Ñ Ð¾Ñ‚Ð¼ÐµÐ½Ñ‹");
2224 return Action:3;
2225 }
2226 if (strlen(sText) > 64)
2227 {
2228 CGOPrintToChat(iClient, "{RED}ТекÑÑ‚ длинной больше 64 Ñимволов уÑтановить Ð½ÐµÐ»ÑŒÐ·Ñ (Ñ‚ÐµÐºÑƒÑ‰Ð°Ñ Ð´Ð»Ð¸Ð½Ð° %d)", strlen(sText));
2229 return Action:3;
2230 }
2231 CGOPrintToChat(iClient, "{GREEN}ТекÑÑ‚ {RED}%s {GREEN}уÑтановлен Ð´Ð»Ñ Ð¸Ð¼ÐµÐ½Ð½Ð¾Ð³Ð¾ Ñрлыка", sText);
2232 strcopy(nm[iClient][we_n[iClient]], 64, sText);
2233 new String:up[256];
2234 SQL_EscapeString(bd_ws, sText, sText, 192, 0);
2235 new var3 = weapon;
2236 FormatEx(up, 256, "UPDATE weapon_skin_nm SET %s = '%s' WHERE steamid = '%s';", var3[0][var3][we_n[iClient]], sText, steamid[iClient]);
2237 SQL_TQuery(bd_ws, SQL_Check, up, any:0, DBPriority:1);
2238 revap(iClient);
2239 cl_cm[iClient] = 0;
2240 men_p(iClient);
2241 return Action:3;
2242 }
2243 default:
2244 {
2245 }
2246 }
2247 }
2248 cl_cm[iClient] = 0;
2249 CGOPrintToChat(iClient, "{GREEN}Отменено");
2250 men_p(iClient);
2251 return Action:3;
2252 }
2253 return Action:0;
2254}
2255
2256void:KFG_load()
2257{
2258 if (ok)
2259 {
2260 if (ok)
2261 {
2262 }
2263 }
2264 if (av)
2265 {
2266 new KeyValues:kv = KeyValues.KeyValues("weapon_skin", "", "");
2267 new String:path[128];
2268 new String:g[64];
2269 BuildPath(PathType:0, path, 128, "configs/weapon_skin.ini");
2270 if (!KeyValues.ImportFromFile(kv, path))
2271 {
2272 SetFailState("[Weapon skin] - Файл конфигураций не найден");
2273 }
2274 else
2275 {
2276 KeyValues.Rewind(kv);
2277 static bool:com;
2278 if (!com)
2279 {
2280 com = true;
2281 new String:ui[32][32] = "�";
2282 new String:uo[512];
2283 KeyValues.GetString(kv, "comand", uo, 512, "");
2284 new jl = ExplodeString(uo, ";", ui, 32, 32, false);
2285 new i;
2286 while (i < jl)
2287 {
2288 RegConsoleCmd(ui[i], Command_sweapon, "", 0);
2289 i++;
2290 }
2291 }
2292 display_no_access = KeyValues.GetNum(kv, "display_no_access", 0);
2293 reweapon = KeyValues.GetNum(kv, "reweapon", 0);
2294 KeyValues.Rewind(kv);
2295 KeyValues.JumpToKey(kv, "grups", false);
2296 KeyValues.GotoFirstSubKey(kv, true);
2297 num_p = -1;
2298 do {
2299 if (KeyValues.GetSectionName(kv, g, 64))
2300 {
2301 num_p += 1;
2302 strcopy(grups[num_p][513], 64, g);
2303 KeyValues.GetString(kv, "flags", g, 64, "");
2304 grups[num_p][579] = KeyValues.GetNum(kv, "VIP", 0);
2305 if (g[0])
2306 {
2307 new i;
2308 while (i < 64)
2309 {
2310 g[i] = CharToLower(g[i]);
2311 i++;
2312 }
2313 grups[num_p][0] = ReadFlagString(g, 0);
2314 }
2315 else
2316 {
2317 grups[num_p][0] = 0;
2318 }
2319 KeyValues.GetString(kv, "steam", grups[num_p][1], 512, "");
2320 grups[num_p][577] = KeyValues.GetNum(kv, "StatTrak", 0);
2321 grups[num_p][1231] = KeyValues.GetNum(kv, "Shift", 0);
2322 grups[num_p][1232] = KeyValues.GetNum(kv, "Name Tag", 0);
2323 grups[num_p][578] = KeyValues.GetNum(kv, "quality", 0);
2324 if (0 >= grups[num_p][578])
2325 {
2326 grups[num_p][578] = 1;
2327 }
2328 }
2329 } while (KeyValues.GotoNextKey(kv, true));
2330 new i;
2331 while (i <= num_p)
2332 {
2333 grups[i][1230] = -1;
2334 i++;
2335 }
2336 wsim = -1;
2337 KeyValues.Rewind(kv);
2338 KeyValues.JumpToKey(kv, "skins", false);
2339 KeyValues.GotoFirstSubKey(kv, true);
2340 do {
2341 if (KeyValues.GetSectionName(kv, g, 64))
2342 {
2343 wsim += 1;
2344 wsi[wsim][0] = StringToInt(g, 10);
2345 KeyValues.GetString(kv, "name", sname[wsi[wsim][0]], 128, "");
2346 KeyValues.GetString(kv, "grups", wsi[wsim][513], 512, "");
2347 KeyValues.GetString(kv, "weapon", wsi[wsim][1], 512, "");
2348 if (wsi[wsim][513])
2349 {
2350 new i;
2351 while (i <= num_p)
2352 {
2353 if (StrContains(wsi[wsim][513], grups[i][513], true) != -1)
2354 {
2355 grups[i][1230]++;
2356 grups[i][580][grups[i][1230]] = wsi[wsim][0];
2357 }
2358 i++;
2359 }
2360 }
2361 new i;
2362 while (i <= num_p)
2363 {
2364 grups[i][1230]++;
2365 grups[i][580][grups[i][1230]] = wsi[wsim][0];
2366 i++;
2367 }
2368 }
2369 } while (KeyValues.GotoNextKey(kv, true));
2370 KeyValues.Rewind(kv);
2371 KeyValues.JumpToKey(kv, "weapon", false);
2372 decl r;
2373 new var1 = weapon;
2374 r = KeyValues.GetNum(kv, var1[0][var1], 0);
2375 if (0 < r)
2376 {
2377 sort[r + -1] = -1;
2378 }
2379 new i = 1;
2380 while (i < 65)
2381 {
2382 if (weapon[1][i])
2383 {
2384 new var2 = weapon;
2385 r = KeyValues.GetNum(kv, var2[0][var2][i], 0);
2386 if (0 < r)
2387 {
2388 sort[r + -1] = i;
2389 }
2390 }
2391 i++;
2392 }
2393 }
2394 CloseHandle(kv);
2395 kv = MissingTAG:0;
2396 }
2397 return void:0;
2398}
2399
2400public void:SQL_Check(Handle:owner, Handle:hndl, String:error[], any:data)
2401{
2402 if (!hndl)
2403 {
2404 LogError("[Weapon skin] Ошибка запроÑа базы данных (%s)", error);
2405 }
2406 return void:0;
2407}
2408
2409void:load_pl(iClient)
2410{
2411 if (ok)
2412 {
2413 if (ok)
2414 {
2415 }
2416 }
2417 if (av)
2418 {
2419 new o;
2420 new String:query[2048];
2421 FormatEx(query, 2048, "SELECT knife, deagle, elite, fiveseven, glock, ak47, aug, awp, famas, g3sg1, galilar, m249, m4a1, mac10, p90, ump45, xm1014, bizon, mag7, negev, sawedoff, tec9, hkp2000, mp7, mp9, nova, p250, scar20, sg556, ssg08, c4, m4a1_silencer, usp_silencer, cz75a, revolver FROM weapon_skin WHERE steamid='%s';", steamid[iClient]);
2422 new Handle:hquery = SQL_Query(bd_ws, query, -1);
2423 new var1;
2424 if (hquery && SQL_FetchRow(hquery))
2425 {
2426 o = 0;
2427 new u;
2428 while (u < 65)
2429 {
2430 new var7 = weapon;
2431 if (var7[0][var7][u])
2432 {
2433 plp[iClient][66][u] = SQL_FetchInt(hquery, o, 0);
2434 o++;
2435 }
2436 u++;
2437 }
2438 }
2439 else
2440 {
2441 FormatEx(query, 2048, "INSERT INTO weapon_skin (steamid, knife, deagle, elite, fiveseven, glock, ak47, aug, awp, famas, g3sg1, galilar, m249, m4a1, mac10, p90, ump45, xm1014, bizon, mag7, negev, sawedoff, tec9, hkp2000, mp7, mp9, nova, p250, scar20, sg556, ssg08, c4, m4a1_silencer, usp_silencer, cz75a, revolver) VALUES ('%s', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);", steamid[iClient]);
2442 SQL_TQuery(bd_ws, SQL_Check, query, any:0, DBPriority:1);
2443 }
2444 if (hquery)
2445 {
2446 CloseHandle(hquery);
2447 hquery = MissingTAG:0;
2448 }
2449 FormatEx(query, 2048, "SELECT knife, deagle, elite, fiveseven, glock, ak47, aug, awp, famas, g3sg1, galilar, m249, m4a1, mac10, p90, ump45, xm1014, bizon, mag7, negev, sawedoff, tec9, hkp2000, mp7, mp9, nova, p250, scar20, sg556, ssg08, c4, m4a1_silencer, usp_silencer, cz75a, revolver FROM weapon_skin_sm WHERE steamid='%s';", steamid[iClient]);
2450 hquery = SQL_Query(bd_ws, query, -1);
2451 new var2;
2452 if (hquery && SQL_FetchRow(hquery))
2453 {
2454 o = 0;
2455 new u;
2456 while (u < 65)
2457 {
2458 new var8 = weapon;
2459 if (var8[0][var8][u])
2460 {
2461 plp[iClient][131][u] = SQL_FetchInt(hquery, o, 0);
2462 o++;
2463 }
2464 u++;
2465 }
2466 }
2467 else
2468 {
2469 FormatEx(query, 2048, "INSERT INTO weapon_skin_sm (steamid, knife, deagle, elite, fiveseven, glock, ak47, aug, awp, famas, g3sg1, galilar, m249, m4a1, mac10, p90, ump45, xm1014, bizon, mag7, negev, sawedoff, tec9, hkp2000, mp7, mp9, nova, p250, scar20, sg556, ssg08, c4, m4a1_silencer, usp_silencer, cz75a, revolver) VALUES ('%s', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);", steamid[iClient]);
2470 SQL_TQuery(bd_ws, SQL_Check, query, any:0, DBPriority:1);
2471 }
2472 if (hquery)
2473 {
2474 CloseHandle(hquery);
2475 hquery = MissingTAG:0;
2476 }
2477 FormatEx(query, 2048, "SELECT knife, deagle, elite, fiveseven, glock, ak47, aug, awp, famas, g3sg1, galilar, m249, m4a1, mac10, p90, ump45, xm1014, bizon, mag7, negev, sawedoff, tec9, hkp2000, mp7, mp9, nova, p250, scar20, sg556, ssg08, c4, m4a1_silencer, usp_silencer, cz75a, revolver FROM weapon_skin_st WHERE steamid='%s';", steamid[iClient]);
2478 hquery = SQL_Query(bd_ws, query, -1);
2479 new var3;
2480 if (hquery && SQL_FetchRow(hquery))
2481 {
2482 o = 0;
2483 new u;
2484 while (u < 65)
2485 {
2486 new var9 = weapon;
2487 if (var9[0][var9][u])
2488 {
2489 plp[iClient][197][u] = SQL_FetchInt(hquery, o, 0);
2490 o++;
2491 }
2492 u++;
2493 }
2494 }
2495 else
2496 {
2497 FormatEx(query, 2048, "INSERT INTO weapon_skin_st (steamid, knife, deagle, elite, fiveseven, glock, ak47, aug, awp, famas, g3sg1, galilar, m249, m4a1, mac10, p90, ump45, xm1014, bizon, mag7, negev, sawedoff, tec9, hkp2000, mp7, mp9, nova, p250, scar20, sg556, ssg08, c4, m4a1_silencer, usp_silencer, cz75a, revolver) VALUES ('%s', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);", steamid[iClient]);
2498 SQL_TQuery(bd_ws, SQL_Check, query, any:0, DBPriority:1);
2499 o = 0;
2500 new u;
2501 while (u < 65)
2502 {
2503 new var10 = weapon;
2504 if (var10[0][var10][u])
2505 {
2506 plp[iClient][197][u] = 1;
2507 o++;
2508 }
2509 u++;
2510 }
2511 }
2512 if (hquery)
2513 {
2514 CloseHandle(hquery);
2515 hquery = MissingTAG:0;
2516 }
2517 FormatEx(query, 2048, "SELECT knife, deagle, elite, fiveseven, glock, ak47, aug, awp, famas, g3sg1, galilar, m249, m4a1, mac10, p90, ump45, xm1014, bizon, mag7, negev, sawedoff, tec9, hkp2000, mp7, mp9, nova, p250, scar20, sg556, ssg08, c4, m4a1_silencer, usp_silencer, cz75a, revolver FROM weapon_skin_ql WHERE steamid='%s';", steamid[iClient]);
2518 hquery = SQL_Query(bd_ws, query, -1);
2519 new var4;
2520 if (hquery && SQL_FetchRow(hquery))
2521 {
2522 o = 0;
2523 new u;
2524 while (u < 65)
2525 {
2526 new var11 = weapon;
2527 if (var11[0][var11][u])
2528 {
2529 plp[iClient][262][u] = SQL_FetchInt(hquery, o, 0);
2530 o++;
2531 }
2532 u++;
2533 }
2534 }
2535 else
2536 {
2537 FormatEx(query, 2048, "INSERT INTO weapon_skin_ql (steamid, knife, deagle, elite, fiveseven, glock, ak47, aug, awp, famas, g3sg1, galilar, m249, m4a1, mac10, p90, ump45, xm1014, bizon, mag7, negev, sawedoff, tec9, hkp2000, mp7, mp9, nova, p250, scar20, sg556, ssg08, c4, m4a1_silencer, usp_silencer, cz75a, revolver) VALUES ('%s', 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100);", steamid[iClient]);
2538 SQL_TQuery(bd_ws, SQL_Check, query, any:0, DBPriority:1);
2539 new u;
2540 while (u < 65)
2541 {
2542 new var12 = weapon;
2543 if (var12[0][var12][u])
2544 {
2545 plp[iClient][262][u] = 100;
2546 }
2547 u++;
2548 }
2549 }
2550 if (hquery)
2551 {
2552 CloseHandle(hquery);
2553 hquery = MissingTAG:0;
2554 }
2555 FormatEx(query, 2048, "SELECT knife, deagle, elite, fiveseven, glock, ak47, aug, awp, famas, g3sg1, galilar, m249, m4a1, mac10, p90, ump45, xm1014, bizon, mag7, negev, sawedoff, tec9, hkp2000, mp7, mp9, nova, p250, scar20, sg556, ssg08, c4, m4a1_silencer, usp_silencer, cz75a, revolver FROM weapon_skin_stat WHERE steamid='%s';", steamid[iClient]);
2556 hquery = SQL_Query(bd_ws, query, -1);
2557 new var5;
2558 if (hquery && SQL_FetchRow(hquery))
2559 {
2560 o = 0;
2561 new u;
2562 while (u < 65)
2563 {
2564 new var13 = weapon;
2565 if (var13[0][var13][u])
2566 {
2567 plp[iClient][1][u] = SQL_FetchInt(hquery, o, 0);
2568 o++;
2569 }
2570 u++;
2571 }
2572 }
2573 else
2574 {
2575 FormatEx(query, 2048, "INSERT INTO weapon_skin_stat (steamid, knife, deagle, elite, fiveseven, glock, ak47, aug, awp, famas, g3sg1, galilar, m249, m4a1, mac10, p90, ump45, xm1014, bizon, mag7, negev, sawedoff, tec9, hkp2000, mp7, mp9, nova, p250, scar20, sg556, ssg08, c4, m4a1_silencer, usp_silencer, cz75a, revolver) VALUES ('%s', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);", steamid[iClient]);
2576 SQL_TQuery(bd_ws, SQL_Check, query, any:0, DBPriority:1);
2577 new u;
2578 while (u < 65)
2579 {
2580 new var14 = weapon;
2581 if (var14[0][var14][u])
2582 {
2583 plp[iClient][1][u] = 0;
2584 }
2585 u++;
2586 }
2587 }
2588 if (hquery)
2589 {
2590 CloseHandle(hquery);
2591 hquery = MissingTAG:0;
2592 }
2593 FormatEx(query, 2048, "SELECT knife, deagle, elite, fiveseven, glock, ak47, aug, awp, famas, g3sg1, galilar, m249, m4a1, mac10, p90, ump45, xm1014, bizon, mag7, negev, sawedoff, tec9, hkp2000, mp7, mp9, nova, p250, scar20, sg556, ssg08, c4, m4a1_silencer, usp_silencer, cz75a, revolver FROM weapon_skin_nm WHERE steamid='%s';", steamid[iClient]);
2594 hquery = SQL_Query(bd_ws, query, -1);
2595 new var6;
2596 if (hquery && SQL_FetchRow(hquery))
2597 {
2598 o = 0;
2599 new u;
2600 while (u < 65)
2601 {
2602 new var15 = weapon;
2603 if (var15[0][var15][u])
2604 {
2605 SQL_FetchString(hquery, o, nm[iClient][u], 64, 0);
2606 o++;
2607 }
2608 u++;
2609 }
2610 }
2611 else
2612 {
2613 FormatEx(query, 2048, "INSERT INTO weapon_skin_nm (steamid, knife, deagle, elite, fiveseven, glock, ak47, aug, awp, famas, g3sg1, galilar, m249, m4a1, mac10, p90, ump45, xm1014, bizon, mag7, negev, sawedoff, tec9, hkp2000, mp7, mp9, nova, p250, scar20, sg556, ssg08, c4, m4a1_silencer, usp_silencer, cz75a, revolver) VALUES ('%s', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '');", steamid[iClient]);
2614 SQL_TQuery(bd_ws, SQL_Check, query, any:0, DBPriority:1);
2615 }
2616 if (hquery)
2617 {
2618 CloseHandle(hquery);
2619 hquery = MissingTAG:0;
2620 }
2621 ispl[iClient] = 1;
2622 }
2623 return void:0;
2624}
2625
2626void:Database_connect()
2627{
2628 if (ok)
2629 {
2630 if (ok)
2631 {
2632 }
2633 }
2634 if (av)
2635 {
2636 if (bd_ws)
2637 {
2638 CloseHandle(bd_ws);
2639 bd_ws = MissingTAG:0;
2640 }
2641 new String:szError[256];
2642 bd_ws = SQLite_UseDatabase("weapon_skin", szError, 255);
2643 if (!bd_ws)
2644 {
2645 SetFailState("[Weapon skin] Ошибка Ð¿Ð¾Ð´ÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ñ Ðº базе данных (%s)", szError);
2646 }
2647 SQL_LockDatabase(bd_ws);
2648 SQL_FastQuery(bd_ws, "CREATE TABLE IF NOT EXISTS weapon_skin (steamid VARCHAR(32) PRIMARY KEY, knife int(12), deagle int(12), elite int(12), fiveseven int(12), glock int(12), ak47 int(12), aug int(12), awp int(12), famas int(12), g3sg1 int(12), galilar int(12), m249 int(12), m4a1 int(12), mac10 int(12), p90 int(12), ump45 int(12), xm1014 int(12), bizon int(12), mag7 int(12), negev int(12), sawedoff int(12), tec9 int(12), hkp2000 int(12), mp7 int(12), mp9 int(12), nova int(12), p250 int(12), scar20 int(12), sg556 int(12), ssg08 int(12), c4 int(12), m4a1_silencer int(12), usp_silencer int(12), cz75a int(12), revolver int(12));", -1);
2649 SQL_FastQuery(bd_ws, "CREATE TABLE IF NOT EXISTS weapon_skin_sm (steamid VARCHAR(32) PRIMARY KEY, knife int(12), deagle int(12), elite int(12), fiveseven int(12), glock int(12), ak47 int(12), aug int(12), awp int(12), famas int(12), g3sg1 int(12), galilar int(12), m249 int(12), m4a1 int(12), mac10 int(12), p90 int(12), ump45 int(12), xm1014 int(12), bizon int(12), mag7 int(12), negev int(12), sawedoff int(12), tec9 int(12), hkp2000 int(12), mp7 int(12), mp9 int(12), nova int(12), p250 int(12), scar20 int(12), sg556 int(12), ssg08 int(12), c4 int(12), m4a1_silencer int(12), usp_silencer int(12), cz75a int(12), revolver int(12));", -1);
2650 SQL_FastQuery(bd_ws, "CREATE TABLE IF NOT EXISTS weapon_skin_st (steamid VARCHAR(32) PRIMARY KEY, knife int(12), deagle int(12), elite int(12), fiveseven int(12), glock int(12), ak47 int(12), aug int(12), awp int(12), famas int(12), g3sg1 int(12), galilar int(12), m249 int(12), m4a1 int(12), mac10 int(12), p90 int(12), ump45 int(12), xm1014 int(12), bizon int(12), mag7 int(12), negev int(12), sawedoff int(12), tec9 int(12), hkp2000 int(12), mp7 int(12), mp9 int(12), nova int(12), p250 int(12), scar20 int(12), sg556 int(12), ssg08 int(12), c4 int(12), m4a1_silencer int(12), usp_silencer int(12), cz75a int(12), revolver int(12));", -1);
2651 SQL_FastQuery(bd_ws, "CREATE TABLE IF NOT EXISTS weapon_skin_ql (steamid VARCHAR(32) PRIMARY KEY, knife int(12), deagle int(12), elite int(12), fiveseven int(12), glock int(12), ak47 int(12), aug int(12), awp int(12), famas int(12), g3sg1 int(12), galilar int(12), m249 int(12), m4a1 int(12), mac10 int(12), p90 int(12), ump45 int(12), xm1014 int(12), bizon int(12), mag7 int(12), negev int(12), sawedoff int(12), tec9 int(12), hkp2000 int(12), mp7 int(12), mp9 int(12), nova int(12), p250 int(12), scar20 int(12), sg556 int(12), ssg08 int(12), c4 int(12), m4a1_silencer int(12), usp_silencer int(12), cz75a int(12), revolver int(12));", -1);
2652 SQL_FastQuery(bd_ws, "CREATE TABLE IF NOT EXISTS weapon_skin_stat (steamid VARCHAR(32) PRIMARY KEY, knife int(12), deagle int(12), elite int(12), fiveseven int(12), glock int(12), ak47 int(12), aug int(12), awp int(12), famas int(12), g3sg1 int(12), galilar int(12), m249 int(12), m4a1 int(12), mac10 int(12), p90 int(12), ump45 int(12), xm1014 int(12), bizon int(12), mag7 int(12), negev int(12), sawedoff int(12), tec9 int(12), hkp2000 int(12), mp7 int(12), mp9 int(12), nova int(12), p250 int(12), scar20 int(12), sg556 int(12), ssg08 int(12), c4 int(12), m4a1_silencer int(12), usp_silencer int(12), cz75a int(12), revolver int(12));", -1);
2653 SQL_FastQuery(bd_ws, "CREATE TABLE IF NOT EXISTS weapon_skin_nm (steamid VARCHAR(32) PRIMARY KEY, knife VARCHAR(66), deagle VARCHAR(66), elite VARCHAR(66), fiveseven VARCHAR(66), glock VARCHAR(66), ak47 VARCHAR(66), aug VARCHAR(66), awp VARCHAR(66), famas VARCHAR(66), g3sg1 VARCHAR(66), galilar VARCHAR(66), m249 VARCHAR(66), m4a1 VARCHAR(66), mac10 VARCHAR(66), p90 VARCHAR(66), ump45 VARCHAR(66), xm1014 VARCHAR(66), bizon VARCHAR(66), mag7 VARCHAR(66), negev VARCHAR(66), sawedoff VARCHAR(66), tec9 VARCHAR(66), hkp2000 VARCHAR(66), mp7 VARCHAR(66), mp9 VARCHAR(66), nova VARCHAR(66), p250 VARCHAR(66), scar20 VARCHAR(66), sg556 VARCHAR(66), ssg08 VARCHAR(66), c4 VARCHAR(66), m4a1_silencer VARCHAR(66), usp_silencer VARCHAR(66), cz75a VARCHAR(66), revolver VARCHAR(66));", -1);
2654 SQL_UnlockDatabase(bd_ws);
2655 }
2656 return void:0;
2657}
2658
2659void:InitSendPropOffset(&offsetDest, String:serverClass[], String:propName[], bool:failOnError)
2660{
2661 new var1;
2662 if ((offsetDest = FindSendPropInfo(serverClass, propName, 0, 0, 0)) < 1 && failOnError)
2663 {
2664 SetFailState("Failed to find offset: \"%s\"!", propName);
2665 }
2666 return void:0;
2667}
2668
2669public VIP_OnVIPLoaded()
2670{
2671 if (ok)
2672 {
2673 if (ok)
2674 {
2675 }
2676 }
2677 VIP_RegisterFeature("WS", VIP_ValueType:4, VIP_FeatureType:2, ItemSelectCallback:-1, ItemDisplayCallback:-1, ItemDrawCallback:-1);
2678 return 0;
2679}
2680
2681RandomSkin(iClient, w_id)
2682{
2683 if (ok)
2684 {
2685 if (ok)
2686 {
2687 }
2688 }
2689 static skn_k;
2690 static skn[650];
2691 skn_k = 0;
2692 new i;
2693 while (i <= wsim)
2694 {
2695 new var1;
2696 if (!wsi[i][1] || Dostyp_s(wsi[i][1], var3[0][var3][w_id]))
2697 {
2698 new var2;
2699 if (!wsi[i][513] || StrContains(wsi[i][513], grups[plp[iClient][0]][513], true) == -1)
2700 {
2701 skn[skn_k] = wsi[i][0];
2702 skn_k += 1;
2703 }
2704 }
2705 i++;
2706 }
2707 if (skn_k)
2708 {
2709 return skn[GetRandomInt(0, skn_k + -1)];
2710 }
2711 return -1;
2712}
2713
2714bool:Dostyp_s(String:weap1[], String:weap2[])
2715{
2716 if (ok)
2717 {
2718 if (ok)
2719 {
2720 }
2721 }
2722 static String:weap_buf[64];
2723 FormatEx(weap_buf, 64, "%s;", weap2);
2724 return StrContains(weap1, weap_buf, true) != -1;
2725}
2726
2727ArrayList:RegexExGlobalBlat(String:pattern[], String:str[])
2728{
2729 if (ok)
2730 {
2731 if (ok)
2732 {
2733 }
2734 }
2735 new String:buf[24];
2736 new ArrayList:AL_list = ArrayList.ArrayList(ByteCountToCells(23), 0);
2737 new iMatches;
2738 new pos;
2739 new size = strlen(str);
2740 new Regex:hRegex = CompileRegex(pattern, 0, "", 0, 0);
2741 do {
2742 iMatches = Regex.Match(hRegex, str[pos], 0);
2743 if (0 < iMatches)
2744 {
2745 Regex.GetSubString(hRegex, 0, buf, 23);
2746 ArrayList.PushString(AL_list, buf);
2747 pos = strlen(buf) + StrContains(str[pos], buf, true) + pos + 1;
2748 }
2749 new var1;
2750 if (!(iMatches > 0 && size > pos))
2751 {
2752 CloseHandle(hRegex);
2753 hRegex = MissingTAG:0;
2754 return AL_list;
2755 }
2756 } while (var1);
2757 CloseHandle(hRegex);
2758 hRegex = MissingTAG:0;
2759 return AL_list;
2760}