CSGO Classy Covert [Versiunea: 5.0]

Anunturi legate de vanzari/cumparari.
*Nu suntem responsabili de tranzactiile efectuate intre membri. Utilizatorii sunt sfatuiti sa-si ia maximul de precautii inainte de finalizarea unei tranzactii pentru a preveni posibilitatea unei inselaciuni.

Moderators: Moderatori ajutatori, Moderatori

Post Reply
User avatar
Rainq
Membru, skill +2
Membru, skill +2
Posts: 681
Joined: 21 Jul 2015, 19:50
Detinator Steam: Da
CS Status: Retras
Detinator server CS: zm.extreamcs.com
SteamID: mrainq
Reputatie: Fost super moderator
Fost detinator ZM.eXtreamCS.COM
Fost Membru Club eXtreamCS (trei luni)
Fond eXtream: 0
Location: Bucharest
Discord: manuraiders
Has thanked: 29 times
Been thanked: 51 times
Contact:

04 Mar 2021, 20:49

andrei0465 wrote:
04 Mar 2021, 14:56
Salut, stiu ca poate e cam tarziu si trebuia sa reactionez mai devreme, dar am avut treburi personale :) Vad ca ai editat si nu mai scrie "101% original." (asta cred, nu ti-am urmarit topicul). Cat de impertinent poti sa fii dandu-te autor peste plugin-uri create de oameni care au depus o munca?
Exemplu:
"Block Chat", "renegade" -> "ChatCmdBlocker", "LegacyCode" (Wow, printr-o coincidenta e acelasi cod ca al pluginului tau. Ti se pare cunoscut?)
"VIP CSGO Classy", "renegade" -> "EFFx's VIP", "EFFx"
"CSGO Classy gag", "renegade" -> "GAG-Manager", "ExoTiQ"
Si exemplele pot continua. Ce m-a deranjat pe mine e acest lucru ca ai spus ca este "101% original" codul si mi-ai facut sursa modului "cctul ala de mod al lui kuamquat" dar tu folosesti acel "cct" si nu incerca sa negi ca mi-ai folosit sursa. Nu poti spune ca tot ce am facut eu e 0. Daca ai stii chiar si cand il decompilezi dureaza sa adaugi / modifici, sa il testezi si sa rezolvi bugurile. Si am intalnit si probleme in modul lui nubo original, de exemplu dupa ce foloseai nativele sa dai chei / puncte dupa schimbarea mapei nu se salvau, dar in sursa am rezolvat. Pentru cei ce mai vor modul Classy fiti pe faza, nu mai dati banii aiurea, deja lucrez la el.
din pacate asa sunt cativa oameni,doar lepre ce se dau ce nu sunt..nu pastreaza munca nimanu-i ,se mint singuri pe fata bro..100% post adevarat ,asteptam sa vedem ce scoti
Image
RoyalServer
User avatar
renegade
Membru, skill +1
Membru, skill +1
Posts: 150
Joined: 10 Mar 2018, 12:54
Detinator Steam: Da
CS Status: Disconnected
SteamID: /id/renegadeidg
Fond eXtream: 0
Has thanked: 11 times
Been thanked: 4 times

05 Mar 2021, 11:43

Din pacate, iar vorbeste gura fara voi.
Cand tu postasei Nubo decompilat, eu aveam primul client de vreo 4 luni, e o diferenta cand doar dai din gura si faci pe smecheru' sa vada lumea cine esti tu.
https://www.youtube.com/watch?v=PYufttE ... eliaGrozav
User avatar
renegade
Membru, skill +1
Membru, skill +1
Posts: 150
Joined: 10 Mar 2018, 12:54
Detinator Steam: Da
CS Status: Disconnected
SteamID: /id/renegadeidg
Fond eXtream: 0
Has thanked: 11 times
Been thanked: 4 times

05 Mar 2021, 11:47

Rainq wrote:
04 Mar 2021, 20:49
andrei0465 wrote:
04 Mar 2021, 14:56
Salut, stiu ca poate e cam tarziu si trebuia sa reactionez mai devreme, dar am avut treburi personale :) Vad ca ai editat si nu mai scrie "101% original." (asta cred, nu ti-am urmarit topicul). Cat de impertinent poti sa fii dandu-te autor peste plugin-uri create de oameni care au depus o munca?
Exemplu:
"Block Chat", "renegade" -> "ChatCmdBlocker", "LegacyCode" (Wow, printr-o coincidenta e acelasi cod ca al pluginului tau. Ti se pare cunoscut?)
"VIP CSGO Classy", "renegade" -> "EFFx's VIP", "EFFx"
"CSGO Classy gag", "renegade" -> "GAG-Manager", "ExoTiQ"
Si exemplele pot continua. Ce m-a deranjat pe mine e acest lucru ca ai spus ca este "101% original" codul si mi-ai facut sursa modului "cctul ala de mod al lui kuamquat" dar tu folosesti acel "cct" si nu incerca sa negi ca mi-ai folosit sursa. Nu poti spune ca tot ce am facut eu e 0. Daca ai stii chiar si cand il decompilezi dureaza sa adaugi / modifici, sa il testezi si sa rezolvi bugurile. Si am intalnit si probleme in modul lui nubo original, de exemplu dupa ce foloseai nativele sa dai chei / puncte dupa schimbarea mapei nu se salvau, dar in sursa am rezolvat. Pentru cei ce mai vor modul Classy fiti pe faza, nu mai dati banii aiurea, deja lucrez la el.
din pacate asa sunt cativa oameni,doar lepre ce se dau ce nu sunt..nu pastreaza munca nimanu-i ,se mint singuri pe fata bro..100% post adevarat ,asteptam sa vedem ce scoti
Din pacate, mie imi pare ca vorbesti despre tine, marele RainQ, scripter pe extreamcs ce vinde addonsuri pe 5 euro. Te pup de sus.
Shadows Adi
Membru, skill +1
Membru, skill +1
Posts: 349
Joined: 26 Jan 2020, 18:52
Detinator Steam: Da
CS Status: 0x416469
SteamID: shadowsadi120
Fond eXtream: 0
Has thanked: 14 times
Been thanked: 50 times

05 Mar 2021, 12:51

renegade wrote:
05 Mar 2021, 11:43
Din pacate, iar vorbeste gura fara voi.
Cand tu postasei Nubo decompilat, eu aveam primul client de vreo 4 luni
Ai avut primul client la modul postat pe extreamcs, abia dupa ce a postat kuamquat modul ai venit cu modul asta.
Dovedeste spusele tale. Toate persoanele de aici au venit doar cu dovezi, iar tu doar ai vorbit.
renegade wrote:
05 Mar 2021, 11:43
...e o diferenta cand doar dai din gura si faci pe smecheru' sa vada lumea cine esti tu.
Omule, fix asta faci tu in momentul de fata =))

Iti raspund doar pentru faptul ca nu ai pic de respect fata de baiatul caruia i-ai folosit codul ( si ceilalti autori ale plugin-urilor peste care te-ai dat =)) )
User avatar
Syko
Membru, skill +1
Membru, skill +1
Posts: 131
Joined: 14 Apr 2019, 21:45
Detinator Steam: Da
CS Status: Good
SteamID: sykozawr
Fond eXtream: 0
Location: Bucuresti
Discord: sykozawr
Has thanked: 10 times
Been thanked: 5 times
Contact:

05 Mar 2021, 12:59

Vreau si eu sa-mi spun parerea despre acest mod, fara hate ori suparare din partea cuiva.

In primul rand modul prezinta erori multiple:
| Afiseaza codul
L 03/05/2021 - 00:04:00: [AMXX] Displaying debug trace (plugin "csgoclassy.amxx", version "1.0")
L 03/05/2021 - 00:04:00: [AMXX] Run time error 10: native error (native "ArrayGetCell")
L 03/05/2021 - 00:04:00: [AMXX]    [0] csgoclassy.sma::ev_DeathMsg (line 7474)

L 03/05/2021 - 00:04:16: Info (map "de_inferno") (file "addons/amxmodx/logs/error_20210305.log")
L 03/05/2021 - 00:04:16: [AMXX] Displaying debug trace (plugin "csgoclassyquests.amxx", version "1.0")
L 03/05/2021 - 00:04:16: [AMXX] Run time error 4: index out of bounds 
L 03/05/2021 - 00:04:16: [AMXX]    [0] csgoclassyquests.sma::client_disconnected (line 574)
L 03/05/2021 - 00:04:55: Invalid index 18 (count: 18)
Bineinteles, acesta aflandu-se in numar foarte mare, spamand folderul logs numai cu .txt-uri error_log. Lasand la o parte erorile, din ce am vazut modul nu e afectat.

In al doilea rand acest mod este un edit (daca putem spune ca pe samp) la modul ala zorken de circula acum ceva timp pe internet, unul postat de un baiat Capy.
De unde stiu? Simplu, am decompilat toate amxx urile lui cu lysis si mi-am dat seama imediat din cod (am si eu sma-ul la ala a lu' zorken, pentru ca am facut si eu un edit pe el).

In al treilea rand renegade a luat toate pluginele de la amxx dev team si s-a pus autor pe ele sustinand cu tarie ca el a a facut versiunea "enhaced" a acestora, desi cand le-am decompilat surpriza, sunt aceleasi ca la amxx dev team si nu au nici o urma de modificare. (p.s: chiar daca era versiunea enhaced n-aveai drept sa stergi autorul original).

In ultimul rand (mai aveam de spus argumente dar le-am mai uitat, oricum exista butonul edit sau new reply in caz de ceva) comportamentul lui si aroganta cu care vorbeste atunci cand il intrebi o chestie lasa de dorit, degeaba il laudati, ca el n-a facut nimic special la modul ala, a editat ceva de pe net si a reusit sa-l transforme prin chestii noi imbibate (spun asta ca majoritatea se gasesc pe net, quests si ce draci mai are el) si prin estetica.

E PAREREA MEA SINCERA DESPRE ACEST MOD, nu doresc sa supar pe nimeni, doar imi expun opinia.
User avatar
andrei0465
Membru, skill 0
Membru, skill 0
Posts: 65
Joined: 01 Nov 2016, 17:04
Detinator Steam: Da
CS Status: Busy
SteamID: andrei0465
Reputatie: Membru Club eXtreamCS (21.03 - 21.04)
Fond eXtream: 0
Has thanked: 3 times
Been thanked: 4 times

05 Mar 2021, 13:19

Syko wrote:
05 Mar 2021, 12:59
Vreau si eu sa-mi spun parerea despre acest mod, fara hate ori suparare din partea cuiva.

In primul rand modul prezinta erori multiple:
| Afiseaza codul
L 03/05/2021 - 00:04:00: [AMXX] Displaying debug trace (plugin "csgoclassy.amxx", version "1.0")
L 03/05/2021 - 00:04:00: [AMXX] Run time error 10: native error (native "ArrayGetCell")
L 03/05/2021 - 00:04:00: [AMXX]    [0] csgoclassy.sma::ev_DeathMsg (line 7474)

L 03/05/2021 - 00:04:16: Info (map "de_inferno") (file "addons/amxmodx/logs/error_20210305.log")
L 03/05/2021 - 00:04:16: [AMXX] Displaying debug trace (plugin "csgoclassyquests.amxx", version "1.0")
L 03/05/2021 - 00:04:16: [AMXX] Run time error 4: index out of bounds 
L 03/05/2021 - 00:04:16: [AMXX]    [0] csgoclassyquests.sma::client_disconnected (line 574)
L 03/05/2021 - 00:04:55: Invalid index 18 (count: 18)
Bineinteles, acesta aflandu-se in numar foarte mare, spamand folderul logs numai cu .txt-uri error_log. Lasand la o parte erorile, din ce am vazut modul nu e afectat.

In al doilea rand acest mod este un edit (daca putem spune ca pe samp) la modul ala zorken de circula acum ceva timp pe internet, unul postat de un baiat Capy.
De unde stiu? Simplu, am decompilat toate amxx urile lui cu lysis si mi-am dat seama imediat din cod (am si eu sma-ul la ala a lu' zorken, pentru ca am facut si eu un edit pe el).

In al treilea rand renegade a luat toate pluginele de la amxx dev team si s-a pus autor pe ele sustinand cu tarie ca el a a facut versiunea "enhaced" a acestora, desi cand le-am decompilat surpriza, sunt aceleasi ca la amxx dev team si nu au nici o urma de modificare. (p.s: chiar daca era versiunea enhaced n-aveai drept sa stergi autorul original).

In ultimul rand (mai aveam de spus argumente dar le-am mai uitat, oricum exista butonul edit sau new reply in caz de ceva) comportamentul lui si aroganta cu care vorbeste atunci cand il intrebi o chestie lasa de dorit, degeaba il laudati, ca el n-a facut nimic special la modul ala, a editat ceva de pe net si a reusit sa-l transforme prin chestii noi imbibate (spun asta ca majoritatea se gasesc pe net, quests si ce draci mai are el) si prin estetica.

E PAREREA MEA SINCERA DESPRE ACEST MOD, nu doresc sa supar pe nimeni, doar imi expun opinia.
Salut, tin sa te contrazic la partea cu modul lui zorken. Este edit la sursa mea de la modul lui Nubo. Dupa decompilarea modului uita-te si compara de exemplu: plugin_end, client_putinserver, etc. .. cu partile din modul lui zorken si o sa vezi ca nu exista nicio asemanare nici acolo si nici in restul modului. Daca gresesc te rog sa-mi spui. Legat de erori le-am observat si eu, chiar un "client" de-al lui le are si din pacate pentru el este afectat modul (mie chiar imi da si crash CS-ul cand intru pe serverul lui).
User avatar
Syko
Membru, skill +1
Membru, skill +1
Posts: 131
Joined: 14 Apr 2019, 21:45
Detinator Steam: Da
CS Status: Good
SteamID: sykozawr
Fond eXtream: 0
Location: Bucuresti
Discord: sykozawr
Has thanked: 10 times
Been thanked: 5 times
Contact:

05 Mar 2021, 13:22

andrei0465 wrote:
05 Mar 2021, 13:19
Salut, tin sa te contrazic la partea cu modul lui zorken. Este edit la sursa mea de la modul lui Nubo. Dupa decompilarea modului uita-te si compara de exemplu: plugin_end, client_putinserver, etc. .. cu partile din modul lui zorken si o sa vezi ca nu exista nicio asemanare nici acolo si nici in restul modului. Daca gresesc te rog sa-mi spui. Legat de erori le-am observat si eu, chiar un "client" de-al lui le are si din pacate pentru el este afectat modul (mie chiar imi da si crash CS-ul cand intru pe serverul lui).
Salut, am uitat sa mentionez, NU sunt sigur de asta, insa la prima vedere asta am observat, se poate sa fie cum spui tu (poate cel mai probabil asa e).
In oricare dintre cazuri, modul nu este "unic" cu nimic.

Edit: Am uitat sa preciez un bug pe care l-am intalnit pe server; la vip cand ai selectat "Regeneration HP" si de exemplu in .cfg ai maxim regeneration 50, in caz ca incepe o noua runda iti seteaza serverul 50 HP.
Poate fi rezolvat "extern" acest bug la spawn sa dea 100 HP tuturor, insa am vrut sa mentionez un bug, poate o sa-l rezolve.
User avatar
renegade
Membru, skill +1
Membru, skill +1
Posts: 150
Joined: 10 Mar 2018, 12:54
Detinator Steam: Da
CS Status: Disconnected
SteamID: /id/renegadeidg
Fond eXtream: 0
Has thanked: 11 times
Been thanked: 4 times

05 Mar 2021, 13:59

Vorbiti numai tampenii, erorile alea doua ce sunt sunt doar niste index out of bounds, Syko, e fost client de-al meu, nu stiu sigur care era, dar oricum, vorbeste mult, prost si fara rost. Lysis nu functioneaza pe mod, apreciez totusi vorbele, iar tu, Adi, stii bine care a fost primul client, ca de acolo te-ai inspirat si tu, zana mica. Nu mai comentez ca uzez tastatura pe niste oameni care nu merita, salut. Apropo, kuamquat, nu mai lua CS de la rusi si dupa mananci cct ca primesti crash cand intrii pe server =)))
Apropo, cand reusiti sa realizati si voi ceva, ma anuntati si pe mine sa va trimit o felicitare. Pana atunci ciocu' mic si observati in continuare.

EDIT: continuati ca e foarte entertaining
Pana atunci va las o piesa sa plangeti pe ea in continuare: https://www.youtube.com/watch?v=5MkK-gY ... aliVijelie

EDIT 2: Syko, bugul ala de zici tu la VIP nu e bug, ala e facut daca tu vrei sa adaugi mai mult de 100hp la vip, iar daca adaugi, abilitatea hpregeneration sa-ti ofere suport pentru el.

EDIT 3: Syko, chiar nu imi aduc aminte cine esti, dar mai mult ca sigur esti vreun frustrat care a pierdut suportul de la mine pentru fitele care le face, corect?
Shadows Adi
Membru, skill +1
Membru, skill +1
Posts: 349
Joined: 26 Jan 2020, 18:52
Detinator Steam: Da
CS Status: 0x416469
SteamID: shadowsadi120
Fond eXtream: 0
Has thanked: 14 times
Been thanked: 50 times

05 Mar 2021, 14:51

renegade wrote:
05 Mar 2021, 13:59
Vorbiti numai tampenii, erorile alea doua ce sunt sunt doar niste index out of bounds
Rezolva-le in cazul acesta
renegade wrote:
05 Mar 2021, 13:59
Lysis nu functioneaza pe mod
Poftim: https://pastebin.com/wfJNzkrB ( deja m-am plictisit de chestia asta )

Code: Select all

#pragma ctrlchar '\'

new g_iKills[33];
new g_iHS[33];
new Float:g_fDmg[33];
new weapon_weapon[2][0] =
{
	{
		119, ...
	},
	{
		119, ...
	}
};
new g_Zoom[33];
new Float:g_ZoomTime[33];
new weapons_list[31][9][0] =
{
	{
		{
			0, ...
		},
		{
			0, ...
		},
		{
			0, ...
		},
		{
			0, ...
		},
		{
			0, ...
		},
		{
			0, ...
		},
		{
			0, ...
		},
		{
			0, ...
		},
		{
			0, ...
		}
	},
	{
		{
			119, ...
		},
		{
			9, ...
		},
		{
			52, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			1, ...
		},
		{
			3, ...
		},
		{
			1, ...
		},
		{
			0, ...
		}
	},
	{
		{
			0, ...
		},
		{
			0, ...
		},
		{
			0, ...
		},
		{
			0, ...
		},
		{
			0, ...
		},
		{
			0, ...
		},
		{
			0, ...
		},
		{
			0, ...
		},
		{
			0, ...
		}
	},
	{
		{
			119, ...
		},
		{
			2, ...
		},
		{
			90, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			0, ...
		},
		{
			9, ...
		},
		{
			3, ...
		},
		{
			0, ...
		}
	},
	{
		{
			119, ...
		},
		{
			12, ...
		},
		{
			1, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			3, ...
		},
		{
			1, ...
		},
		{
			4, ...
		},
		{
			24, ...
		}
	},
	{
		{
			119, ...
		},
		{
			5, ...
		},
		{
			32, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			0, ...
		},
		{
			12, ...
		},
		{
			5, ...
		},
		{
			0, ...
		}
	},
	{
		{
			119, ...
		},
		{
			14, ...
		},
		{
			1, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			4, ...
		},
		{
			3, ...
		},
		{
			6, ...
		},
		{
			24, ...
		}
	},
	{
		{
			119, ...
		},
		{
			6, ...
		},
		{
			100, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			0, ...
		},
		{
			13, ...
		},
		{
			7, ...
		},
		{
			0, ...
		}
	},
	{
		{
			119, ...
		},
		{
			4, ...
		},
		{
			90, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			0, ...
		},
		{
			14, ...
		},
		{
			8, ...
		},
		{
			0, ...
		}
	},
	{
		{
			119, ...
		},
		{
			13, ...
		},
		{
			1, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			3, ...
		},
		{
			3, ...
		},
		{
			9, ...
		},
		{
			24, ...
		}
	},
	{
		{
			119, ...
		},
		{
			10, ...
		},
		{
			120, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			1, ...
		},
		{
			5, ...
		},
		{
			10, ...
		},
		{
			0, ...
		}
	},
	{
		{
			119, ...
		},
		{
			7, ...
		},
		{
			100, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			1, ...
		},
		{
			6, ...
		},
		{
			11, ...
		},
		{
			0, ...
		}
	},
	{
		{
			119, ...
		},
		{
			6, ...
		},
		{
			100, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			0, ...
		},
		{
			15, ...
		},
		{
			12, ...
		},
		{
			0, ...
		}
	},
	{
		{
			119, ...
		},
		{
			4, ...
		},
		{
			90, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			0, ...
		},
		{
			16, ...
		},
		{
			13, ...
		},
		{
			0, ...
		}
	},
	{
		{
			119, ...
		},
		{
			4, ...
		},
		{
			90, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			0, ...
		},
		{
			17, ...
		},
		{
			14, ...
		},
		{
			0, ...
		}
	},
	{
		{
			119, ...
		},
		{
			4, ...
		},
		{
			90, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			0, ...
		},
		{
			18, ...
		},
		{
			15, ...
		},
		{
			0, ...
		}
	},
	{
		{
			119, ...
		},
		{
			6, ...
		},
		{
			100, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			1, ...
		},
		{
			4, ...
		},
		{
			16, ...
		},
		{
			0, ...
		}
	},
	{
		{
			119, ...
		},
		{
			10, ...
		},
		{
			120, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			1, ...
		},
		{
			2, ...
		},
		{
			17, ...
		},
		{
			0, ...
		}
	},
	{
		{
			119, ...
		},
		{
			1, ...
		},
		{
			30, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			0, ...
		},
		{
			2, ...
		},
		{
			18, ...
		},
		{
			0, ...
		}
	},
	{
		{
			119, ...
		},
		{
			10, ...
		},
		{
			120, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			0, ...
		},
		{
			7, ...
		},
		{
			19, ...
		},
		{
			0, ...
		}
	},
	{
		{
			119, ...
		},
		{
			3, ...
		},
		{
			200, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			0, ...
		},
		{
			4, ...
		},
		{
			20, ...
		},
		{
			0, ...
		}
	},
	{
		{
			119, ...
		},
		{
			5, ...
		},
		{
			32, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			0, ...
		},
		{
			5, ...
		},
		{
			21, ...
		},
		{
			0, ...
		}
	},
	{
		{
			119, ...
		},
		{
			4, ...
		},
		{
			90, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			0, ...
		},
		{
			6, ...
		},
		{
			22, ...
		},
		{
			0, ...
		}
	},
	{
		{
			119, ...
		},
		{
			10, ...
		},
		{
			120, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			0, ...
		},
		{
			11, ...
		},
		{
			23, ...
		},
		{
			0, ...
		}
	},
	{
		{
			119, ...
		},
		{
			2, ...
		},
		{
			90, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			0, ...
		},
		{
			3, ...
		},
		{
			24, ...
		},
		{
			0, ...
		}
	},
	{
		{
			119, ...
		},
		{
			11, ...
		},
		{
			2, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			3, ...
		},
		{
			2, ...
		},
		{
			25, ...
		},
		{
			24, ...
		}
	},
	{
		{
			119, ...
		},
		{
			8, ...
		},
		{
			35, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			1, ...
		},
		{
			1, ...
		},
		{
			26, ...
		},
		{
			0, ...
		}
	},
	{
		{
			119, ...
		},
		{
			4, ...
		},
		{
			90, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			0, ...
		},
		{
			10, ...
		},
		{
			27, ...
		},
		{
			0, ...
		}
	},
	{
		{
			119, ...
		},
		{
			2, ...
		},
		{
			90, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			0, ...
		},
		{
			1, ...
		},
		{
			28, ...
		},
		{
			0, ...
		}
	},
	{
		{
			119, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			2, ...
		},
		{
			1, ...
		},
		{
			29, ...
		},
		{
			0, ...
		}
	},
	{
		{
			119, ...
		},
		{
			7, ...
		},
		{
			100, ...
		},
		{
			-1, ...
		},
		{
			-1, ...
		},
		{
			0, ...
		},
		{
			8, ...
		},
		{
			30, ...
		},
		{
			0, ...
		}
	}
};
new menus_control[33][4];
new zoom_control[33];
new crosshair_list[16][3][0] =
{
	{
		{
			67, ...
		},
		{
			115, ...
		},
		{
			99, ...
		}
	},
	{
		{
			67, ...
		},
		{
			115, ...
		},
		{
			99, ...
		}
	},
	{
		{
			67, ...
		},
		{
			115, ...
		},
		{
			99, ...
		}
	},
	{
		{
			67, ...
		},
		{
			115, ...
		},
		{
			99, ...
		}
	},
	{
		{
			67, ...
		},
		{
			115, ...
		},
		{
			99, ...
		}
	},
	{
		{
			67, ...
		},
		{
			115, ...
		},
		{
			99, ...
		}
	},
	{
		{
			67, ...
		},
		{
			115, ...
		},
		{
			99, ...
		}
	},
	{
		{
			67, ...
		},
		{
			115, ...
		},
		{
			99, ...
		}
	},
	{
		{
			67, ...
		},
		{
			115, ...
		},
		{
			99, ...
		}
	},
	{
		{
			67, ...
		},
		{
			115, ...
		},
		{
			99, ...
		}
	},
	{
		{
			67, ...
		},
		{
			115, ...
		},
		{
			99, ...
		}
	},
	{
		{
			67, ...
		},
		{
			115, ...
		},
		{
			99, ...
		}
	},
	{
		{
			0, ...
		},
		{
			115, ...
		},
		{
			0, ...
		}
	},
	{
		{
			0, ...
		},
		{
			115, ...
		},
		{
			0, ...
		}
	},
	{
		{
			0, ...
		},
		{
			115, ...
		},
		{
			0, ...
		}
	},
	{
		{
			0, ...
		},
		{
			115, ...
		},
		{
			0, ...
		}
	}
};
new String:awp_zoom[84] = "csgoclassy/awp_scope";
new String:augscopes[88] = "csgoclassy/aug_sprite";
new g_bSomeBool;
new g_Messages_Name[4][0] =
{
	{
		87, ...
	},
	{
		67, ...
	},
	{
		70, ...
	},
	{
		83, ...
	}
};
new g_Messages[4];
new g_msgHideWeapon;
new crosshairvault;
new crosshaircontrols;
new m_pActiveItem = 373;
new bool:g_bUsingM4A4[33];
new c_ShowDropCraft;
new g_iShowDropCraft;
new g_iCurrentRound;
new g_bGiveAwayStarted;
new bool:g_bJoinedGiveAway[33];
new g_szSkinName[32];
new g_iSkinID;
new g_iSkinsInContract[33];
new g_iWeaponUsedInContract[33][11];
new g_iUserChance[33];
new g_bUsedSttC[33][450];
new String:g_szTWin[80] = "csgoclassy/twin.wav";
new String:g_szCTWin[84] = "csgoclassy/ctwin.wav";
new String:xp_num[164] = "^�x�4��N�\nh�$��>��X�r�.��H�\x04b�|�8���";
new g_szAuthId[33][36];
new g_szDay[3];
new g_iVault;
new g_iDay;
new ranks_names[40][0] =
{
	{
		80, ...
	},
	{
		80, ...
	},
	{
		80, ...
	},
	{
		80, ...
	},
	{
		67, ...
	},
	{
		67, ...
	},
	{
		67, ...
	},
	{
		67, ...
	},
	{
		83, ...
	},
	{
		83, ...
	},
	{
		83, ...
	},
	{
		83, ...
	},
	{
		77, ...
	},
	{
		77, ...
	},
	{
		77, ...
	},
	{
		77, ...
	},
	{
		83, ...
	},
	{
		83, ...
	},
	{
		83, ...
	},
	{
		83, ...
	},
	{
		76, ...
	},
	{
		76, ...
	},
	{
		76, ...
	},
	{
		76, ...
	},
	{
		67, ...
	},
	{
		67, ...
	},
	{
		67, ...
	},
	{
		67, ...
	},
	{
		77, ...
	},
	{
		77, ...
	},
	{
		77, ...
	},
	{
		77, ...
	},
	{
		67, ...
	},
	{
		67, ...
	},
	{
		67, ...
	},
	{
		66, ...
	},
	{
		77, ...
	},
	{
		76, ...
	},
	{
		71, ...
	},
	{
		71, ...
	}
};
new g_status_sync;
new rankLevelBonus;
new rankSaveType;
new String:db_save[64] = "csgoclassyrangs";
new level[33];
new xp[33];
new rank[33];
new g_nextMap[32];
new g_mapCycle[32];
new g_pos;
new TimeStamp;
new g_Vault;
new bool:g_bLogged[33];
new g_MsgSync;
new g_WarmUpSync;
new g_szCfgDir[48];
new g_szConfigFile[48];
new Array:g_aRankName;
new Array:g_aRankKills;
new g_szDefaultSkinModel[31][48];
new Array:g_aSkinBody;
new Array:g_aSkinWeaponID;
new Array:g_aSkinName;
new Array:g_aSkinModel;
new Array:g_aSkinType;
new Array:g_aSkinChance;
new Array:g_aSkinCostMin;
new Array:g_aDropSkin;
new Array:g_aCraftSkin;
new Array:g_aTombola;
new Array:g_aJackpotSkins;
new Array:g_aJackPotSttSkins;
new Array:g_aJackpotUsers;
new g_iRanksNum;
new g_iSkinsNum;
new bool:g_bShallUseStt[33][50];
new g_iAskType[33];
new bool:g_bPublishedStattrackSkin[33];
new bool:g_bGiftingStt[33];
new bool:g_bDestroyStt[33];
new bool:g_bTradingStt[33];
new bool:g_bJackpotStt[33];
new bool:g_bIsWeaponStattrack[33][450];
new g_iUserStattrackKillCount[33][450];
new g_nVaultStattrack;
new g_nVaultStattrackKills;
new g_iUserSelectedSkin[33][50];
new g_iUserSkins[33][450];
new g_iUserMoney[33];
new g_iUserScraps[33];
new g_iUserKeys[33];
new g_iUserCases[33];
new g_iUserKills[33];
new g_iUserRank[33];
new g_iDropSkinNum;
new g_iCraftSkinNum;
new g_szName[33][32];
new g_szUserPassword[33][32];
new g_szUserSavedPass[33][32];
new g_iUserPassFail[33];
new c_RegOpen;
new fw_CUIC;
new HamHook:fw_PA[3];
new HamHook:fw_SA[3];
new HamHook:fw_ID[31];
new HamHook:fw_ICD[31];
new HamHook:fw_S1;
new HamHook:fw_S2;
new HamHook:fw_K1;
new HamHook:fw_K2;
new c_DropType;
new g_iDropType = 1;
new c_KeyPrice;
new g_iKeyPrice = 80;
new c_DropChance;
new g_iDropChance = 95;
new c_CraftCost;
new g_iCraftCost = 25;
new c_Suicide;
new g_iUserSellItem[33];
new g_iUserItemPrice[33];
new g_bUserSell[33];
new g_iLastPlace[33];
new g_iMenuType[33];
new c_DustForTransform;
new g_iDustForTransform = 1;
new c_ReturnPercent;
new g_iReturnPercent;
new g_iGiftTarget[33];
new g_iGiftItem[33];
new g_bTradeAccept[33];
new g_iTradeTarget[33];
new g_iTradeItem[33];
new g_bTradeActive[33];
new g_bTradeSecond[33];
new g_iTradeRequest[33];
new g_bCFAccept[33];
new g_iCFTarget[33];
new g_iCFItem[33];
new g_bCFActive[33];
new g_bCFSecond[33];
new g_iCFRequest[33];
new bool:g_bOneAccepted;
new bool:g_bBettingCFStt[33];
new g_iRouletteCost;
new g_bRoulettePlay[33];
new g_iTombolaPlayers;
new g_iTombolaPrize;
new g_bUserPlay[33];
new g_iNextTombolaStart;
new c_TombolaCost;
new g_iTombolaCost = 500;
new c_TombolaTimer;
new g_iTombolaTimer = 180;
new g_bTombolaWork = 1;
new c_RouletteMin;
new g_iRouletteMin = 2;
new c_RouletteMax;
new g_iRouletteMax = 10;
new g_iUserBetMoney[33];
new bool:g_bJackpotWork;
new g_iUserJackpotItem[33];
new g_bUserPlayJackpot[33];
new g_iJackpotClose;
new c_JackpotTimer;
new g_iMaxPlayers;
new c_ShowHUD;
new g_iRoundNum;
new bool:g_bWarmUp;
new c_WarmUpDuration;
new g_iStartMoney;
new p_StartMoney;
new c_Competitive;
new g_iCompetitive;
new c_Respawn;
new c_RespawnDelay;
new g_iRespawnDelay;
new g_iTimer;
new p_NextMap;
new bool:g_bTeamSwap;
new p_Freezetime;
new g_iFreezetime;
new c_RankUpBonus;
new c_CmdAccess;
new c_OverrideMenu;
new g_iRoundKills[33];
new g_iDealDamage[33];
new c_AMinMoney;
new g_iAMinMoney;
new c_AMaxMoney;
new g_iAMaxMoney;
new c_PruneDays;
new g_iPruneDays = 30;
new c_HMinMoney;
new g_iHMinMoney;
new c_HMaxMoney;
new g_iHMaxMoney;
new c_KMinMoney;
new g_iKMinMoney;
new c_KMaxMoney;
new g_iKMaxMoney;
new c_HMinChance;
new g_iHMinChance;
new c_HMaxChance;
new g_iHMaxChance;
new c_KMinChance;
new g_iKMinChance;
new c_KMaxChance;
new g_iKMaxChance;
new g_iMostDamage[33];
new g_iDamage[33][33];
new g_iMenuToOpen[33];
new bool:g_IsChangeAllowed[33];
new bool:ShortThrow;
new g_szNadeModels[3][27] =
{
	{
		109, 111, 100, 101, 108, 115, 47, 119, 95, 99, 115, 103, 111, 99, 108, 97, 115, 115, 121, 95, 104, 101, 46, 109, 100, 108, 0
	},
	{
		109, 111, 100, 101, 108, 115, 47, 119, 95, 99, 115, 103, 111, 99, 108, 97, 115, 115, 121, 95, 102, 98, 46, 109, 100, 108, 0
	},
	{
		109, 111, 100, 101, 108, 115, 47, 119, 95, 99, 115, 103, 111, 99, 108, 97, 115, 115, 121, 95, 115, 103, 46, 109, 100, 108, 0
	}
};
new GrenadeName[3][0] =
{
	{
		119, ...
	},
	{
		119, ...
	},
	{
		119, ...
	}
};
new g_szWeaponEntName[31][0] =
{
	{
		0, ...
	},
	{
		119, ...
	},
	{
		0, ...
	},
	{
		119, ...
	},
	{
		119, ...
	},
	{
		119, ...
	},
	{
		119, ...
	},
	{
		119, ...
	},
	{
		119, ...
	},
	{
		119, ...
	},
	{
		119, ...
	},
	{
		119, ...
	},
	{
		119, ...
	},
	{
		119, ...
	},
	{
		119, ...
	},
	{
		119, ...
	},
	{
		119, ...
	},
	{
		119, ...
	},
	{
		119, ...
	},
	{
		119, ...
	},
	{
		119, ...
	},
	{
		119, ...
	},
	{
		119, ...
	},
	{
		119, ...
	},
	{
		119, ...
	},
	{
		119, ...
	},
	{
		119, ...
	},
	{
		119, ...
	},
	{
		119, ...
	},
	{
		119, ...
	},
	{
		119, ...
	}
};
new g_iMaxBpAmmo[11] =
{
	0, 30, 90, 200, 90, 32, 100, 100, 35, 52, 120
};
new g_warning[66] =
{
	"Could not find a valid map or the file does not exist (file "%s")"
};
new g_iWeaponIdToCheck[33];
new g_iOpenDelay[33];
Float:operator*(Float:,_:)(Float:oper1, oper2)
{
	return floatmul(oper1, float(oper2));
}

bool:operator>(Float:,Float:)(Float:oper1, Float:oper2)
{
	return floatcmp(oper1, oper2) > 0;
}

replace_all(string[], len, what[], with[])
{
	new pos;
	if ((pos = contain(string, what)) == -1)
	{
		return 0;
	}
	new total;
	new with_len = strlen(with);
	new diff = strlen(what) - with_len;
	new total_len = strlen(string);
	new temp_pos;
	while (replace(string[pos], len - pos, what, with))
	{
		total++;
		pos = with_len + pos;
		total_len -= diff;
		if (!(pos >= total_len))
		{
			temp_pos = contain(string[pos], what);
			if (!(temp_pos == -1))
			{
				pos = temp_pos + pos;
			}
			return total;
		}
		return total;
	}
	return total;
}

is_user_admin(id)
{
	new __flags = get_user_flags(id, MaxClients);
	new var1;
	return __flags > 0 && !__flags & 33554432;
}

cmd_access(id, level, cid, num, bool:accesssilent)
{
	new has_access;
	new var1;
	if (is_dedicated_server())
	{
		var1 = 0;
	}
	else
	{
		var1 = 1;
	}
	if (var1 == id)
	{
		has_access = 1;
	}
	else
	{
		if (level == 16777216)
		{
			if (is_user_admin(id))
			{
				has_access = 1;
			}
		}
		if (level & get_user_flags(id, MaxClients))
		{
			has_access = 1;
		}
		if (!level)
		{
			has_access = 1;
		}
	}
	if (has_access)
	{
		if (num > read_argc())
		{
			new hcmd[32];
			new hinfo[128];
			new hflag;
			new bool:info_ml;
			get_concmd(cid, hcmd, "", hflag, hinfo, 127, level, -1, info_ml);
			if (info_ml)
			{
				LookupLangKey(hinfo, 127, hinfo, id);
			}
			console_print(id, "%L:  %s %s", id, "USAGE", hcmd, hinfo);
			return 0;
		}
		return 1;
	}
	if (!accesssilent)
	{
		console_print(id, "%L", id, "NO_ACC_COM");
	}
	return 0;
}

cmd_target(id, arg[], flags)
{
	new player = find_player("bl", arg);
	if (player)
	{
		if (find_player("blj", arg) != player)
		{
			console_print(id, "%L", id, "MORE_CL_MATCHT");
			return 0;
		}
	}
	else
	{
		new var1;
		if ((player = find_player(244, arg)) && arg[0] == 35 && arg[1])
		{
			player = find_player(252, str_to_num(arg[1]));
		}
	}
	if (!player)
	{
		console_print(id, "%L", id, "CL_NOT_FOUND");
		return 0;
	}
	if (flags & 1)
	{
		new var3;
		if (get_user_flags(player, MaxClients) & 1 && flags & 2)
		{
			new imname[32];
			get_user_name(player, imname, "");
			console_print(id, "%L", id, "CLIENT_IMM", imname);
			return 0;
		}
	}
	if (flags & 4)
	{
		if (!is_user_alive(player))
		{
			new imname[32];
			get_user_name(player, imname, "");
			console_print(id, "%L", id, "CANT_PERF_DEAD", imname);
			return 0;
		}
	}
	if (flags & 8)
	{
		if (is_user_bot(player))
		{
			new imname[32];
			get_user_name(player, imname, "");
			console_print(id, "%L", id, "CANT_PERF_BOT", imname);
			return 0;
		}
	}
	return player;
}

get_configsdir(name[], len)
{
	return get_localinfo("amxx_configsdir", name, len);
}

fvault_get_data(vaultname[], key[], data[], len, &timestamp)
{
	new filename[128];
	_FormatVaultName(vaultname, filename, 127);
	if (!file_exists(filename, MaxClients))
	{
		return 0;
	}
	new vault = fopen(filename, "rt", MaxClients, "GAME");
	new _data[512];
	new _key[64];
	new _time[32];
	while (!feof(vault))
	{
		fgets(vault, _data, 511);
		parse(_data, _key, 63);
		if (equal(_key, key, MaxClients))
		{
			new _len = strlen(_key) + 4;
			new i = copy(data, len, _data[_len]) - 1;
			while (0 < i)
			{
				if (!(data[i] == 34))
				{
					new var1;
					if (data[i] == 32 && data[i + -1] == 34)
					{
						data[i + -1] = 0;
						copy(_time, "", data[i + 1]);
						timestamp = str_to_num(_time);
						fclose(vault);
						return 1;
					}
					i--;
				}
				fclose(vault);
				return 1;
			}
			fclose(vault);
			return 1;
		}
	}
	fclose(vault);
	copy(data, len, 868);
	return 0;
}

fvault_pset_data(vaultname[], key[], data[])
{
	_fvault_set_data(vaultname, key, data, -1);
	return 0;
}

_fvault_set_data(vaultname[], key[], data[], timestamp)
{
	new file = fopen(_temp_vault, "wt", MaxClients, "GAME");
	new filename[128];
	_FormatVaultName(vaultname, filename, 127);
	new vault = fopen(filename, "rt", MaxClients, "GAME");
	new _data[512];
	new _key[64];
	new _other[3];
	new bool:replaced;
	while (!feof(vault))
	{
		fgets(vault, _data, 511);
		parse(_data, _key, 63, _other, 2);
		new var1;
		if (equal(_key, key, MaxClients) && !replaced)
		{
			fprintf(file, "\"%s\" \"%s\" %i\n", key, data, timestamp);
			replaced = true;
		}
		else
		{
			fputs(file, _data, MaxClients);
		}
	}
	fclose(file);
	fclose(vault);
	if (!replaced)
	{
		file = fopen(filename, "a+", MaxClients, "GAME");
		fprintf(file, "\"%s\" \"%s\" %i\n", key, data, timestamp);
		fclose(file);
		delete_file(_temp_vault, MaxClients, "GAMECONFIG");
	}
	else
	{
		delete_file(filename, MaxClients, "GAMECONFIG");
		do {
		} while (!rename_file(_temp_vault, filename, 1));
	}
	return 0;
}

_FormatVaultName(vaultname[], filename[], len)
{
	static invalid_chars[9][2] =
	{
		{
			47, 0
		},
		{
			92, 0
		},
		{
			42, 0
		},
		{
			58, 0
		},
		{
			63, 0
		},
		{
			34, 0
		},
		{
			60, 0
		},
		{
			62, 0
		},
		{
			124, 0
		}
	};
	static i;
	static tempvault[128];
	copy(tempvault, 127, vaultname);
	i = 0;
	while (i < 9)
	{
		replace_all(tempvault, 127, invalid_chars[i], 1688);
		i += 1;
	}
	if (!dir_exists(_vault_dir, MaxClients))
	{
		mkdir(_vault_dir, 511, MaxClients, "GAMECONFIG");
	}
	formatex(filename, len, "%s/%s.txt", _vault_dir, tempvault);
	return 0;
}

public __fatal_ham_error(Ham:id, HamError:err, reason[])
{
	new func = get_func_id("HamFilter", -1);
	new bool:fail = 1;
	new var1;
	if (func != -1 && callfunc_begin_i(func, -1) == 1)
	{
		callfunc_push_int(id);
		callfunc_push_int(err);
		callfunc_push_str(reason, MaxClients);
		if (callfunc_end() == 1)
		{
			fail = false;
		}
	}
	if (fail)
	{
		set_fail_state(reason);
	}
	return 0;
}

public _HTTP_EntityThink(iEntity)
{
	static iRet;
	static iActiveSlots;
	static iDataStart;
	static iDataBlocks;
	static iSlot;
	if (g_HTTPEntity != iEntity)
	{
		return 0;
	}
	iActiveSlots = 0;
	iSlot = 0;
	while (iSlot < 10)
	{
		if (HTTP[iSlot][325])
		{
			iActiveSlots += 1;
			if (socket_is_readable(HTTP[iSlot][321], MaxClients))
			{
				if ((iDataBlocks = socket_recv(HTTP[iSlot][321], g_DataBuffer, 4096)))
				{
					new var2 = HTTP[iSlot][322];
					var2++;
					new var1;
					if (var2 == 1 && (iDataStart = strfind(g_DataBuffer, "\r\n\r\n", MaxClients, MaxClients)) > -1)
					{
						new iContentLength = strfind(g_DataBuffer, "Content-Length: ", MaxClients, MaxClients);
						if (iContentLength > -1)
						{
							new iSizeEnd = strfind(g_DataBuffer[iContentLength + 16], "\r\n", MaxClients, MaxClients);
							if (iSizeEnd > -1)
							{
								g_DataBuffer[iSizeEnd] = 0;
								HTTP[iSlot][324] = str_to_num(g_DataBuffer[iContentLength + 16]);
							}
						}
						iDataStart = iDataStart + 4;
					}
					else
					{
						iDataStart = 0;
					}
					new var3 = HTTP[iSlot][323];
					var3 = var3[fwrite_blocks(HTTP[iSlot][320], g_DataBuffer[iDataStart], iDataBlocks - iDataStart, 1)];
					if (HTTP[iSlot][324] == HTTP[iSlot][323])
					{
						ExecuteForward(g_Forward, iRet, HTTP[iSlot][192], HTTP[iSlot][325], HTTP[iSlot][323], HTTP[iSlot][324], 1);
						fclose(HTTP[iSlot][320]);
						socket_close(HTTP[iSlot][321]);
						iActiveSlots -= 1;
						HTTP[iSlot][325] = 0;
					}
					else
					{
						ExecuteForward(g_Forward, iRet, HTTP[iSlot][192], HTTP[iSlot][325], HTTP[iSlot][323], HTTP[iSlot][324], 0);
					}
				}
				ExecuteForward(g_Forward, iRet, HTTP[iSlot][192], HTTP[iSlot][325], HTTP[iSlot][323], HTTP[iSlot][324], 1);
				fclose(HTTP[iSlot][320]);
				socket_close(HTTP[iSlot][321]);
				iActiveSlots -= 1;
				HTTP[iSlot][325] = 0;
			}
		}
		iSlot += 1;
	}
	if (iActiveSlots)
	{
		entity_set_float(g_HTTPEntity, 7, floatadd(1008981770, get_gametime()));
	}
	else
	{
		entity_set_int(g_HTTPEntity, 27, 1073741824);
		call_think(g_HTTPEntity);
		g_HTTPEntity = 0;
		DestroyForward(g_Forward);
		g_Forward = 0;
	}
	return 0;
}

xs_vec_mul_scalar(Float:vec[], Float:scalar, Float:out[])
{
	out[0] = floatmul(vec[0], scalar);
	out[1] = floatmul(vec[1], scalar);
	out[2] = floatmul(vec[2], scalar);
	return 0;
}

UnixToTime(iTimeStamp, &iYear, &iMonth, &iDay, &iHour, &iMinute, &iSecond, TimeZones:tzTimeZone)
{
	new iTemp;
	iYear = 1970;
	iMonth = 1;
	iDay = 1;
	iHour = 0;
	if (!tzTimeZone)
	{
		tzTimeZone = GetTimeZone();
	}
	iTimeStamp = TimeZoneOffset[tzTimeZone][iTimeStamp];
	while (0 < iTimeStamp)
	{
		iTemp = IsLeapYear(iYear);
		if (0 <= iTimeStamp - YearSeconds[iTemp])
		{
			iTimeStamp -= YearSeconds[iTemp];
			new var1 = iYear;
			var1++;
			iYear = var1;
		}
		while (0 < iTimeStamp)
		{
			iTemp = SecondsInMonth(iYear, iMonth);
			if (0 <= iTimeStamp - iTemp)
			{
				iTimeStamp -= iTemp;
				new var2 = iMonth;
				var2++;
				iMonth = var2;
			}
			while (0 < iTimeStamp)
			{
				if (0 <= iTimeStamp - DaySeconds)
				{
					iTimeStamp -= DaySeconds;
					new var3 = iDay;
					var3++;
					iDay = var3;
				}
				while (0 < iTimeStamp)
				{
					if (0 <= iTimeStamp - HourSeconds)
					{
						iTimeStamp -= HourSeconds;
						new var4 = iHour;
						var4++;
						iHour = var4;
					}
					iMinute = iTimeStamp / 60;
					iSecond = iTimeStamp % 60;
					return 0;
				}
				iMinute = iTimeStamp / 60;
				iSecond = iTimeStamp % 60;
				return 0;
			}
			while (0 < iTimeStamp)
			{
				if (0 <= iTimeStamp - HourSeconds)
				{
					iTimeStamp -= HourSeconds;
					new var4 = iHour;
					var4++;
					iHour = var4;
				}
				iMinute = iTimeStamp / 60;
				iSecond = iTimeStamp % 60;
				return 0;
			}
			iMinute = iTimeStamp / 60;
			iSecond = iTimeStamp % 60;
			return 0;
		}
		while (0 < iTimeStamp)
		{
			if (0 <= iTimeStamp - DaySeconds)
			{
				iTimeStamp -= DaySeconds;
				new var3 = iDay;
				var3++;
				iDay = var3;
			}
			while (0 < iTimeStamp)
			{
				if (0 <= iTimeStamp - HourSeconds)
				{
					iTimeStamp -= HourSeconds;
					new var4 = iHour;
					var4++;
					iHour = var4;
				}
				iMinute = iTimeStamp / 60;
				iSecond = iTimeStamp % 60;
				return 0;
			}
			iMinute = iTimeStamp / 60;
			iSecond = iTimeStamp % 60;
			return 0;
		}
		while (0 < iTimeStamp)
		{
			if (0 <= iTimeStamp - HourSeconds)
			{
				iTimeStamp -= HourSeconds;
				new var4 = iHour;
				var4++;
				iHour = var4;
			}
			iMinute = iTimeStamp / 60;
			iSecond = iTimeStamp % 60;
			return 0;
		}
		iMinute = iTimeStamp / 60;
		iSecond = iTimeStamp % 60;
		return 0;
	}
	while (0 < iTimeStamp)
	{
		iTemp = SecondsInMonth(iYear, iMonth);
		if (0 <= iTimeStamp - iTemp)
		{
			iTimeStamp -= iTemp;
			new var2 = iMonth;
			var2++;
			iMonth = var2;
		}
		while (0 < iTimeStamp)
		{
			if (0 <= iTimeStamp - DaySeconds)
			{
				iTimeStamp -= DaySeconds;
				new var3 = iDay;
				var3++;
				iDay = var3;
			}
			while (0 < iTimeStamp)
			{
				if (0 <= iTimeStamp - HourSeconds)
				{
					iTimeStamp -= HourSeconds;
					new var4 = iHour;
					var4++;
					iHour = var4;
				}
				iMinute = iTimeStamp / 60;
				iSecond = iTimeStamp % 60;
				return 0;
			}
			iMinute = iTimeStamp / 60;
			iSecond = iTimeStamp % 60;
			return 0;
		}
		while (0 < iTimeStamp)
		{
			if (0 <= iTimeStamp - HourSeconds)
			{
				iTimeStamp -= HourSeconds;
				new var4 = iHour;
				var4++;
				iHour = var4;
			}
			iMinute = iTimeStamp / 60;
			iSecond = iTimeStamp % 60;
			return 0;
		}
		iMinute = iTimeStamp / 60;
		iSecond = iTimeStamp % 60;
		return 0;
	}
	while (0 < iTimeStamp)
	{
		if (0 <= iTimeStamp - DaySeconds)
		{
			iTimeStamp -= DaySeconds;
			new var3 = iDay;
			var3++;
			iDay = var3;
		}
		while (0 < iTimeStamp)
		{
			if (0 <= iTimeStamp - HourSeconds)
			{
				iTimeStamp -= HourSeconds;
				new var4 = iHour;
				var4++;
				iHour = var4;
			}
			iMinute = iTimeStamp / 60;
			iSecond = iTimeStamp % 60;
			return 0;
		}
		iMinute = iTimeStamp / 60;
		iSecond = iTimeStamp % 60;
		return 0;
	}
	while (0 < iTimeStamp)
	{
		if (0 <= iTimeStamp - HourSeconds)
		{
			iTimeStamp -= HourSeconds;
			new var4 = iHour;
			var4++;
			iHour = var4;
		}
		iMinute = iTimeStamp / 60;
		iSecond = iTimeStamp % 60;
		return 0;
	}
	iMinute = iTimeStamp / 60;
	iSecond = iTimeStamp % 60;
	return 0;
}

TimeToUnix(iYear, iMonth, iDay, iHour, iMinute, iSecond, TimeZones:tzTimeZone)
{
	new i;
	new iTimeStamp;
	i = 1970;
	while (i < iYear)
	{
		iTimeStamp = YearSeconds[IsLeapYear(i)][iTimeStamp];
		i++;
	}
	i = 1;
	while (i < iMonth)
	{
		iTimeStamp = SecondsInMonth(iYear, i) + iTimeStamp;
		i++;
	}
	iTimeStamp = DaySeconds * iDay + -1 + iTimeStamp;
	iTimeStamp = HourSeconds * iHour + iTimeStamp;
	iTimeStamp = MinuteSeconds * iMinute + iTimeStamp;
	iTimeStamp = iSecond + iTimeStamp;
	if (!tzTimeZone)
	{
		tzTimeZone = GetTimeZone();
	}
	return TimeZoneOffset[tzTimeZone][iTimeStamp];
}

TimeZones:GetTimeZone()
{
	if (TimeZone)
	{
		return TimeZone;
	}
	new TimeZones:iZone;
	new iOffset;
	new iTime;
	new iYear;
	new iMonth;
	new iDay;
	new iHour;
	new iMinute;
	new iSecond;
	date(iYear, iMonth, iDay);
	time(iHour, iMinute, iSecond);
	iTime = TimeToUnix(iYear, iMonth, iDay, iHour, iMinute, iSecond, TimeZones:18);
	iOffset = iTime - get_systime(MaxClients);
	iZone = MissingTAG:0;
	while (iZone < TimeZones:41)
	{
		if (TimeZoneOffset[iZone] == iOffset)
		{
			new var1 = iZone;
			TimeZone = var1;
			return var1;
		}
		iZone++;
	}
	new var1 = iZone;
	TimeZone = var1;
	return var1;
}

SecondsInMonth(iYear, iMonth)
{
	new var1;
	if (IsLeapYear(iYear) && iMonth == 2)
	{
		var2 = MonthSeconds[iMonth + -1][DaySeconds];
	}
	else
	{
		var2 = MonthSeconds[iMonth + -1];
	}
	return var2;
}

IsLeapYear(iYear)
{
	new var2;
	return iYear % 4 && (iYear % 100 || iYear % 400);
}

public plugin_init()
{
	register_plugin(337292, "1.0", "renegade");
	register_cvar("csgo_classy_version", "1.0", 68, MaxClients);
	set_cvar_string("csgo_classy_version", "1.0");
	register_cvar("csgo_classy_author", "renegade", 68, MaxClients);
	set_cvar_string("csgo_classy_author", "renegade");
	c_PruneDays = register_cvar("prunedays_delete", "30", MaxClients, MaxClients);
	rankLevelBonus = register_cvar("bonus_amount", "150", MaxClients, MaxClients);
	rankSaveType = register_cvar("save_type", 337996, MaxClients, MaxClients);
	get_time("%d", g_szDay, 2);
	g_iDay = str_to_num(g_szDay);
	g_iVault = nvault_open("csgoclassydaily");
	if (g_iVault == -1)
	{
		set_fail_state("Can not open csgoclassydaily.vault");
	}
	register_dictionary("csgoclassy.txt");
	register_event("HLTV", "ev_NewRound", 338348, "1=0", "2=0");
	register_event("HLTV", "event_RoundStart", 338476, "1=0", "2=0");
	register_logevent("logev_Restart_Round", 2, "1&Restart_Round");
	register_logevent("logev_Game_Commencing", 2, "1&Game_Commencing");
	register_event("SendAudio", "ev_RoundWon_T", 338916, "2&%!MRAD_terwin");
	register_event("SendAudio", "ev_RoundWon_CT", 339088, "2&%!MRAD_ctwin");
	register_event("StatusValue", "showStatus", "be", "1=2", "2!0");
	register_event("StatusValue", "hideStatus", "be", "1=1", "2=0");
	g_iSkinID = getGiveawaySkin(g_szSkinName);
	new i;
	while (i < 4)
	{
		g_Messages[i] = get_user_msgid(g_Messages_Name[i]);
		register_message(g_Messages[i], "block");
		i++;
	}
	crosshaircontrols = get_pcvar_num(register_cvar("crosshair_select", 339520, MaxClients, MaxClients));
	g_msgHideWeapon = get_user_msgid("HideWeapon");
	register_event("CurWeapon", "HookCurWeapon2", "be", "1=1");
	RegisterHam(11, "player", "fw_PlayerKilled", MaxClients, MaxClients);
	register_event("HLTV", "Event_New_Round", 339876, "1=0", "2=0");
	register_forward(125, "FW_CmdStart", MaxClients);
	crosshairvault = nvault_open("csgoclassycrosshair");
	new i;
	while (i < 2)
	{
		RegisterHam(89, weapon_weapon[i], "fw_Weapon_Reload_Post", 1, MaxClients);
		i++;
	}
	new i;
	while (i < 3)
	{
		fw_PA[i] = RegisterHam(87, GrenadeName[i], "Ham_Grenade_PA", 1, MaxClients);
		fw_SA[i] = RegisterHam(88, GrenadeName[i], "Ham_Grenade_SA", 1, MaxClients);
		i++;
	}
	register_event("30", "changeMap", 340304, 340312);
	register_cvar("amx_nextmap", 340364, "%L:  %s %s", MaxClients);
	new szString[32];
	new szString2[32];
	new szString3[8];
	get_localinfo("lastmapcycle", szString, "");
	parse(szString, szString2, 31, szString3, 7);
	g_pos = str_to_num(szString3);
	get_cvar_string("mapcyclefile", g_mapCycle, "");
	if (!equal(g_mapCycle, szString2, MaxClients))
	{
		g_pos = 0;
	}
	readMapCycle(g_mapCycle, g_nextMap, 31);
	set_cvar_string("amx_nextmap", g_nextMap);
	format(szString3, "", "%s %d", g_mapCycle, g_pos);
	set_localinfo("lastmapcycle", szString3);
	fw_CUIC = register_forward(122, "fw_FM_ClientUserInfoChanged", MaxClients);
	c_OverrideMenu = register_cvar("override_menu", 340764, MaxClients, MaxClients);
	c_ShowHUD = register_cvar("show_not_logged", 340836, MaxClients, MaxClients);
	c_HMinMoney = register_cvar("head_minmoney", 340900, MaxClients, MaxClients);
	c_HMaxMoney = register_cvar("head_maxmoney", 340964, MaxClients, MaxClients);
	c_KMinMoney = register_cvar("kill_minmoney", 341028, MaxClients, MaxClients);
	c_KMaxMoney = register_cvar("kill_maxmoney", 341092, MaxClients, MaxClients);
	c_HMinChance = register_cvar("head_minchance", "50", MaxClients, MaxClients);
	c_HMaxChance = register_cvar("head_maxchance", "100", MaxClients, MaxClients);
	c_KMinChance = register_cvar("kill_minchance", 341308, MaxClients, MaxClients);
	c_KMaxChance = register_cvar("kill_maxchance", "100", MaxClients, MaxClients);
	c_AMinMoney = register_cvar("assist_minmoney", 341456, MaxClients, MaxClients);
	c_AMaxMoney = register_cvar("assist_maxmoney", 341528, MaxClients, MaxClients);
	c_TombolaCost = register_cvar("tombola_cost", "500", MaxClients, MaxClients);
	c_RegOpen = register_cvar("register_open", 341660, MaxClients, MaxClients);
	c_RankUpBonus = register_cvar("rankup_bonus", "kkcc|150", MaxClients, MaxClients);
	c_ReturnPercent = register_cvar("return_percent", 341816, MaxClients, MaxClients);
	c_ShowDropCraft = register_cvar("show_dropcraft", 341884, MaxClients, MaxClients);
	c_DropType = register_cvar("drop_type", 341932, MaxClients, MaxClients);
	c_KeyPrice = register_cvar("key_price", "80", MaxClients, MaxClients);
	c_TombolaTimer = register_cvar("tombola_timer", "180", MaxClients, MaxClients);
	c_JackpotTimer = register_cvar("jackpot_timer", "240", MaxClients, MaxClients);
	c_Competitive = register_cvar("competitive_mode", 342204, MaxClients, MaxClients);
	c_WarmUpDuration = register_cvar("warmup_duration", "45", MaxClients, MaxClients);
	c_RouletteMin = register_cvar("roulette_min", 342340, MaxClients, MaxClients);
	c_RouletteMax = register_cvar("roulette_max", "10", MaxClients, MaxClients);
	register_event("DeathMsg", "ev_DeathMsg", 342496, "1>0");
	register_event("Damage", "ev_Damage", 342588, "2!0", "3=0", "4!0");
	fw_S1 = RegisterHam(MaxClients, "player", "Ham_Player_Spawn_Post", 1, MaxClients);
	fw_S2 = RegisterHam(MaxClients, "player", "Ham_Player_Spawn_Pre", MaxClients, MaxClients);
	fw_K1 = RegisterHam(11, "player", "Ham_Player_Killed_Post", 1, MaxClients);
	fw_K2 = RegisterHam(11, "player", "Ham_Player_Killed_Pre", MaxClients, MaxClients);
	c_Respawn = register_cvar("respawn_enable", 343168, MaxClients, MaxClients);
	c_RespawnDelay = register_cvar("respawn_delay", 343232, MaxClients, MaxClients);
	c_DropChance = register_cvar("dropchance", "95", MaxClients, MaxClients);
	c_CraftCost = register_cvar("craft_cost", "25", MaxClients, MaxClients);
	c_DustForTransform = register_cvar("scraps_for_transform", 343436, MaxClients, MaxClients);
	c_Suicide = register_cvar("suicide", 343476, MaxClients, MaxClients);
	RegisterHam(9, "player", "OnTakeDamage", MaxClients, MaxClients);
	register_event("DeathMsg", "OnPlayerKilled", 343660, 340312);
	register_logevent("OnRoundEnd", 2, "1=Round_End");
	g_nVaultStattrack = nvault_open("csgoclassy_stattrack");
	g_nVaultStattrackKills = nvault_open("csgoclassy_stattrack_kills");
	if (get_pcvar_num(c_Suicide) > 0)
	{
		register_forward(100, "concmd_kill", MaxClients);
	}
	g_MsgSync = CreateHudSyncObj(MaxClients);
	g_WarmUpSync = CreateHudSyncObj(MaxClients);
	g_iMaxPlayers = get_maxplayers();
	new size = 31;
	i = 1;
	while (i < size)
	{
		if (g_szWeaponEntName[i][0])
		{
			fw_ID[i] = RegisterHam(66, g_szWeaponEntName[i], "Ham_Item_Deploy_Post", 1, MaxClients);
			fw_ICD[i] = RegisterHam(99, g_szWeaponEntName[i], "Ham_Item_Can_Drop", MaxClients, MaxClients);
		}
		i++;
	}
	register_clcmd("say /tradeaccept", "clcmd_say_accept", -1, 344292, -1, MaxClients);
	register_clcmd("say /tradedeny", "clcmd_say_deny", -1, 344292, -1, MaxClients);
	register_clcmd("say /coinflipaccept", "clcmd_say_accept_cf", -1, 344292, -1, MaxClients);
	register_clcmd("say /coinflipdeny", "clcmd_say_deny_cf", -1, 344292, -1, MaxClients);
	if (get_pcvar_num(c_OverrideMenu) > 0)
	{
		register_clcmd("chooseteam", "clcmd_chooseteam", -1, 344832, -1, MaxClients);
	}
	register_concmd("UserPassword", "concmd_password", -1, 344952, -1, MaxClients);
	register_concmd("SkinPrice", "concmd_itemprice", -1, 345064, -1, MaxClients);
	register_concmd("BetMoney", "concmd_betmoney", -1, 345168, -1, MaxClients);
	g_Vault = nvault_open("csgoclassy");
	if (g_Vault == -1)
	{
		set_fail_state("[CSGO Classy] Could not open file csgoclassy.vault");
		return 0;
	}
	log_amx("[CSGO Classy] File csgoclassy.vault was successfully loaded");
	c_CmdAccess = register_cvar("commands_access", 345724, MaxClients, MaxClients);
	new Flags[8];
	get_pcvar_string(c_CmdAccess, Flags, 7);
	new Access = read_flags(Flags);
	register_concmd("amx_givemoney", "concmd_givemoney", Access, "<Name> <Amount>", -1, MaxClients);
	register_concmd("amx_givecases", "concmd_givecases", Access, "<Name> <Amount>", -1, MaxClients);
	register_concmd("amx_givekeys", "concmd_givekeys", Access, "<Name> <Amount>", -1, MaxClients);
	register_concmd("amx_givescraps", "concmd_givescraps", Access, "<Name> <Amount>", -1, MaxClients);
	register_concmd("amx_setskins", "concmd_giveskins", Access, "<Name> <SkinID or @ALL> <Amount> <StatTrack status (1 or 0)", -1, MaxClients);
	register_concmd("amx_setrank", "concmd_setrank", Access, "<Name> <Rank ID>", -1, MaxClients);
	register_concmd("amx_finddata", "concmd_finddata", Access, "<Name>", -1, MaxClients);
	register_concmd("amx_resetdata", "concmd_resetdata", Access, "<Name>", -1, MaxClients);
	register_concmd("amx_getinfo", "concmd_getinfo", Access, "<Type> <Index>", -1, MaxClients);
	p_Freezetime = get_cvar_pointer("mp_freezetime");
	p_StartMoney = get_cvar_pointer("mp_startmoney");
	g_status_sync = CreateHudSyncObj(MaxClients);
	_LicenseChecker();
	return 0;
}

public plugin_precache()
{
	precache_sound(g_szTWin);
	precache_sound(g_szCTWin);
	new i;
	while (i < 16)
	{
		precache_generic(crosshair_list[i][1]);
		i++;
	}
	new i;
	while (i < 3)
	{
		precache_model(g_szNadeModels[i]);
		i++;
	}
	new fp = fopen(g_szConfigFile, "rt", MaxClients, "GAME");
	if (!fp)
	{
		set_fail_state("[CSGO Classy] Could not open file csgoclassy.ini");
		return 0;
	}
	log_amx("[CSGO Classy] File csgoclassy.ini was successfully loaded");
	new buff[128];
	new section;
	new leftpart[48];
	new rightpart[48];
	new weaponid[4];
	new weaponname[32];
	new weaponmodel[48];
	new weapontype[4];
	new weaponchance[8];
	new weaponcostmin[8];
	new bodypart[8];
	while (!feof(fp))
	{
		fgets(fp, buff, 127);
		new var1;
		if (!buff[0] || buff[0] == 59)
		{
			new var2;
			if (!(buff[0] == 59 || buff[0]))
			{
				if (buff[0] == 91)
				{
					section += 1;
				}
				switch (section)
				{
					case 1:
					{
						if (buff[0] != 91)
						{
							parse(buff, leftpart, 47, rightpart, 47);
							ArrayPushString(g_aRankName, leftpart);
							ArrayPushCell(g_aRankKills, str_to_num(rightpart));
							g_iRanksNum = g_iRanksNum + 1;
						}
					}
					case 2:
					{
						if (buff[0] != 91)
						{
							parse(buff, leftpart, 47, rightpart, 47);
							new wid = str_to_num(leftpart);
							copy(g_szDefaultSkinModel[wid], 47, rightpart);
							new var5;
							if (strlen(rightpart) > 0 && file_exists(rightpart, MaxClients))
							{
								precache_model(rightpart);
							}
							else
							{
								new var6;
								if (0 < strlen(rightpart) && !file_exists(rightpart, MaxClients))
								{
									new error[128];
									formatex(error, strlen(rightpart) + 127, "[CSGO Classy] You have a missing file \"%s\" in the [DEFAULT] section of csgoclassy.ini", rightpart);
									set_fail_state(error);
									return 0;
								}
							}
						}
					}
					case 3:
					{
						if (buff[0] != 91)
						{
							parse(buff, weaponid, 3, weaponname, 31, weaponmodel, 47, weapontype, 3, weaponchance, 7, weaponcostmin, 7, bodypart, 7);
							ArrayPushCell(g_aSkinWeaponID, str_to_num(weaponid));
							ArrayPushString(g_aSkinName, weaponname);
							ArrayPushString(g_aSkinModel, weaponmodel);
							ArrayPushString(g_aSkinType, weapontype);
							ArrayPushCell(g_aSkinChance, str_to_num(weaponchance));
							ArrayPushCell(g_aSkinCostMin, str_to_num(weaponcostmin));
							ArrayPushCell(g_aSkinBody, str_to_num(bodypart));
							new var3;
							if (0 < strlen(weaponmodel) && file_exists(weaponmodel, MaxClients))
							{
								precache_model(weaponmodel);
							}
							else
							{
								new var4;
								if (0 < strlen(weaponmodel) && !file_exists(weaponmodel, MaxClients))
								{
									new error[128];
									formatex(error, strlen(weaponmodel) + 127, "[CSGO Classy] You have a missing file \"%s\" in the [SKINS] section of csgoclassy.ini", weaponmodel);
									set_fail_state(error);
									return 0;
								}
							}
							switch (weapontype[0])
							{
								case 99:
								{
									ArrayPushCell(g_aCraftSkin, g_iSkinsNum);
									g_iCraftSkinNum = g_iCraftSkinNum + 1;
								}
								case 100:
								{
									ArrayPushCell(g_aDropSkin, g_iSkinsNum);
									g_iDropSkinNum = g_iDropSkinNum + 1;
								}
								default:
								{
								}
							}
							g_iSkinsNum = g_iSkinsNum + 1;
						}
					}
					default:
					{
					}
				}
			}
		}
	}
	fclose(fp);
	return 0;
}

public plugin_cfg()
{
	new id;
	new wid;
	id = 1;
	while (id <= g_iMaxPlayers)
	{
		wid = 1;
		while (wid <= 30)
		{
			g_iUserSelectedSkin[id][wid] = -1;
			wid++;
		}
		id++;
	}
	server_cmd("exec %s/csgoclassy.cfg", g_szCfgDir);
	g_iTombolaTimer = get_pcvar_num(c_TombolaTimer);
	new Float:timer = float(g_iTombolaTimer);
	set_task(timer, "task_TombolaRun", 2000, 348872, MaxClients, 348876, MaxClients);
	g_iNextTombolaStart = get_systime(MaxClients) + g_iTombolaTimer;
	return 0;
}

public plugin_natives()
{
	register_library("csgoclassy");
	get_configsdir(g_szCfgDir, 47);
	formatex(g_szConfigFile, 47, "%s/csgoclassy.ini", g_szCfgDir);
	if (!file_exists(g_szConfigFile, MaxClients))
	{
		return 0;
	}
	g_aRankName = ArrayCreate("NO_ACC_COM", 1);
	g_aRankKills = ArrayCreate(1, 1);
	g_aSkinWeaponID = ArrayCreate(1, 1);
	g_aSkinBody = ArrayCreate(1, 1);
	g_aSkinName = ArrayCreate("NO_ACC_COM", 1);
	g_aSkinModel = ArrayCreate(48, 1);
	g_aSkinType = ArrayCreate(2, 1);
	g_aSkinChance = ArrayCreate(1, 1);
	g_aSkinCostMin = ArrayCreate(1, 1);
	g_aDropSkin = ArrayCreate(1, 1);
	g_aCraftSkin = ArrayCreate(1, 1);
	g_aTombola = ArrayCreate(1, 1);
	g_aJackpotSkins = ArrayCreate(1, 1);
	g_aJackPotSttSkins = ArrayCreate(1, 1);
	g_aJackpotUsers = ArrayCreate(1, 1);
	register_native("get_user_money", "native_get_user_money", MaxClients);
	register_native("set_user_money", "native_set_user_money", MaxClients);
	register_native("get_user_cases", "native_get_user_cases", MaxClients);
	register_native("set_user_cases", "native_set_user_cases", MaxClients);
	register_native("get_user_keys", "native_get_user_keys", MaxClients);
	register_native("set_user_keys", "native_set_user_keys", MaxClients);
	register_native("get_user_scraps", "native_get_user_scraps", MaxClients);
	register_native("set_user_scraps", "native_set_user_scraps", MaxClients);
	register_native("get_user_rank", "native_get_user_rank", MaxClients);
	register_native("set_user_rank", "native_set_user_rank", MaxClients);
	register_native("get_user_skins", "native_get_user_skins", MaxClients);
	register_native("set_user_skins", "native_set_user_skins", MaxClients);
	register_native("is_user_logged", "native_is_user_logged", MaxClients);
	register_native("is_using_m4a4", "_checku", MaxClients);
	register_native("getSkinName", "_getSkinName", MaxClients);
	register_native("getWeaponSkinId", "_getCurrentSkin", MaxClients);
	register_native("updateWeaponSkin", "_update", MaxClients);
	register_native("set_user_randomskin", "_setRandom", MaxClients);
	return 0;
}

public _checku()
{
	return g_bUsingM4A4[get_param(1)];
}

public _setRandom()
{
	new id = get_param(1);
	new iRandomSkin = random_num(MaxClients, g_iSkinsNum);
	g_iUserSkins[id][iRandomSkin]++;
	new model[48];
	ArrayGetString(g_aSkinName, iRandomSkin, model, 47);
	set_string(2, model, 47);
	_SaveData(id);
	return 0;
}

public _update()
{
	new id = get_param(1);
	new iWeaponID = get_param(2);
	new userskin = get_param(3);
	if (iWeaponID == get_user_weapon(id, 0, 0))
	{
		if (userskin == -1)
		{
			return 0;
		}
		if (userskin == 3812)
		{
			return 0;
		}
		new model[48];
		ArrayGetString(g_aSkinModel, userskin, model, 47);
	}
	return 0;
}

public _getSkinName()
{
	new id = get_param(1);
	if (!is_user_connected(id))
	{
		return 0;
	}
	new iWeaponId = get_param(2);
	if (g_iUserSelectedSkin[id][iWeaponId] == -1)
	{
		return 0;
	}
	new szSkin[50];
	new i;
	new num;
	new iKillCount;
	while (i < g_iSkinsNum)
	{
		num = g_iUserSkins[id][i];
		if (0 < num)
		{
			if (g_iUserSelectedSkin[id][iWeaponId] == i)
			{
				new var1;
				if (g_bIsWeaponStattrack[id][i] && g_bShallUseStt[id][iWeaponId])
				{
					iKillCount = g_iUserStattrackKillCount[id][i];
					ArrayGetString(g_aSkinName, i, szSkin, 49);
					set_string(3, szSkin, 49);
					return iKillCount;
				}
			}
		}
		i++;
	}
	set_string(3, szSkin, 49);
	return iKillCount;
}

public plugin_end()
{
	if (g_iVault != -1)
	{
		ArrayDestroy(g_aRankName);
	}
	ArrayDestroy(g_aRankKills);
	ArrayDestroy(g_aSkinWeaponID);
	ArrayDestroy(g_aSkinName);
	ArrayDestroy(g_aSkinModel);
	ArrayDestroy(g_aSkinType);
	ArrayDestroy(g_aSkinChance);
	ArrayDestroy(g_aSkinCostMin);
	ArrayDestroy(g_aDropSkin);
	ArrayDestroy(g_aCraftSkin);
	if (g_iPruneDays > 0)
	{
		nvault_prune(g_Vault, MaxClients, get_systime(MaxClients) - g_iPruneDays * 86400);
	}
	nvault_close(g_Vault);
	nvault_close(g_iVault);
	DisableHamForward(fw_S1);
	DisableHamForward(fw_S2);
	DisableHamForward(fw_K1);
	DisableHamForward(fw_K2);
	unregister_forward(122, fw_CUIC, MaxClients);
	return 0;
}

public client_putinserver(id)
{
	get_user_name(id, g_szName[id], "");
	client_cmd(id, "crosshair 1");
	load_cross(id);
	_ResetCFData(id);
	g_bJoinedGiveAway[id] = 0;
	g_IsChangeAllowed[id] = 0;
	g_bBettingCFStt[id] = 0;
	g_bUsingM4A4[id] = 0;
	g_iSkinsInContract[id] = 0;
	g_iUserChance[id] = 0;
	new i;
	while (i < 10)
	{
		g_iWeaponUsedInContract[id][i] = -1;
		i++;
	}
	new iPlayers[32];
	new iNum;
	get_players(iPlayers, iNum, "ch", 351508);
	new a;
	while (a < iNum)
	{
		new i;
		while (i < 50)
		{
			g_bShallUseStt[iPlayers[a]][i] = true;
			i++;
		}
		a++;
	}
	g_bPublishedStattrackSkin[id] = 0;
	g_bGiftingStt[id] = 0;
	g_bDestroyStt[id] = 0;
	g_bTradingStt[id] = 0;
	g_bJackpotStt[id] = 0;
	g_iMostDamage[id] = 0;
	g_iUserPassFail[id] = 0;
	g_bLogged[id] = 0;
	g_iUserMoney[id] = 0;
	g_iUserScraps[id] = 0;
	g_iUserKeys[id] = 0;
	g_iUserCases[id] = 0;
	g_iUserKills[id] = 0;
	g_iUserRank[id] = 0;
	g_bUserSell[id] = 0;
	g_iUserSellItem[id] = -1;
	g_iLastPlace[id] = 0;
	g_iMenuType[id] = 0;
	g_iGiftTarget[id] = 0;
	g_iGiftItem[id] = -1;
	g_iTradeTarget[id] = 0;
	g_iTradeItem[id] = -1;
	g_bTradeActive[id] = 0;
	g_bTradeAccept[id] = 0;
	g_bTradeSecond[id] = 0;
	g_iTradeRequest[id] = 0;
	_ResetCFData(id);
	g_bUserPlay[id] = 0;
	g_iUserBetMoney[id] = 100;
	g_bRoulettePlay[id] = 0;
	g_iUserJackpotItem[id] = -1;
	g_bUserPlayJackpot[id] = 0;
	new wid = 1;
	while (wid <= 30)
	{
		g_iUserSelectedSkin[id][wid] = -1;
		wid++;
	}
	new sid;
	while (sid < 450)
	{
		g_iUserSkins[id][sid] = 0;
		sid++;
	}
	if (get_pcvar_num(c_ShowHUD) > 0)
	{
		set_task(1065353216, "task_HUD", id, 351556, MaxClients, 351560, MaxClients);
	}
	return 0;
}

public client_connect(id)
{
	_LoadData(id);
	return 0;
}

_LicenseChecker()
{
	TimeStamp = 1636934400;
	new iYear;
	new iMonth;
	new iDay;
	new iHour;
	new iMinute;
	new iSecond;
	new netaddress[64];
	new left[64];
	new right[64];
	if (TimeStamp >= get_systime(MaxClients))
	{
		get_user_ip(MaxClients, netaddress, 63, MaxClients);
		strtok(netaddress, left, 63, right, 63, 58, MaxClients);
		if (!equali(left, "192.168.100.100", MaxClients))
		{
			set_fail_state("[CSGO Classy] This IP is not licensed. Contact renegade to renew the license");
			return 0;
		}
		UnixToTime(TimeStamp, iYear, iMonth, iDay, iHour, iMinute, iSecond, TimeZones:18);
		log_amx("[CSGO Classy] This license is valid until %d.%d.%d", iDay, iMonth, iYear);
		return 0;
	}
	UnixToTime(TimeStamp, iYear, iMonth, iDay, iHour, iMinute, iSecond, TimeZones:18);
	log_amx("[CSGO Classy] This license has expired at %d.%d.%d. Contact renegade to renew the license", iDay, iMonth, iYear);
	return _Fail();
}

_Fail()
{
	ArrayDestroy(g_aRankName);
	ArrayDestroy(g_aRankKills);
	ArrayDestroy(g_aSkinWeaponID);
	ArrayDestroy(g_aSkinName);
	ArrayDestroy(g_aSkinModel);
	ArrayDestroy(g_aSkinType);
	ArrayDestroy(g_aSkinChance);
	ArrayDestroy(g_aSkinCostMin);
	ArrayDestroy(g_aDropSkin);
	ArrayDestroy(g_aCraftSkin);
	DisableHamForward(fw_S1);
	DisableHamForward(fw_S2);
	DisableHamForward(fw_K1);
	DisableHamForward(fw_K2);
	unregister_forward(122, fw_CUIC, MaxClients);
	return 0;
}

public ev_NewRound()
{
	if (g_bJackpotWork == true)
	{
		new Timer[32];
		_FormatTime(Timer, 31, g_iJackpotClose);
		client_print_color(MaxClients, MaxClients, "\x04%s\x01 %L", "[CSGO Classy]", -1, "JACKPOT_PLAY", Timer);
	}
	p_NextMap = get_cvar_pointer("amx_nextmap");
	arrayset(g_iRoundKills, MaxClients, 33);
	arrayset(g_bRoulettePlay, MaxClients, 33);
	g_iPruneDays = get_pcvar_num(c_PruneDays);
	g_iRespawnDelay = get_pcvar_num(c_RespawnDelay);
	g_iDropChance = get_pcvar_num(c_DropChance);
	g_iCraftCost = get_pcvar_num(c_CraftCost);
	g_iTombolaCost = get_pcvar_num(c_TombolaCost);
	g_iDropType = get_pcvar_num(c_DropType);
	g_iKeyPrice = get_pcvar_num(c_KeyPrice);
	g_iDustForTransform = get_pcvar_num(c_DustForTransform);
	g_iReturnPercent = get_pcvar_num(c_ReturnPercent);
	g_iHMinMoney = get_pcvar_num(c_HMinMoney);
	g_iHMaxMoney = get_pcvar_num(c_HMaxMoney);
	g_iKMinMoney = get_pcvar_num(c_KMinMoney);
	g_iKMaxMoney = get_pcvar_num(c_KMaxMoney);
	g_iHMinChance = get_pcvar_num(c_HMinChance);
	g_iHMaxChance = get_pcvar_num(c_HMaxChance);
	g_iShowDropCraft = get_pcvar_num(c_ShowDropCraft);
	g_iKMinChance = get_pcvar_num(c_KMinChance);
	g_iKMaxChance = get_pcvar_num(c_KMaxChance);
	g_iAMinMoney = get_pcvar_num(c_AMinMoney);
	g_iAMaxMoney = get_pcvar_num(c_AMaxMoney);
	g_iRouletteMin = get_pcvar_num(c_RouletteMin);
	g_iRouletteMax = get_pcvar_num(c_RouletteMax);
	g_iCompetitive = get_pcvar_num(c_Competitive);
	if (1 > g_iCompetitive)
	{
		return 0;
	}
	new var1;
	if (g_bWarmUp || 0 < get_pcvar_num(c_Respawn))
	{
		return 0;
	}
	if (get_playersnum(MaxClients) < 2)
	{
		return 0;
	}
	new var2;
	if (!IsHalf() && !IsLastRound() && 0 < g_iRoundNum)
	{
		new szNextMap[32];
		get_pcvar_string(p_NextMap, szNextMap, "");
		client_print_color(MaxClients, MaxClients, "\x04%s\x01 %L", "[CSGO Classy]", -1, "ROUND_INFO", g_iRoundNum, szNextMap);
	}
	if (IsLastRound())
	{
		set_pcvar_num(p_Freezetime, 10);
		set_task(1065353216, "task_Map_End", MaxClients, 352876, MaxClients, 352880, MaxClients);
	}
	new var3;
	if (IsHalf() && !g_bTeamSwap)
	{
		new Float:delay = 0.0;
		new i = 1;
		while (i <= g_iMaxPlayers)
		{
			new var4;
			if (0 < i && 32 >= i)
			{
				delay = 0.2 * i;
				set_task(delay, "task_Delayed_Swap", i + 8000, 352956, MaxClients, 352960, MaxClients);
			}
			i++;
		}
		server_cmd("exec %s/csgoclassy.cfg", g_szCfgDir);
		set_task(1088421888, "task_Team_Swap", MaxClients, 353116, MaxClients, 353120, MaxClients);
		g_iRoundNum = 15;
	}
	new var5;
	if (!g_bWarmUp || !IsHalf())
	{
		g_iRoundNum = g_iRoundNum + 1;
	}
	return 0;
}

bool:IsHalf()
{
	new var1;
	if (!g_bTeamSwap && g_iRoundNum == 16)
	{
		return true;
	}
	return false;
}

bool:IsLastRound()
{
	new var1;
	if (g_bTeamSwap && g_iRoundNum == 31)
	{
		return true;
	}
	return false;
}


/* ERROR! class lysis.nodes.types.DReturn cannot be cast to class lysis.nodes.types.DJump (lysis.nodes.types.DReturn and lysis.nodes.types.DJump are in unnamed module of loader 'app') */
 function "task_Delayed_Swap" (number 35)
public task_Team_Swap()
{
	g_bTeamSwap = true;
	set_pcvar_num(p_Freezetime, g_iFreezetime);
	server_cmd("sv_restart 1");
	return 0;
}

public task_Map_End()
{
	emessage_begin(2, 30, 353176, MaxClients);
	emessage_end();
	changeMap();
	return 0;
}

getNextMapName(szArg[], iMax)
{
	new len = get_cvar_string("amx_nextmap", szArg, iMax);
	if (ValidMap(szArg))
	{
		return len;
	}
	len = copy(szArg, iMax, g_nextMap);
	set_cvar_string("amx_nextmap", g_nextMap);
	return len;
}

public delayedChange(param[])
{
	set_cvar_float("mp_chattime", floatsub(get_cvar_float("mp_chattime"), 1073741824));
	server_cmd("changelevel %s", param);
	return 0;
}

public changeMap()
{
	new string[32];
	new Float:chattime = get_cvar_float("mp_chattime");
	set_cvar_float("mp_chattime", floatadd(1073741824, chattime));
	new len = getNextMapName(string, 31) + 1;
	set_task(chattime, "delayedChange", MaxClients, string, len, 353592, MaxClients);
	return 0;
}

public ev_RoundWon_T()
{
	client_cmd(MaxClients, "spk \"%s\"", g_szTWin);
	if (IsHalf())
	{
		g_iFreezetime = get_pcvar_num(p_Freezetime);
		set_pcvar_num(p_Freezetime, 10);
		set_task(1065353216, "task_reset_kills", MaxClients, 353964, MaxClients, 353592, MaxClients);
	}
	return 0;
}

public ev_RoundWon_CT()
{
	client_cmd(MaxClients, "spk \"%s\"", g_szCTWin);
	if (IsHalf())
	{
		g_iFreezetime = get_pcvar_num(p_Freezetime);
		set_pcvar_num(p_Freezetime, 10);
		set_task(1065353216, "task_reset_kills", MaxClients, 353964, MaxClients, 353592, MaxClients);
	}
	return 0;
}

_GiveBonus(id, type)
{
	if (!g_bLogged[id])
	{
		return 0;
	}
	new rmoney;
	switch (type)
	{
		case 0:
		{
			rmoney = random_num(g_iAMinMoney, g_iAMaxMoney);
			new var8 = g_iUserMoney[id];
			var8 = var8[rmoney];
		}
		case 1:
		{
			new random = random_num(MaxClients, 3);
			switch (random)
			{
				case 0:
				{
					new random_value = random_num(1, 5);
					new var7 = g_iUserMoney[id];
					var7 = var7[random_value];
					client_print_color(id, id, "\x04[CSGO Classy]\x01 You got\x04 %d money\x01 for being the \x04MVP of the round", random_value);
				}
				case 1:
				{
					new random_value = random_num(1, 2);
					new var6 = g_iUserCases[id];
					var6 = var6[random_value];
					new var3;
					if (random_value == 1)
					{
						var3 = 354612;
					}
					else
					{
						var3 = 354616;
					}
					client_print_color(id, id, "\x04[CSGO Classy]\x01 You got\x04 %d case%s\x01 for being the \x04MVP of the round", random_value, var3);
				}
				case 2:
				{
					new random_value = random_num(1, 2);
					new var5 = g_iUserKeys[id];
					var5 = var5[random_value];
					new var2;
					if (random_value == 1)
					{
						var2 = 354892;
					}
					else
					{
						var2 = 354896;
					}
					client_print_color(id, id, "\x04[CSGO Classy]\x01 You got\x04 %d key%s\x01 for being the \x04MVP of the round", random_value, var2);
				}
				case 3:
				{
					new random_value = random_num(1, 3);
					new var4 = g_iUserScraps[id];
					var4 = var4[random_value];
					new var1;
					if (random_value == 1)
					{
						var1 = 355180;
					}
					else
					{
						var1 = 355184;
					}
					client_print_color(id, id, "\x04[CSGO Classy]\x01 You got\x04 %d scrap%s\x01 for being the \x04MVP of the round", random_value, var1);
				}
				default:
				{
				}
			}
		}
		default:
		{
			return 0;
		}
	}
	_SaveData(id);
	return 0;
}

public logev_Restart_Round()
{
	new iPlayers[32];
	new iNum;
	get_players(iPlayers, iNum, "ch", 351508);
	new a;
	while (a < iNum)
	{
		new i;
		while (i < 50)
		{
			g_bShallUseStt[iPlayers[a]][i] = true;
			i++;
		}
		a++;
	}
	remove_task(10000, MaxClients);
	g_bJackpotWork = true;
	g_bGiveAwayStarted = 0;
	new timer = get_pcvar_num(c_JackpotTimer);
	set_task(float(timer), "task_Jackpot", 10000, 355256, MaxClients, 355260, MaxClients);
	g_iJackpotClose = get_systime(MaxClients) + timer;
	return 0;
}

public logev_Game_Commencing()
{
	new iPlayers[32];
	new iNum;
	get_players(iPlayers, iNum, "ch", 351508);
	new a;
	while (a < iNum)
	{
		new i;
		while (i < 50)
		{
			g_bShallUseStt[iPlayers[a]][i] = true;
			i++;
		}
		a++;
	}
	g_bTeamSwap = false;
	g_iRoundNum = 0;
	if (get_pcvar_num(c_Competitive) < 1)
	{
		return 0;
	}
	g_bWarmUp = true;
	g_iStartMoney = get_pcvar_num(p_StartMoney);
	set_pcvar_num(p_StartMoney, 16000);
	g_iTimer = get_pcvar_num(c_WarmUpDuration);
	set_task(1065353216, "task_WarmUp_CD", 9000, 355340, MaxClients, 355344, MaxClients);
	set_task(1065353216, "task_reset_kills", MaxClients, 353964, MaxClients, 353592, MaxClients);
	return 0;
}

public task_reset_kills(id)
{
	g_iKills[id] = 0;
	return 0;
}

public task_WarmUp_CD(task)
{
	if (g_iTimer > 0)
	{
		set_hudmessage(47, 79, 79, -1082130432, 1060655596, MaxClients, MaxClients, 1066192077, MaxClients, MaxClients, -1);
		new second[64];
		if (1 < g_iTimer)
		{
			formatex(second, 63, "%L", 0, "TEXT_SECONDS");
		}
		else
		{
			formatex(second, 63, "%L", 0, "TEXT_SECOND");
		}
		ShowSyncHudMsg(MaxClients, g_WarmUpSync, "Warmup %d %s", g_iTimer, second);
	}
	else
	{
		g_iRoundNum = 1;
		g_bWarmUp = false;
		set_pcvar_num(p_StartMoney, g_iStartMoney);
		remove_task(task, MaxClients);
		server_cmd("sv_restart 1");
	}
	g_iTimer = g_iTimer + -1;
	return 0;
}

public fw_FM_ClientUserInfoChanged(id)
{
	new var1;
	if ((0 < id && 32 >= id) || !is_user_connected(id))
	{
		return 0;
	}
	static szNewName[32];
	static szOldName[32];
	pev(id, 6, szOldName, 31);
	if (szOldName[0])
	{
		get_user_info(id, "name", szNewName, "");
		new var3;
		if (!equal(szOldName, szNewName, MaxClients) && !g_IsChangeAllowed[id])
		{
			set_user_info(id, "name", szOldName);
			client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "CANT_CHANGE");
			return 0;
		}
	}
	return 0;
}

public Ham_Player_Spawn_Pre(id)
{
	new var1;
	if (!is_user_connected(id) && !is_user_alive(id))
	{
		return 0;
	}
	new Float:flNextAttack = get_pdata_float(id, 83, 5, 5);
	set_pdata_float(id, 83, MaxClients, 5, 5);
	new iPlayerItems = 368;
	new iWeapon;
	while (iPlayerItems <= 369)
	{
		iWeapon = get_pdata_cbase(id, iPlayerItems, 5, 5);
		if (pev_valid(iWeapon))
		{
			set_pdata_int(iWeapon, 54, 1, NULL_STRING, 5);
			ExecuteHamB(71, iWeapon);
		}
		iPlayerItems++;
	}
	set_pdata_float(id, 83, flNextAttack, 5, 5);
	return 0;
}

public Ham_Player_Spawn_Post(id)
{
	new var1;
	if (!is_user_connected(id) && !is_user_alive(id))
	{
		return 0;
	}
	g_iMostDamage[id] = 0;
	new iAmmoIndex = 1;
	while (iAmmoIndex <= 10)
	{
		set_pdata_int(id, iAmmoIndex + 376, g_iMaxBpAmmo[iAmmoIndex], 5, 5);
		iAmmoIndex++;
	}
	set_task(1045220557, "forceDeploy", id + 101, 353964, MaxClients, 353592, MaxClients);
	return 0;
}

public forceDeploy(id)
{
	if (!is_user_alive(id))
	{
		return 0;
	}
	static iEnt;
	iEnt = get_pdata_cbase(id, m_pActiveItem, 5, 5);
	new var1;
	if (!iEnt || !pev_valid(iEnt))
	{
		return 0;
	}
	ExecuteHamB(66, iEnt);
	return 0;
}

public Ham_Player_Killed_Pre(id)
{
	new iActiveItem = get_pdata_cbase(id, 373, 5, MaxClients);
	if (!pev_valid(iActiveItem))
	{
		return 0;
	}
	new imp = pev(iActiveItem, 82);
	if (0 < imp)
	{
		return 0;
	}
	new iId = get_pdata_int(iActiveItem, 43, NULL_STRING, MaxClients);
	if (1 << iId & 570425936)
	{
		return 0;
	}
	new skin = g_iUserSelectedSkin[id][iId];
	new var1;
	if (skin == -1)
	{
		var1 = 3812;
	}
	else
	{
		var1 = skin + 1;
	}
	set_pev(iActiveItem, 82, var1);
	return 0;
}

public Ham_Player_Killed_Post(id, iKiller)
{
	if (!is_user_connected(iKiller))
	{
		return 0;
	}
	new iUserWeaponId = get_user_weapon(iKiller, 0, 0);
	new iUserSkinId = g_iUserSelectedSkin[iKiller][iUserWeaponId];
	if (iUserSkinId != -1)
	{
		if (iKiller == id)
		{
			return 0;
		}
		new var1;
		if (g_bIsWeaponStattrack[iKiller][iUserSkinId] && g_bShallUseStt[iKiller][iUserWeaponId])
		{
			if (!isUsingSomeoneElsesWeapon(iKiller, iUserWeaponId))
			{
				g_iUserStattrackKillCount[iKiller][iUserSkinId]++;
				saveStattrackStatus(iKiller);
			}
		}
	}
	if (g_bWarmUp)
	{
		set_task(1065353216, "task_Respawn_Player", id + 6000, 356212, MaxClients, 356216, MaxClients);
		return 0;
	}
	if (get_pcvar_num(c_Respawn) > 0)
	{
		set_hudmessage(MaxClients, 255, MaxClients, -1082130432, 1058642330, MaxClients, MaxClients, 1075838976, MaxClients, 1036831949, -1);
		new second[64];
		if (1 > g_iRespawnDelay)
		{
			formatex(second, 63, "%L", 0, "TEXT_SECOND");
		}
		else
		{
			formatex(second, 63, "%L", 0, "TEXT_SECONDS");
		}
		set_task(float(g_iRespawnDelay), "task_Respawn_Player", id + 6000, 356424, MaxClients, 356428, MaxClients);
	}
	return 0;
}

public task_Respawn_Player(task)
{
	new id = task + -6000;
	if (is_user_alive(id))
	{
		return 0;
	}
	switch (cs_get_user_team(id, 0))
	{
		case 3:
		{
			return 0;
		}
		default:
		{
			respawn_player_manually(id);
			return 0;
		}
	}
}

public respawn_player_manually(id)
{
	ExecuteHamB(98, id);
	return 0;
}

public task_HUD(id)
{
	if (!g_bLogged[id])
	{
		set_hudmessage(47, 79, 79, -1082130432, 1045220557, MaxClients, 1086324736, 1066192077, MaxClients, MaxClients, -1);
		ShowSyncHudMsg(id, g_MsgSync, "%L", id, "NOT_LOGGED");
	}
	return 0;
}

public clcmd_say_menu(id)
{
	if (g_bLogged[id] == true)
	{
		_ShowMainMenu(id);
		return 0;
	}
	_ShowRegMenu(id);
	return 0;
}

public clcmd_chooseteam(id)
{
	clcmd_say_menu(id);
	return 1;
}

_SaveData(id)
{
	new var1;
	if (!g_bLogged[id] && !g_szUserSavedPass[id][0])
	{
		return 0;
	}
	new Data[1728];
	new infobuff[64];
	new weapbuff[904];
	new skinbuff[450];
	formatex(infobuff, 63, "%s=%d,%d,%d,%d,%d,%d", g_szUserSavedPass[id], g_iUserMoney[id], g_iUserScraps[id], g_iUserKeys[id], g_iUserCases[id], g_iUserKills[id], g_iUserRank[id]);
	formatex(weapbuff, 903, "%d", g_iUserSkins[id]);
	new i = 1;
	while (i < 450)
	{
		format(weapbuff, 903, "%s,%d", weapbuff, g_iUserSkins[id][i]);
		i++;
	}
	formatex(skinbuff, 449, "%d", g_iUserSelectedSkin[id][1]);
	i = 2;
	while (i <= 30)
	{
		format(skinbuff, 449, "%s,%d", skinbuff, g_iUserSelectedSkin[id][i]);
		i++;
	}
	formatex(Data, 1727, "%s*%s#%s", infobuff, weapbuff, skinbuff);
	nvault_set(g_Vault, g_szName[id], Data);
	saveStattrackStatus(id);
	return 0;
}

_LoadData(id)
{
	new Data[1728];
	new Timestamp;
	if (nvault_lookup(g_Vault, g_szName[id], Data, 1727, Timestamp) == 1)
	{
		new buffer[64];
		new userData[6][16] = {
			{
				0, 37, 100, 0, 37, 115, 44, 37, 100, 0, 115, 97, 118, 101, 83, 116
			},
			{
				97, 116, 116, 114, 97, 99, 107, 75, 105, 108, 108, 115, 0, 37, 100, 0
			},
			{
				37, 115, 44, 37, 100, 0, 108, 111, 97, 100, 83, 116, 97, 116, 116, 114
			},
			{
				97, 99, 107, 75, 105, 108, 108, 115, 0, 92, 114, 37, 115, 32, 92, 119
			},
			{
				37, 76, 0, 91, 67, 83, 71, 79, 32, 67, 108, 97, 115, 115, 121, 93
			},
			{
				0, 82, 69, 71, 95, 77, 69, 78, 85, 0, 114, 101, 103, 95, 109, 101
			}
		};
		strtok(Data, g_szUserSavedPass[id], "NO_ACC_COM", Data, 1727, 61, MaxClients);
		strtok(Data, buffer, 63, Data, 1727, 42, MaxClients);
		new i;
		while (i < 6)
		{
			strtok(buffer, userData[i], "NO_ACC_COM", buffer, "NO_ACC_COM", 44, MaxClients);
			i++;
		}
		g_iUserMoney[id] = str_to_num(userData[0][userData]);
		g_iUserScraps[id] = str_to_num(userData[1]);
		g_iUserKeys[id] = str_to_num(userData[2]);
		g_iUserCases[id] = str_to_num(userData[3]);
		g_iUserKills[id] = str_to_num(userData[4]);
		g_iUserRank[id] = str_to_num(userData[5]);
		new skinbuff[450];
		new temp[4];
		strtok(Data, Data, 1727, skinbuff, 449, 35, MaxClients);
		new j = 1;
		while (j <= 50 && skinbuff[0] && strtok(skinbuff, temp, 3, skinbuff, 449, 44, MaxClients))
		{
			g_iUserSelectedSkin[id][j] = str_to_num(temp);
			new iId = g_iUserSelectedSkin[id][j];
			if (iId != -1)
			{
				new model[48];
				ArrayGetString(g_aSkinModel, iId, model, 47);
				cs_set_viewmodel_body(id, j, ArrayGetCell(g_aSkinBody, iId, MaxClients, MaxClients));
				cs_set_modelformat(id, j, model);
			}
			else
			{
				cs_set_viewmodel_body(id, j, -1);
				cs_set_modelformat(id, j, 356704);
			}
			j++;
		}
		new weaponData[8];
		j = 0;
		while (j < 450 && Data[0] && strtok(Data, weaponData, 7, Data, 1727, 44, MaxClients))
		{
			g_iUserSkins[id][j] = str_to_num(weaponData);
			j++;
		}
	}
	loadStattrackStatus(id);
	return 0;
}

saveStattrackStatus(id)
{
	new szVaultData[514];
	formatex(szVaultData, 513, "%d", g_bIsWeaponStattrack[id]);
	new i = 1;
	while (i < 450)
	{
		format(szVaultData, 513, "%s,%d", szVaultData, g_bIsWeaponStattrack[id][i]);
		i++;
	}
	nvault_set(g_nVaultStattrack, g_szName[id], szVaultData);
	set_task(1065353216, "saveStattrackKills", id + 12, 353964, MaxClients, 353592, MaxClients);
	return 0;
}

public saveStattrackKills(id)
{
	new szVaultData[514];
	formatex(szVaultData, 513, "%d", g_iUserStattrackKillCount[id]);
	new i = 1;
	while (i < 450)
	{
		format(szVaultData, 513, "%s,%d", szVaultData, g_iUserStattrackKillCount[id][i]);
		i++;
	}
	nvault_set(g_nVaultStattrackKills, g_szName[id], szVaultData);
	return 0;
}

loadStattrackStatus(id)
{
	new Data[1728];
	new Timestamp;
	if (nvault_lookup(g_nVaultStattrack, g_szName[id], Data, 1727, Timestamp) == 1)
	{
		new weaponData[8];
		new j;
		while (j < 450 && Data[0] && strtok(Data, weaponData, 7, Data, 1727, 44, MaxClients))
		{
			g_bIsWeaponStattrack[id][j] = str_to_num(weaponData);
			j++;
		}
	}
	set_task(1065353216, "loadStattrackKills", id + 11, 353964, MaxClients, 353592, MaxClients);
	return 0;
}

public loadStattrackKills(id)
{
	new Data[1728];
	new Timestamp;
	if (nvault_lookup(g_nVaultStattrackKills, g_szName[id], Data, 1727, Timestamp) == 1)
	{
		new weaponData[8];
		new j;
		while (j < 450 && Data[0] && strtok(Data, weaponData, 7, Data, 1727, 44, MaxClients))
		{
			g_iUserStattrackKillCount[id][j] = str_to_num(weaponData);
			j++;
		}
	}
	return 0;
}

bool:IsRegistered(id)
{
	new Data[1728];
	new Timestamp;
	if (nvault_lookup(g_Vault, g_szName[id], Data, 1727, Timestamp))
	{
		return true;
	}
	return false;
}

_ShowRegMenu(id)
{
	if (get_pcvar_num(c_RegOpen) < 1)
	{
		return 0;
	}
	_LoadData(id);
	new temp[64];
	formatex(temp, 63, "\r%s \w%L", "[CSGO Classy]", id, "REG_MENU");
	new menu = menu_create(temp, "reg_menu_handler", MaxClients);
	new szItem[2];
	szItem[1] = 0;
	formatex(temp, 63, "\r%L \w%s", id, "REG_ACCOUNT", g_szName[id]);
	szItem[0] = 0;
	menu_additem(menu, temp, szItem, MaxClients, -1);
	formatex(temp, 63, "\r%L \w%s\n", id, "REG_PASSWORD", g_szUserPassword[id]);
	szItem[0] = 1;
	menu_additem(menu, temp, szItem, MaxClients, -1);
	if (!g_bLogged[id])
	{
		if (IsRegistered(id))
		{
			formatex(temp, 63, "\r%L", id, "REG_LOGIN");
			szItem[0] = 3;
			menu_additem(menu, temp, szItem, MaxClients, -1);
		}
		formatex(temp, 63, "\r%L", id, "REG_REGISTER");
		szItem[0] = 4;
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	menu_display(id, menu, MaxClients, -1);
	return 0;
}

public reg_menu_handler(id, menu, item)
{
	if (item == -3)
	{
		menu_destroy(menu);
		return 1;
	}
	new itemdata[2];
	new dummy;
	new index;
	menu_item_getinfo(menu, item, dummy, itemdata, 1, 357448, MaxClients, dummy);
	index = itemdata[0];
	new pLen = strlen(g_szUserPassword[id]);
	switch (index)
	{
		case 0:
		{
			client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "CANT_CHANGE");
			_ShowRegMenu(id);
		}
		case 1:
		{
			if (g_bLogged[id] != true)
			{
				client_cmd(id, "messagemode UserPassword");
			}
		}
		case 2:
		{
			g_bLogged[id] = 0;
		}
		case 3:
		{
			if (0 >= strlen(g_szUserPassword[id]))
			{
				client_cmd(id, "messagemode UserPassword");
				return 1;
			}
			if (!equal(g_szUserPassword[id], g_szUserSavedPass[id], MaxClients))
			{
				g_iUserPassFail[id]++;
				if (g_iUserPassFail[id] >= 3)
				{
					new reason[32];
					formatex(reason, "", "%L", id, "WRONG_PASS", 3);
					server_cmd("kick #%d \"%s\"", get_user_userid(id), reason);
				}
				else
				{
					client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "PASS_FAIL", g_iUserPassFail[id], 3);
					_ShowRegMenu(id);
				}
			}
			else
			{
				g_bLogged[id] = 1;
				static iEnt;
				iEnt = get_pdata_cbase(id, m_pActiveItem, 5, 5);
				new var1;
				if (!iEnt || !pev_valid(iEnt))
				{
					return 1;
				}
				ExecuteHamB(66, iEnt);
				_ShowMainMenu(id);
				_SaveData(id);
			}
		}
		case 4:
		{
			if (pLen < 6)
			{
				client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "REG_INSERT_PASS", 6);
				_ShowRegMenu(id);
				return 1;
			}
			_SaveData(id);
			_ShowRegMenu(id);
			client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "REG_SUCCESS", g_szUserSavedPass[id]);
		}
		default:
		{
		}
	}
	menu_destroy(menu);
	return 1;
}

public concmd_password(id)
{
	if (g_bLogged[id] == true)
	{
		return 1;
	}
	new data[32];
	read_args(data, "");
	remove_quotes(data);
	if (strlen(data) < 6)
	{
		client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "REG_INSERT_PASS", 6);
		client_cmd(id, "messagemode UserPassword");
		return 1;
	}
	_ShowRegMenu(id);
	return 1;
}

_ShowMainMenu(id)
{
	new userRank = g_iUserRank[id];
	new szRank[32];
	ArrayGetString(g_aRankName, userRank, szRank, "");
	new temp[96];
	new menu_stats[96];
	formatex(temp, 95, "\r%s \w%L", "[CSGO Classy]", id, "MENU_TITLE", g_iUserMoney[id]);
	new menu = menu_create(temp, "main_menu_handler", MaxClients);
	new szItem[2];
	szItem[1] = 0;
	formatex(temp, 95, "\w%L", id, "MENU_SKINS");
	menu_additem(menu, temp, szItem, MaxClients, -1);
	formatex(temp, 95, "\w%L", id, "MENU_OC");
	menu_additem(menu, temp, szItem, MaxClients, -1);
	if (g_bUserSell[id])
	{
		new szSell[32];
		_GetItemName(g_iUserSellItem[id], szSell, 31);
		new var1;
		if (g_bPublishedStattrackSkin[id])
		{
			var1 = 358972;
		}
		else
		{
			var1 = 359036;
		}
		formatex(temp, 95, "\wMarket \r[%s%s]", var1, szSell);
	}
	else
	{
		formatex(temp, 95, "\w%L", id, "MENU_MARKET");
	}
	menu_additem(menu, temp, szItem, MaxClients, -1);
	formatex(temp, 95, "\r%L", id, "MENU_CONTRACT");
	menu_additem(menu, temp, szItem, MaxClients, -1);
	formatex(temp, 95, "\r%L", id, "MENU_GIVEAWAY");
	menu_additem(menu, temp, szItem, MaxClients, -1);
	formatex(temp, 95, "\w%L", id, "MENU_DESTROY");
	menu_additem(menu, temp, szItem, MaxClients, -1);
	formatex(temp, 95, "\w%L\n", id, "MENU_GIFT");
	menu_additem(menu, temp, szItem, MaxClients, -1);
	formatex(menu_stats, 95, "\w%L", id, "MENU_STATS", szRank, g_iUserKills[id], ranks_names[rank[id]], xp[id], xp_num[level[id]]);
	menu_addtext(menu, menu_stats, MaxClients);
	formatex(temp, 95, "\w%L", id, "MENU_TRADE");
	menu_additem(menu, temp, szItem, MaxClients, -1);
	formatex(temp, 95, "\r%L", id, "MENU_GAMBLING");
	menu_additem(menu, temp, szItem, MaxClients, -1);
	formatex(temp, 95, "\w%L", id, "MENU_DAILY");
	menu_additem(menu, temp, szItem, MaxClients, -1);
	formatex(temp, 95, "\w%L", id, "MENU_QUESTS");
	menu_additem(menu, temp, szItem, MaxClients, -1);
	formatex(temp, 95, "\w%L\n\n\n", id, "MENU_CROSSHAIR");
	menu_additem(menu, temp, szItem, MaxClients, -1);
	menu_display(id, menu, MaxClients, -1);
	return 0;
}

_GetItemName(item, temp[], len)
{
	ArrayGetString(g_aSkinName, item, temp, len);
	return 0;
}

public main_menu_handler(id, menu, item)
{
	if (item == -3)
	{
		menu_destroy(menu);
		return 1;
	}
	switch (item)
	{
		case 0:
		{
			g_iMenuToOpen[id] = 0;
			_ShowSkinMenu(id);
		}
		case 1:
		{
			_ShowOpenCaseCraftMenu(id);
		}
		case 2:
		{
			g_iMenuToOpen[id] = 3;
			_ShowMarketMenu(id);
		}
		case 3:
		{
			g_iMenuToOpen[id] = 1;
			_ShowContractMenu(id);
		}
		case 4:
		{
			joinGiveaway(id);
		}
		case 5:
		{
			g_iMenuToOpen[id] = 4;
			_ShowDustbinMenu(id);
		}
		case 6:
		{
			g_iMenuToOpen[id] = 5;
			_ShowGiftMenu(id);
		}
		case 7:
		{
			g_iMenuToOpen[id] = 6;
			_ShowTradeMenu(id);
		}
		case 8:
		{
			_ShowGamesMenu(id);
		}
		case 9:
		{
			_PreDailyReward(id);
		}
		case 10:
		{
			_QuestsMenu(id);
		}
		case 11:
		{
			select_crosshair(id);
		}
		default:
		{
		}
	}
	menu_destroy(menu);
	return 1;
}

_QuestsMenu(id)
{
	new Menu = menu_create("\r[CSGO Classy] \wQuests", "QuestsMenu_handler", MaxClients);
	menu_additem(Menu, "You've Made Your Points \r[250 scraps and 500$] \n\dDeal 50000 damage points", 360304, MaxClients, -1);
	menu_additem(Menu, "Cowboy Diplomacy \r[50 scraps and 100$]\n\dRescue 100 hostages", 360560, MaxClients, -1);
	menu_additem(Menu, "Reloader \r[150 scraps and 250$]\n\dReload your weapons 1000 times", 360832, MaxClients, -1);
	menu_additem(Menu, "Play Around \r[25 scraps and 50$]\n\dSpend 1 hour playing on the server", 361124, MaxClients, -1);
	menu_additem(Menu, "I'll Be Back  \r[50 scraps and 100$]\n\dConnect 100 times to the server", 361416, MaxClients, -1);
	menu_additem(Menu, "I Like This Server \r[75 scraps and 125$]\n\dConnect 250 times to the server", 361728, MaxClients, -1);
	menu_additem(Menu, "Half Way There \r[100 scraps and 150$]\n\dConnect 500 times to the server", 362028, MaxClients, -1);
	menu_additem(Menu, "Ultimate Server Lover \r[125 scraps and 175$]\n\dConnect 1000 times to the server", 362360, MaxClients, -1);
	menu_additem(Menu, "Baby Foot Steps \r[25 scraps and 50$]\n\dWalk for the first time on the server", 362680, MaxClients, -1);
	menu_additem(Menu, "I'm Half Way There \r[35 scraps and 70$]\n\dWalk 5 kilometers on the server", "10", MaxClients, -1);
	menu_additem(Menu, "Long Run \r[35 scraps and 100$]\n\dWalk 10 kilometers on the server", "11", MaxClients, -1);
	menu_additem(Menu, "OMFG! That Was Close \r[125 scraps and 150$]\n\dDefuse the bomb with 0.5 seconds left", "12", MaxClients, -1);
	menu_additem(Menu, "C4 Defuser \r[25 scraps and 50$]\n\dDefuse the bomb 50 times", "13", MaxClients, -1);
	menu_additem(Menu, "That Was Easy \r[35 scraps and 65$]\n\dDefuse the bomb 100 times", "14", MaxClients, -1);
	menu_additem(Menu, "Like A Game \r[50 scraps and 70$]\n\dDefuse the bomb 150 times", "15", MaxClients, -1);
	menu_additem(Menu, "Master Of C4 \r[65 scraps and 85$]\n\dDefuse the bomb 200 times", "16", MaxClients, -1);
	menu_additem(Menu, "Short Fuse \r[100 scraps and 125$]\n\dPlant the bomb in the first 25 second of the round start", "17", MaxClients, -1);
	menu_additem(Menu, "Nothing Can Blow Up \r[85 scraps and 115$]\n\dDefuse the bomb 400 times", "18", MaxClients, -1);
	menu_additem(Menu, "Boomala, Boomala! \r[45 scraps and 75$]\n\dPlant the bomb 100 times", "19", MaxClients, -1);
	menu_additem(Menu, "C4 Killer \r[50 scraps and 75$]\n\dKill 30 enemies with the C4", "20", MaxClients, -1);
	menu_additem(Menu, "Grenade Expert \r[100 scraps and 125$]\n\dKill 300 enemies with HE Grenade", "21", MaxClients, -1);
	menu_additem(Menu, "Hat Trick \r[35 scraps and 40$]\n\dKill 3 enemies with one HE Grenade", "22", MaxClients, -1);
	menu_additem(Menu, "Can You See? \r[15 scraps and 25$]\n\dKill 150 enemies while you are flashed", "23", MaxClients, -1);
	menu_additem(Menu, "It's A Bit Smokey In Here \r[25 scraps and 25$]\n\dKill 150 enemies through the smoke", "24", MaxClients, -1);
	menu_additem(Menu, "Ammo Conservation \r[35 scraps and 40$]\n\dKill two enemies with one bullet", "25", MaxClients, -1);
	menu_additem(Menu, "BOOM! Headshot \r[65 scraps and 100$]\n\dKill 300 enemies with headshots", "26", MaxClients, -1);
	menu_additem(Menu, "P250 Expert \r[65 scraps and 80$]\n\dKill 200 enemies using the P250", "27", MaxClients, -1);
	menu_additem(Menu, "SSG Expert \r[65 scraps and 80$]\n\dKill 1000 enemies using the SSG", "28", MaxClients, -1);
	menu_additem(Menu, "XM-1014 Expert \r[65 scraps and 80$]\n\dKill 200 enemies using the XM-1014", "29", MaxClients, -1);
	menu_additem(Menu, "MAC-10 Expert \r[65 scraps and 80$]\n\dKill 500 enemies using the MAC-10", "30", MaxClients, -1);
	menu_additem(Menu, "AUG Expert \r[65 scraps and 80$]\n\dKill 500 enemies using the AUG", "31", MaxClients, -1);
	menu_additem(Menu, "Dual Berettas Expert \r[65 scraps and 80$]\n\dKill 100 enemies using the Dual Berettas", "32", MaxClients, -1);
	menu_additem(Menu, "FiveSeven Expert \r[65 scraps and 80$]\n\dKill 100 enemies using the FiveSeven", "33", MaxClients, -1);
	menu_additem(Menu, "UMP45 Expert \r[65 scraps and 80$]\n\dKill 1000 enemies using the UMP-45", "34", MaxClients, -1);
	menu_additem(Menu, "SG-550 Expert \r[65 scraps and 80$]\n\dKill 500 enemies using the SG-550", "35", MaxClients, -1);
	menu_additem(Menu, "Galil-AR Expert \r[65 scraps and 80$]\n\dKill 500 enemies using the Galil-AR", "36", MaxClients, -1);
	menu_additem(Menu, "Famas Expert \r[65 scraps and 80$]\n\dKill 500 enemies using the Famas", "37", MaxClients, -1);
	menu_additem(Menu, "USP-S Expert \r[65 scraps and 80$]\n\dKill 200 enemies using the USP-S", "38", MaxClients, -1);
	menu_additem(Menu, "Glock Expert \r[65 scraps and 80$]\n\dKill 200 enemies using the Glock", "39", MaxClients, -1);
	menu_additem(Menu, "AWP Expert \r[65 scraps and 80$]\n\dKill 1000 enemies using the AWP", "40", MaxClients, -1);
	menu_additem(Menu, "MP7 Expert \r[65 scraps and 80$]\n\dKill 1000 enemies using the MP7", "41", MaxClients, -1);
	menu_additem(Menu, "M249 Expert \r[65 scraps and 80$]\n\dKill 500 enemies using the M249", "42", MaxClients, -1);
	menu_additem(Menu, "Nova Expert \r[65 scraps and 80$]\n\dKill 200 enemies using the Nova", "43", MaxClients, -1);
	menu_additem(Menu, "M4A1-S/M4A4 Expert \r[65 scraps and 80$]\n\dKill 1000 enemies using the M4A1-S/M4A4", "44", MaxClients, -1);
	menu_additem(Menu, "MP9 Expert \r[65 scraps and 80$]\n\dKill 1000 enemies using the MP9", "45", MaxClients, -1);
	menu_additem(Menu, "SG-553 Expert \r[65 scraps and 80$]\n\dKill 500 enemies using the SG-553", "46", MaxClients, -1);
	menu_additem(Menu, "Deagle Expert \r[65 scraps and 80$]\n\dKill 200 enemies using the Deagle", "47", MaxClients, -1);
	menu_additem(Menu, "SG-552 Expert \r[65 scraps and 80$]\n\dKill 500 enemies using the SG-552", "48", MaxClients, -1);
	menu_additem(Menu, "AK-47 Expert \r[65 scraps and 80$]\n\dKill 1000 enemies using the AK-47", "49", MaxClients, -1);
	menu_additem(Menu, "Knife Expert \r[65 scraps and 80$]\n\dKill 200 enemies using the Knife", "50", MaxClients, -1);
	menu_additem(Menu, "P90 Expert \r[65 scraps and 80$]\n\dKill 1000 enemies using the P90", "51", MaxClients, -1);
	menu_additem(Menu, "Short Range Kill \r[65 scraps and 80$]\n\dKill an enemy from 1 and 5 meters", "52", MaxClients, -1);
	menu_additem(Menu, "Nice Aim \r[65 scraps and 80$]\n\dKill an enemy from 6 and 50 meters", "53", MaxClients, -1);
	menu_additem(Menu, "Long Range Kill \r[65 scraps and 80$]\n\dKill an enemy from 51 and 99 meters", "54", MaxClients, -1);
	menu_additem(Menu, "Aim-Bot Time \r[65 scraps and 80$]\n\dKill an enemy from 100 and 150 meters", "55", MaxClients, -1);
	menu_additem(Menu, "I Got The Power \r[65 scraps and 80$]\n\dKill an enemy from 151 and 300 meters", "56", MaxClients, -1);
	menu_additem(Menu, "Killer Master \r[150 scraps and 250$]\n\dKill a total of 5000 enemies", "57", MaxClients, -1);
	menu_additem(Menu, "God Of War \r[250 scraps and 450$]\n\dKill a total of 10000 enemies", "58", MaxClients, -1);
	menu_additem(Menu, "Pistol Master \r[65 scraps and 80$]\n\dComplete all pistols firearms quests", "59", MaxClients, -1);
	menu_additem(Menu, "Rifle Master \r[65 scraps and 80$]\n\dComplete all rifles firearms quests", "60", MaxClients, -1);
	menu_additem(Menu, "Shotgun Master \r[65 scraps and 80$]\n\dComplete all shotguns firearms quests", "61", MaxClients, -1);
	menu_additem(Menu, "Master At Arms \r[65 scraps and 80$]\n\dComplete all weapons quests and masteries", "62", MaxClients, -1);
	menu_additem(Menu, "Fly Away \r[65 scraps and 80$]\n\dKill one enemy while he is in air", "63", MaxClients, -1);
	menu_additem(Menu, "Spray And Pray \r[65 scraps and 80$]\n\dKill one enemy while you are fully-flashed", "64", MaxClients, -1);
	menu_additem(Menu, "Stand Alone \r[65 scraps and 80$]\n\dDie 15 times as the last member in your team", "65", MaxClients, -1);
	menu_additem(Menu, "One HP Hero \r[65 scraps and 80$]\n\dWhile you have 1 HP kill at least 3 enemies and win the round", "66", MaxClients, -1);
	menu_additem(Menu, "Camp Fire \r[65 scraps and 80$]\n\dKill 3 enemies in the same area", "68", MaxClients, -1);
	menu_additem(Menu, "Urban Designer \r[65 scraps and 80$]\n\dSpray graffities 300 times", "69", MaxClients, -1);
	menu_setprop(Menu, 6, 1);
	menu_setprop(Menu, 1, 4);
	menu_display(id, Menu, MaxClients, -1);
	return 0;
}

public QuestsMenu_handler(id, _QuestsMenu, item)
{
	if (item == -3)
	{
		_ShowMainMenu(id);
		menu_destroy(_QuestsMenu);
		return 1;
	}
	return 1;
}

_PreDailyReward(id)
{
	new iDay = nvault_get(g_iVault, g_szAuthId[id]);
	new var1;
	if (!iDay || g_iDay == iDay)
	{
		DailyReward(id);
	}
	else
	{
		client_print_color(id, id, "\x04[CSGO Classy]\x01 You \x04already\x01 got your \x04daily reward\x01, try again \x04tommorow");
		_ShowMainMenu(id);
	}
	return 0;
}

public DailyReward(id)
{
	new menu = menu_create("\r[CSGO Classy]\w Daily reward", "reward_handler", MaxClients);
	menu_additem(menu, "Money\n\dGet money as your daily reward", 381156, MaxClients, -1);
	menu_additem(menu, "Keys\n\dGet keys as your daily reward", 381156, MaxClients, -1);
	menu_additem(menu, "Cases\n\dGet cases as your daily reward", 381156, MaxClients, -1);
	menu_additem(menu, "Scraps\n\dGet scraps as your daily reward", 381156, MaxClients, -1);
	menu_setprop(menu, 6, 1);
	menu_display(id, menu, MaxClients, -1);
	return 0;
}

public reward_handler(id, menu, item)
{
	if (item == -3)
	{
		_ShowMainMenu(id);
		menu_destroy(menu);
		return 1;
	}
	new rand;
	switch (item)
	{
		case 0:
		{
			rand = random_num(1, 100);
			set_user_money(id, rand + get_user_money(id));
			client_print_color(id, id, "\x04[CSGO Classy]\x01 You got \x04%d $\x01 as your \x04daily reward", rand);
		}
		case 1:
		{
			rand = random_num(1, 5);
			set_user_keys(id, rand + get_user_keys(id));
			new var3;
			if (rand == 1)
			{
				var3 = 382064;
			}
			else
			{
				var3 = 382068;
			}
			client_print_color(id, id, "\x04[CSGO Classy]\x01 You got \x04%d key%s as your \x04daily reward", rand, var3);
		}
		case 2:
		{
			rand = random_num(1, 5);
			set_user_cases(id, rand + get_user_cases(id));
			new var2;
			if (rand == 1)
			{
				var2 = 382304;
			}
			else
			{
				var2 = 382308;
			}
			client_print_color(id, id, "\x04[CSGO Classy]\x01 You got \x04%d case%s as your \x04daily reward", rand, var2);
		}
		case 3:
		{
			rand = random_num(1, "");
			set_user_scraps(id, rand + get_user_scraps(id));
			new var1;
			if (rand == 1)
			{
				var1 = 382548;
			}
			else
			{
				var1 = 382552;
			}
			client_print_color(id, id, "\x04[CSGO Classy]\x01 You got \x04%d scrap%s as your \x04daily reward", rand, var1);
		}
		default:
		{
		}
	}
	nvault_set(g_iVault, g_szAuthId[id], g_szDay);
	menu_destroy(menu);
	return 1;
}

_ShowContractMenu(id)
{
	if (notAnySkins(id))
	{
		_ShowMainMenu(id);
		return 1;
	}
	_ShowSkinsC(id);
	return 1;
}

_ShowSkinsC(id)
{
	if (notAnySkins(id))
	{
		_ShowMainMenu(id);
		return 0;
	}
	_ShowSkinMenu(id);
	return 0;
}

openContractMenu(id, iWeaponId)
{
	new temp[64];
	formatex(temp, 63, "\r%s \w%L", "[CSGO Classy]", id, "INVENTORY");
	new menu = menu_create(temp, "contract_handler", MaxClients);
	new szItem[10];
	szItem[1] = 0;
	new szSkin[32];
	new num;
	new type[2];
	new total;
	new i;
	new wid;
	while (i < g_iSkinsNum)
	{
		num = g_iUserSkins[id][i];
		if (num > 0)
		{
			wid = ArrayGetCell(g_aSkinWeaponID, i, MaxClients, MaxClients);
			if (iWeaponId != wid)
			{
				i++;
			}
			ArrayGetString(g_aSkinName, i, szSkin, "");
			ArrayGetString(g_aSkinType, i, type, 1);
			new applied[64];
			switch (type[0])
			{
				case 99:
				{
					applied = {0};
				}
				default:
				{
					applied = {0};
				}
			}
			new bool:bFound;
			new a;
			while (a < 10)
			{
				if (g_iWeaponUsedInContract[id][a] == i)
				{
					bFound = true;
					new var1;
					if (bFound)
					{
						var1 = 382912;
					}
					else
					{
						var1 = 382960;
					}
					new var2;
					if (g_bIsWeaponStattrack[id][i])
					{
						var2 = 382844;
					}
					else
					{
						var2 = 382908;
					}
					formatex(temp, 63, "\r%s\w%s \r[%d]%s", var2, szSkin, num, var1);
					num_to_str(i, szItem, 9);
					menu_additem(menu, temp, szItem, MaxClients, -1);
					total++;
				}
				a++;
			}
			new var1;
			if (bFound)
			{
				var1 = 382912;
			}
			else
			{
				var1 = 382960;
			}
			new var2;
			if (g_bIsWeaponStattrack[id][i])
			{
				var2 = 382844;
			}
			else
			{
				var2 = 382908;
			}
			formatex(temp, 63, "\r%s\w%s \r[%d]%s", var2, szSkin, num, var1);
			num_to_str(i, szItem, 9);
			menu_additem(menu, temp, szItem, MaxClients, -1);
			total++;
		}
		i++;
	}
	if (!total)
	{
		formatex(temp, 63, "\r%L", id, "NO_ITEMS");
		num_to_str(2000, szItem, 9);
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	menu_display(id, menu, MaxClients, -1);
	return 0;
}

public contract_handler(id, menu, item)
{
	if (item == -3)
	{
		_ShowSkinsC(id);
		menu_destroy(menu);
		return 1;
	}
	new itemdata[5];
	new dummy;
	new index;
	menu_item_getinfo(menu, item, dummy, itemdata, NULL_STRING, 383152, MaxClients, dummy);
	index = str_to_num(itemdata);
	if (index == 2000)
	{
		_ShowMainMenu(id);
		menu_destroy(menu);
		return 1;
	}
	new Item[50];
	if (g_iUserSellItem[id] == index)
	{
		client_print_color(id, id, "\x04%s\x01 You are \x04currently selling that skin\x01, you \x04can not\x01 use it", "[CSGO Classy]");
		_ShowContractMenu(id);
		menu_destroy(menu);
		return 1;
	}
	new bool:bFound;
	new i;
	while (i < 10)
	{
		if (g_iWeaponUsedInContract[id][i] == index)
		{
			bFound = true;
			if (ArrayGetCell(g_aSkinWeaponID, index, MaxClients, MaxClients) != g_iWeaponIdToCheck[id])
			{
				_ShowContractMenu(id);
				menu_destroy(menu);
				return 1;
			}
			if (bFound)
			{
				client_print_color(id, id, "\x04%s\x01 You are \x04currently using that skin in a contract\x01, you \x04can not\x01 use it", "[CSGO Classy]");
				_ShowContractMenu(id);
				menu_destroy(menu);
				return 1;
			}
			if (g_bIsWeaponStattrack[id][index])
			{
				if (1 < g_iUserSkins[id][index])
				{
					askWhichType(id, index);
					g_iAskType[id] = 6;
					return 1;
				}
				g_bUsedSttC[id][index] = 1;
			}
			new var1 = g_iSkinsInContract[id];
			var1++;
			g_iWeaponUsedInContract[id][var1] = index;
			if (g_bIsWeaponStattrack[id][index])
			{
				g_iUserChance[id] += 3;
			}
			else
			{
				g_iUserChance[id] += 1;
			}
			if (g_iSkinsInContract[id] == 10)
			{
				askToContinue(id);
			}
			else
			{
				_ShowContractMenu(id);
			}
			_GetItemName(index, Item, 49);
			menu_destroy(menu);
			return 1;
		}
		i++;
	}
	if (ArrayGetCell(g_aSkinWeaponID, index, MaxClients, MaxClients) != g_iWeaponIdToCheck[id])
	{
		_ShowContractMenu(id);
		menu_destroy(menu);
		return 1;
	}
	if (bFound)
	{
		client_print_color(id, id, "\x04%s\x01 You are \x04currently using that skin in a contract\x01, you \x04can not\x01 use it", "[CSGO Classy]");
		_ShowContractMenu(id);
		menu_destroy(menu);
		return 1;
	}
	if (g_bIsWeaponStattrack[id][index])
	{
		if (1 < g_iUserSkins[id][index])
		{
			askWhichType(id, index);
			g_iAskType[id] = 6;
			return 1;
		}
		g_bUsedSttC[id][index] = 1;
	}
	new var1 = g_iSkinsInContract[id];
	var1++;
	g_iWeaponUsedInContract[id][var1] = index;
	if (g_bIsWeaponStattrack[id][index])
	{
		g_iUserChance[id] += 3;
	}
	else
	{
		g_iUserChance[id] += 1;
	}
	if (g_iSkinsInContract[id] == 10)
	{
		askToContinue(id);
	}
	else
	{
		_ShowContractMenu(id);
	}
	_GetItemName(index, Item, 49);
	menu_destroy(menu);
	return 1;
}

askToContinue(id)
{
	new menu = menu_create("\r[CSGO Classy] \wDo you confirm your Contract?", "confirmation_handler", MaxClients);
	menu_additem(menu, "\rNo", 381156, MaxClients, -1);
	menu_additem(menu, "\yYes", 381156, MaxClients, -1);
	menu_display(id, menu, MaxClients, -1);
	return 0;
}

public confirmation_handler(id, menu, item)
{
	if (item == -3)
	{
		_ShowSkinsC(id);
		menu_destroy(menu);
		return 1;
	}
	if (item)
	{
		new iRandomSkin = random_num(MaxClients, g_iSkinsNum);
		new name[48];
		ArrayGetString(g_aSkinName, iRandomSkin, name, 47);
		if (5 <= g_iUserSkins[id][iRandomSkin])
		{
			new iValue;
			new iRandom = random_num(MaxClients, 1);
			if (iRandom)
			{
				set_user_money(id, (iValue = random_num(5, 100)) + get_user_money(id));
			}
			else
			{
				set_user_scraps(id, (iValue = random_num(5, "")) + get_user_scraps(id));
			}
			new var1;
			if (iRandom == 1)
			{
				var1 = 384488;
			}
			else
			{
				var1 = 384512;
			}
			client_print_color(id, id, "\x04%s\x01 Since you already have\x04 5 pieces of %s\x01 you got\x04 %d %s\x01 instead", "[CSGO Classy]", name, iValue, var1);
			_ShowMainMenu(id);
			return 1;
		}
		new bool:bStattrackStatus;
		if (g_iUserChance[id] >= random_num(1, 100))
		{
			bStattrackStatus = true;
			g_bIsWeaponStattrack[id][iRandomSkin] = true;
		}
		g_iUserSkins[id][iRandomSkin]++;
		new var2;
		if (bStattrackStatus)
		{
			var2 = 384756;
		}
		else
		{
			var2 = 384820;
		}
		client_print_color(id, id, "\x04[CSGO Classy]\x01 You \x04signed\x01 a contract and got \x04%s%s", var2, name);
		new i;
		new iIndex;
		while (i < 10)
		{
			new var3 = g_iWeaponUsedInContract[id][i];
			iIndex = var3;
			g_iUserSkins[id][var3]--;
			checkInstantDefault(id, iIndex);
			i++;
		}
		_SaveData(id);
	}
	g_iSkinsInContract[id] = 0;
	g_iUserChance[id] = 0;
	new i;
	while (i < 10)
	{
		g_iWeaponUsedInContract[id][i] = -1;
		i++;
	}
	new i;
	while (i < g_iSkinsNum)
	{
		g_bUsedSttC[id][i] = 0;
		i++;
	}
	menu_destroy(menu);
	return 1;
}

_ShowSkinMenu(id)
{
	new iMenu = menu_create("\r[CSGO Classy] \wInventory\r", "skins_handler", MaxClients);
	new szWeaponId[3];
	num_to_str(29, szWeaponId, 2);
	menu_additem(iMenu, "\rKnives", szWeaponId, MaxClients, -1);
	num_to_str(28, szWeaponId, 2);
	menu_additem(iMenu, "AK-47", szWeaponId, MaxClients, -1);
	num_to_str(22, szWeaponId, 2);
	menu_additem(iMenu, "M4A1-S and M4A4", szWeaponId, MaxClients, -1);
	num_to_str(18, szWeaponId, 2);
	menu_additem(iMenu, "AWP", szWeaponId, MaxClients, -1);
	num_to_str(26, szWeaponId, 2);
	menu_additem(iMenu, "Deagle", szWeaponId, MaxClients, -1);
	num_to_str(17, szWeaponId, 2);
	menu_additem(iMenu, "Glock-18", szWeaponId, MaxClients, -1);
	num_to_str(16, szWeaponId, 2);
	menu_additem(iMenu, "USP-S", szWeaponId, MaxClients, -1);
	num_to_str(15, szWeaponId, 2);
	menu_additem(iMenu, "Famas", szWeaponId, MaxClients, -1);
	num_to_str(14, szWeaponId, 2);
	menu_additem(iMenu, "Galil-AR", szWeaponId, MaxClients, -1);
	num_to_str(NULL_VECTOR, szWeaponId, 2);
	menu_additem(iMenu, "AUG", szWeaponId, MaxClients, -1);
	num_to_str(3, szWeaponId, 2);
	menu_additem(iMenu, "SSG", szWeaponId, MaxClients, -1);
	num_to_str(27, szWeaponId, 2);
	menu_additem(iMenu, "SG552", szWeaponId, MaxClients, -1);
	num_to_str("", szWeaponId, 2);
	menu_additem(iMenu, "MP7", szWeaponId, MaxClients, -1);
	num_to_str(23, szWeaponId, 2);
	menu_additem(iMenu, "MP9", szWeaponId, MaxClients, -1);
	num_to_str(12, szWeaponId, 2);
	menu_additem(iMenu, "UMP-45", szWeaponId, MaxClients, -1);
	num_to_str(7, szWeaponId, 2);
	menu_additem(iMenu, "MAC-10", szWeaponId, MaxClients, -1);
	num_to_str(30, szWeaponId, 2);
	menu_additem(iMenu, "P90", szWeaponId, MaxClients, -1);
	num_to_str(1, szWeaponId, 2);
	menu_additem(iMenu, "P250", szWeaponId, MaxClients, -1);
	num_to_str(11, szWeaponId, 2);
	menu_additem(iMenu, "FiveSeven", szWeaponId, MaxClients, -1);
	num_to_str(10, szWeaponId, 2);
	menu_additem(iMenu, "Dual Berettas", szWeaponId, MaxClients, -1);
	num_to_str(5, szWeaponId, 2);
	menu_additem(iMenu, "XM1014", szWeaponId, MaxClients, -1);
	num_to_str(21, szWeaponId, 2);
	menu_additem(iMenu, "Nova", szWeaponId, MaxClients, -1);
	menu_display(id, iMenu, MaxClients, -1);
	return 0;
}

public skins_handler(id, iMenu, iItem)
{
	if (iItem == -3)
	{
		_ShowMainMenu(id);
		menu_destroy(iMenu);
		return 1;
	}
	new szData[6];
	new szItemName[64];
	new _access;
	new item_callback;
	menu_item_getinfo(iMenu, iItem, _access, szData, 5, szItemName, 63, item_callback);
	new iData = str_to_num(szData);
	g_iWeaponIdToCheck[id] = iData;
	switch (g_iMenuToOpen[id])
	{
		case 0:
		{
			openInventory(id, iData);
		}
		case 1:
		{
			openContractMenu(id, iData);
		}
		case 2:
		{
			openCoinflipMenu(id, iData);
		}
		case 3:
		{
			openSellMenu(id, iData);
		}
		case 4:
		{
			openDustbinSkins(id, iData);
		}
		case 5:
		{
			openGiftMenu(id, iData);
		}
		case 6:
		{
			openTradeMenu(id, iData);
		}
		case 7:
		{
			openJackpotMenu(id, iData);
		}
		default:
		{
		}
	}
	return 1;
}

openInventory(id, iWeaponId)
{
	new temp[64];
	formatex(temp, 63, "\r%s \w%L", "[CSGO Classy]", id, "INVENTORY");
	new menu = menu_create(temp, "skin_menu_handler", MaxClients);
	new szItem[10];
	new bool:hasSkins;
	new num;
	new skinName[48];
	new skintype[4];
	new wid;
	new apply;
	new craft;
	new i;
	while (i < g_iSkinsNum)
	{
		num = g_iUserSkins[id][i];
		if (0 < num)
		{
			wid = ArrayGetCell(g_aSkinWeaponID, i, MaxClients, MaxClients);
			if (iWeaponId != wid)
			{
				i++;
			}
			ArrayGetString(g_aSkinName, i, skinName, 47);
			ArrayGetString(g_aSkinType, i, skintype, 3);
			if (equali(skintype, 385820, 3))
			{
				craft = 0;
			}
			else
			{
				craft = 1;
			}
			if (g_iUserSelectedSkin[id][wid] == i)
			{
				apply = 1;
			}
			else
			{
				apply = 0;
			}
			new crafted[64];
			new applied[64];
			switch (craft)
			{
				case 1:
				{
					crafted = {0};
				}
				default:
				{
					crafted = {0};
				}
			}
			switch (apply)
			{
				case 1:
				{
					applied = {32,91,35,93,0};
				}
				default:
				{
					applied = {0};
				}
			}
			new var1;
			if (g_bIsWeaponStattrack[id][i])
			{
				var1 = 385932;
			}
			else
			{
				var1 = 385996;
			}
			formatex(temp, 63, "\r%s\w%s \r[%d]%s", var1, skinName, num, applied);
			num_to_str(i, szItem, 9);
			menu_additem(menu, temp, szItem, MaxClients, -1);
			hasSkins = true;
		}
		i++;
	}
	if (!hasSkins)
	{
		formatex(temp, 63, "\r%L", id, "NO_ITEMS");
		num_to_str(2000, szItem, 9);
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	menu_display(id, menu, MaxClients, -1);
	return 0;
}

public skin_menu_handler(id, menu, item)
{
	if (item == -3)
	{
		_ShowSkinMenu(id);
		menu_destroy(menu);
		return 1;
	}
	new itemdata[10];
	new dummy;
	new index;
	menu_item_getinfo(menu, item, dummy, itemdata, 9, 386056, MaxClients, dummy);
	index = str_to_num(itemdata);
	switch (index)
	{
		case 2000:
		{
			_ShowMainMenu(id);
			menu_destroy(menu);
			return 1;
		}
		default:
		{
			new wid = ArrayGetCell(g_aSkinWeaponID, index, MaxClients, MaxClients);
			new var1;
			if (wid == g_iWeaponIdToCheck[id] && notAnySkins(id))
			{
				_ShowSkinMenu(id);
				menu_destroy(menu);
				return 1;
			}
			new bool:SameSkin;
			if (g_iUserSelectedSkin[id][wid] == index)
			{
				SameSkin = true;
			}
			if (isUsingSomeoneElsesWeapon(id, wid))
			{
				client_print_color(id, id, "\x04%s\x01 You \x04can not change\x01 your \x04skin\x01 while \x04holding\x01 someone \x04else's weapon", "[CSGO Classy]");
				_ShowSkinMenu(id);
				menu_destroy(menu);
				return 1;
			}
			new sName[32];
			ArrayGetString(g_aSkinName, index, sName, "");
			if (!SameSkin)
			{
				if (g_bIsWeaponStattrack[id][index])
				{
					if (1 < g_iUserSkins[id][index])
					{
						askWhichType(id, index);
						g_iAskType[id] = 0;
						return 1;
					}
				}
				g_iUserSelectedSkin[id][wid] = index;
				new iPlayers[32];
				new iNum;
				new model[48];
				get_players(iPlayers, iNum, "ach", 351508);
				new i;
				new iPlayer;
				while (i < iNum)
				{
					iPlayer = iPlayers[i];
					if (wid == get_user_weapon(iPlayer, 0, 0))
					{
						if (isUsingCertainPlayersSkin(iPlayer, id, wid))
						{
							ArrayGetString(g_aSkinModel, index, model, 47);
							cs_set_viewmodel_body(iPlayer, wid, ArrayGetCell(g_aSkinBody, index, MaxClients, MaxClients));
							cs_set_modelformat(iPlayer, wid, model);
						}
					}
					i++;
				}
				if (wid == get_user_weapon(id, 0, 0))
				{
					ArrayGetString(g_aSkinModel, index, model, 47);
					cs_set_viewmodel_body(id, wid, ArrayGetCell(g_aSkinBody, index, MaxClients, MaxClients));
					cs_set_modelformat(id, wid, model);
				}
				_SaveData(id);
				client_cmd(id, "spk items/gunpickup2.wav");
				_ShowSkinMenu(id);
			}
			else
			{
				g_iUserSelectedSkin[id][wid] = -1;
				if (wid == get_user_weapon(id, 0, 0))
				{
					set_pev(id, "bl", g_szDefaultSkinModel[wid]);
				}
				cs_set_viewmodel_body(id, wid, -1);
				cs_set_modelformat(id, wid, 386540);
				_SaveData(id);
				client_cmd(id, "spk items/gunpickup2.wav");
				_ShowSkinMenu(id);
			}
			menu_destroy(menu);
			return 1;
		}
	}
}

_ShowCFMenu(id)
{
	if (g_bCFAccept[id])
	{
		client_print_color(id, id, "\x04%s\x01 You \x04can not start\x01 another \x04Coinflip\x01 right now", "[CSGO Classy]");
		return 0;
	}
	new temp[64];
	formatex(temp, 63, "\r%s \wCoinflip", "[CSGO Classy]");
	new menu = menu_create(temp, "cf_main_menu_handler", MaxClients);
	new szItem[2];
	szItem[1] = 0;
	new bool:HasTarget;
	new bool:HasItem;
	new target = g_iCFTarget[id];
	if (target)
	{
		formatex(temp, 63, "\w%L", id, "GIFT_TARGET", g_szName[target]);
		szItem[0] = 0;
		menu_additem(menu, temp, szItem, MaxClients, -1);
		HasTarget = true;
	}
	else
	{
		formatex(temp, 63, "Choose receiver");
		szItem[0] = 0;
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	if (!_IsGoodItem(g_iCFItem[id]))
	{
		formatex(temp, 63, "\rSelect a skin\n");
		szItem[0] = 1;
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	else
	{
		new Item[32];
		_GetItemName(g_iCFItem[id], Item, 31);
		new var1;
		if (g_bBettingCFStt[id])
		{
			var1 = 387360;
		}
		else
		{
			var1 = 387424;
		}
		formatex(temp, 63, "\r%s\w%s\n", var1, Item);
		szItem[0] = 1;
		menu_additem(menu, temp, szItem, MaxClients, -1);
		HasItem = true;
	}
	new var2;
	if (HasTarget && HasItem && !g_bCFActive[id])
	{
		formatex(temp, 63, "\rSend");
		szItem[0] = 2;
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	new var3;
	if (g_bCFActive[id] || g_bCFSecond[id])
	{
		formatex(temp, 63, "\rCancel");
		szItem[0] = 3;
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	menu_display(id, menu, MaxClients, -1);
	return 0;
}

public cf_main_menu_handler(id, menu, item)
{
	if (item == -3)
	{
		if (g_bCFSecond[id])
		{
			clcmd_say_deny_cf(id);
		}
		_ShowGamesMenu(id);
		menu_destroy(menu);
		return 1;
	}
	new itemdata[2];
	new dummy;
	new index;
	menu_item_getinfo(menu, item, dummy, itemdata, 1, 387492, MaxClients, dummy);
	index = itemdata[0];
	switch (index)
	{
		case 0:
		{
			new var4;
			if (g_bCFActive[id] || g_bCFSecond[id])
			{
				_ShowCFMenu(id);
			}
			else
			{
				_SelectCFTarget(id);
			}
		}
		case 1:
		{
			if (g_bCFActive[id])
			{
				_ShowCFMenu(id);
			}
			else
			{
				_SelectCFItem(id);
			}
		}
		case 2:
		{
			new target = g_iCFTarget[id];
			new _item = g_iCFItem[id];
			new var2;
			if (!g_bLogged[target] || (0 < target && 32 >= target))
			{
				_ResetCFData(id);
			}
			else
			{
				if (!_UserHasItem(id, _item))
				{
					g_iCFItem[id] = -1;
					_ShowCFMenu(id);
					return 1;
				}
				new var3;
				if (g_bCFSecond[id] && !_UserHasItem(target, g_iCFItem[target]))
				{
					_ResetCFData(id);
					_ResetCFData(target);
					_ShowCFMenu(id);
					return 1;
				}
				if (5 <= g_iUserSkins[target][_item])
				{
					client_print_color(id, id, "\x04%s %s\x01 can not receive that skin anymore, he already have\x04 5 out of 5", "[CSGO Classy]", g_szName[target], _item);
					_ShowCFMenu(id);
					return 1;
				}
				g_bCFActive[id] = 1;
				g_iCFRequest[target] = id;
				new szItem[50];
				_GetItemName(g_iCFItem[id], szItem, 49);
				if (g_bBettingCFStt[id])
				{
					format(szItem, 49, "StatTrack (TM) %s", szItem);
				}
				if (!g_bCFSecond[id])
				{
					g_bCFAccept[target] = 1;
					client_print_color(target, target, "\x04%s %s\x01 wants to bet his\x04 %s\x01 in a \x04Coinflip", "[CSGO Classy]", g_szName[id], szItem);
					client_print_color(target, target, "\x04%s\x01 Type \x04/coinflipaccept\x01 or \x04/coinflipdeny\x01 to either accept or deny", "[CSGO Classy]");
				}
				else
				{
					if (5 <= g_iUserSkins[id][_item])
					{
						client_print_color(id, id, "\x04%s %s\x01 can not receive that skin anymore, he already have\x04 5 out of 5", "[CSGO Classy]", g_szName[id], _item);
						_ShowCFMenu(target);
						return 1;
					}
					new yItem[50];
					_GetItemName(g_iCFItem[target], yItem, 49);
					if (g_bBettingCFStt[target])
					{
						format(yItem, 49, "StatTrack (TM) %s", yItem);
					}
					client_print_color(target, target, "\x04%s %s\x01 wants to bet his\x04 %s\x01 in a \x04Coinflip", "[CSGO Classy]", g_szName[id], szItem);
					client_print_color(target, target, "\x04%s\x01 Type \x04/coinflipaccept\x01 or \x04/coinflipdeny\x01 to either accept or deny", "[CSGO Classy]");
					g_bCFAccept[target] = 1;
				}
			}
		}
		case 3:
		{
			if (g_bCFSecond[id])
			{
				clcmd_say_deny_cf(id);
			}
			else
			{
				_ResetCFData(id);
			}
			_ShowCFMenu(id);
		}
		default:
		{
		}
	}
	menu_destroy(menu);
	return 1;
}

_SelectCFTarget(id)
{
	new temp[64];
	formatex(temp, 63, "\r%s %L", "[CSGO Classy]", id, "GIFT_SELECT_TARGET");
	new menu = menu_create(temp, "cf_menu_handler", MaxClients);
	new szItem[10];
	szItem[1] = 0;
	new Pl[32];
	new n;
	new p;
	get_players(Pl, n, 389708, 351508);
	new total;
	if (n)
	{
		new i;
		while (i < n)
		{
			p = Pl[i];
			if (g_bLogged[p])
			{
				if (!id == p)
				{
					szItem[0] = p;
					menu_additem(menu, g_szName[p], szItem, MaxClients, -1);
					total++;
				}
			}
			i++;
		}
	}
	if (!total)
	{
		formatex(temp, 63, "\r%L", id, "NO_REGISTERED_PLAYERS");
		num_to_str(2000, szItem, 9);
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	menu_display(id, menu, MaxClients, -1);
	return 0;
}

public cf_menu_handler(id, menu, item)
{
	if (item == -3)
	{
		_ShowCFMenu(id);
		menu_destroy(menu);
		return 1;
	}
	new itemdata[2];
	new dummy;
	new index;
	new name[32];
	menu_item_getinfo(menu, item, dummy, itemdata, 1, name, "", dummy);
	index = itemdata[0];
	switch (index)
	{
		case 2000:
		{
			_ShowMainMenu(id);
			menu_destroy(menu);
			return 1;
		}
		default:
		{
			if (!g_iCFRequest[index])
			{
				g_iCFTarget[id] = index;
			}
			_ShowCFMenu(id);
			menu_destroy(menu);
			return 1;
		}
	}
}

_SelectCFItem(id)
{
	_ShowSkinMenu(id);
	return 0;
}

openCoinflipMenu(id, iWeaponId)
{
	new temp[64];
	formatex(temp, 63, "\r%s \w%L", "[CSGO Classy]", id, "INVENTORY");
	new menu = menu_create(temp, "cf_item_menu_handler", MaxClients);
	new szItem[10];
	szItem[1] = 0;
	new total;
	new szSkin[32];
	new num;
	new type[2];
	new i;
	new wid;
	while (i < g_iSkinsNum)
	{
		num = g_iUserSkins[id][i];
		if (num > 0)
		{
			wid = ArrayGetCell(g_aSkinWeaponID, i, MaxClients, MaxClients);
			if (iWeaponId != wid)
			{
				i++;
			}
			ArrayGetString(g_aSkinName, i, szSkin, "");
			ArrayGetString(g_aSkinType, i, type, 1);
			new applied[64];
			switch (type[0])
			{
				case 99:
				{
					applied = {0};
				}
				default:
				{
					applied = {0};
				}
			}
			new var1;
			if (g_bIsWeaponStattrack[id][i])
			{
				var1 = 390112;
			}
			else
			{
				var1 = 390176;
			}
			formatex(temp, 63, "\r%s\w%s \r[%d]", var1, szSkin, num);
			num_to_str(i, szItem, 9);
			menu_additem(menu, temp, szItem, MaxClients, -1);
			total++;
		}
		i++;
	}
	if (!total)
	{
		formatex(temp, 63, "\r%L", id, "NO_ITEMS");
		num_to_str(2000, szItem, 9);
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	menu_display(id, menu, MaxClients, -1);
	return 0;
}

public cf_item_menu_handler(id, menu, item)
{
	if (item == -3)
	{
		_ShowCFMenu(id);
		menu_destroy(menu);
		return 1;
	}
	new itemdata[5];
	new dummy;
	new index;
	menu_item_getinfo(menu, item, dummy, itemdata, NULL_STRING, 390236, MaxClients, dummy);
	index = str_to_num(itemdata);
	switch (index)
	{
		case 2000:
		{
			_ShowCFMenu(id);
			menu_destroy(menu);
			return 1;
		}
		default:
		{
			new var1;
			if (g_iUserSellItem[id] == index && g_bUserSell[id])
			{
				new Item[50];
				_GetItemName(g_iUserSellItem[id], Item, 49);
				if (g_bPublishedStattrackSkin[id])
				{
					format(Item, 49, "StatTrack (TM) %s", Item);
				}
				client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "TRADE_INVALID_ITEM", Item);
				_SelectCFItem(id);
			}
			else
			{
				if (ArrayGetCell(g_aSkinWeaponID, index, MaxClients, MaxClients) != g_iWeaponIdToCheck[id])
				{
					_SelectCFItem(id);
					menu_destroy(menu);
					return 1;
				}
				g_iCFItem[id] = index;
				if (g_bIsWeaponStattrack[id][index])
				{
					if (1 < g_iUserSkins[id][index])
					{
						askWhichType(id, index);
						g_iAskType[id] = 7;
						return 1;
					}
					g_bBettingCFStt[id] = 1;
				}
				else
				{
					g_bBettingCFStt[id] = 0;
				}
				if (g_bCFAccept[id])
				{
					confirmationCoinflip(id);
				}
				_ShowCFMenu(id);
			}
			menu_destroy(menu);
			return 1;
		}
	}
}

_ResetCFData(id)
{
	g_bOneAccepted = false;
	g_bCFActive[id] = 0;
	g_bCFSecond[id] = 0;
	g_bCFAccept[id] = 0;
	g_iCFTarget[id] = 0;
	g_iCFItem[id] = -1;
	g_iCFRequest[id] = 0;
	return 0;
}

public clcmd_say_accept_cf(id)
{
	new sender = g_iCFRequest[id];
	new var1;
	if (1 > sender || 32 < sender)
	{
		return 1;
	}
	new var3;
	if (!g_bLogged[sender] || (0 < sender && 32 >= sender))
	{
		_ResetCFData(id);
		return 1;
	}
	new var4;
	if (!g_bCFActive[sender] && g_iCFTarget[sender] == id)
	{
		_ResetCFData(id);
		return 1;
	}
	g_iCFTarget[id] = sender;
	g_iCFItem[id] = -1;
	g_bCFSecond[id] = 1;
	g_iMenuToOpen[id] = 2;
	_SelectCFItem(id);
	return 1;
}

public confirmationCoinflip(id)
{
	new menu = menu_create("\r[CSGO Classy] \wDo you confirm the Coinflip?", "confirm_cf_handler", MaxClients);
	menu_additem(menu, "\rNo", 381156, MaxClients, -1);
	menu_additem(menu, "\yYes", 381156, MaxClients, -1);
	menu_display(id, menu, MaxClients, -1);
	return 0;
}

public confirm_cf_handler(id, menu, item)
{
	if (item == -3)
	{
		_ResetCFData(id);
		_ResetCFData(g_iCFRequest[id]);
		_ShowCFMenu(id);
		menu_destroy(menu);
		return 1;
	}
	decl sender;
	new var1;
	if (g_bOneAccepted)
	{
		var1 = g_iCFTarget[id];
	}
	else
	{
		var1 = g_iCFRequest[id];
	}
	sender = var1;
	if (item)
	{
		new sItem = g_iCFItem[sender];
		new tItem = g_iCFItem[id];
		new var2;
		if (!_UserHasItem(id, tItem) || !_UserHasItem(sender, sItem))
		{
			_ResetCFData(id);
			_ResetCFData(sender);
			return 1;
		}
		new sItemsz[50];
		new tItemsz[50];
		_GetItemName(tItem, tItemsz, 49);
		_GetItemName(sItem, sItemsz, 49);
		if (!g_bOneAccepted)
		{
			client_print_color(id, id, "\x04%s\x01 You \x04accepted\x01 the \x04Coinflip\x01, wait for your \x04opponent to confirm", "[CSGO Classy]");
			new var3;
			if (g_bBettingCFStt[id])
			{
				var3 = 391408;
			}
			else
			{
				var3 = 391472;
			}
			client_print_color(sender, sender, "\x04%s %s\x01 \x04accepted\x01 the \x04Coinflip\x01, he is betting a\x04 %s%s", "[CSGO Classy]", g_szName[id], var3, tItemsz);
			g_bOneAccepted = true;
			confirmationCoinflip(sender);
			menu_destroy(menu);
			return 1;
		}
		if (random_num(MaxClients, 1) == 1)
		{
			g_iUserSkins[id][tItem]--;
			g_iUserSkins[sender][tItem]++;
			if (g_bBettingCFStt[id])
			{
				if (g_bIsWeaponStattrack[sender][tItem])
				{
					client_print_color(sender, sender, "\x04%s\x01 Since you already have\x04 StatTrack (TM) %s\x01, you got\x04 %s\x01 instead", "[CSGO Classy]", tItemsz, tItemsz);
				}
				else
				{
					format(tItemsz, 49, "StatTrack (TM) %s", tItemsz);
					g_bIsWeaponStattrack[sender][tItem] = true;
				}
				g_bIsWeaponStattrack[id][tItem] = false;
				g_iUserStattrackKillCount[id][tItem] = 0;
			}
			checkInstantDefault(id, tItem);
			client_print_color(id, id, "\x04%s\x01 You lost the \x04Coinflip", "[CSGO Classy]");
			client_print_color(sender, sender, "\x04%s\x01 You won the \x04Coinflip\x01 and got\x04 %s", "[CSGO Classy]", tItemsz);
		}
		else
		{
			g_iUserSkins[id][sItem]++;
			g_iUserSkins[sender][sItem]--;
			if (g_bBettingCFStt[sender])
			{
				if (g_bIsWeaponStattrack[id][sItem])
				{
					client_print_color(id, id, "\x04%s\x01 Since you already have\x04 StatTrack (TM) %s\x01, you got\x04 %s\x01 instead", "[CSGO Classy]", tItemsz, tItemsz);
				}
				else
				{
					format(sItemsz, 49, "StatTrack (TM) %s", sItemsz);
					g_bIsWeaponStattrack[id][sItem] = true;
				}
				g_bIsWeaponStattrack[sender][sItem] = false;
				g_iUserStattrackKillCount[sender][sItem] = 0;
			}
			checkInstantDefault(sender, sItem);
			client_print_color(sender, sender, "\x04%s\x01 You lost the \x04Coinflip", "[CSGO Classy]");
			client_print_color(id, id, "\x04%s\x01 You won the \x04Coinflip\x01 and got\x04 %s", "[CSGO Classy]", tItemsz);
		}
	}
	else
	{
		client_print_color(id, id, "\x04%s\x01 You cancelled the \x04Coinflip", "[CSGO Classy]");
		client_print_color(sender, sender, "\x04%s %s\x01 cancelled the \x04Coinflip", "[CSGO Classy]", g_szName[id]);
	}
	g_bBettingCFStt[id] = 0;
	g_bBettingCFStt[sender] = 0;
	_ResetCFData(id);
	_ResetCFData(sender);
	_SaveData(id);
	_SaveData(sender);
	return 1;
}

public clcmd_say_deny_cf(id)
{
	new sender = g_iCFRequest[id];
	new var1;
	if (sender < 1 || sender > 32)
	{
		return 1;
	}
	new var3;
	if (!g_bLogged[sender] || (0 < sender && 32 >= sender))
	{
		_ResetCFData(id);
		return 1;
	}
	new var4;
	if (!g_bCFActive[sender] && g_iCFTarget[sender] == id)
	{
		_ResetCFData(id);
		return 1;
	}
	_ResetCFData(id);
	_ResetCFData(sender);
	client_print_color(sender, sender, "\x04%s %s\x01 denied your \x04Coinflip", "[CSGO Classy]", g_szName[id]);
	client_print_color(id, id, "\x04%s\x01 You have denied\x04 %s's\x01 \x04Coinflip", "[CSGO Classy]", g_szName[sender]);
	return 1;
}

askWhichType(id, index)
{
	new iMenu = menu_create("Use StatTrack (TM)?", "ask_handler", MaxClients);
	new szIndex[5];
	num_to_str(index, szIndex, NULL_STRING);
	menu_additem(iMenu, "\rNo", szIndex, MaxClients, -1);
	menu_additem(iMenu, "\yYes", szIndex, MaxClients, -1);
	menu_display(id, iMenu, MaxClients, -1);
	return 0;
}

public ask_handler(id, menu, item)
{
	if (item == -3)
	{
		_ShowSkinMenu(id);
		menu_destroy(menu);
		return 1;
	}
	new itemdata[5];
	new dummy;
	new index;
	menu_item_getinfo(menu, item, dummy, itemdata, NULL_STRING, 393988, MaxClients, dummy);
	index = str_to_num(itemdata);
	new wid = ArrayGetCell(g_aSkinWeaponID, index, MaxClients, MaxClients);
	switch (g_iAskType[id])
	{
		case 0:
		{
			g_bShallUseStt[id][wid] = item;
			g_iUserSelectedSkin[id][wid] = index;
			new iPlayers[32];
			new iNum;
			new model[48];
			get_players(iPlayers, iNum, "ach", 351508);
			new i;
			new iPlayer;
			while (i < iNum)
			{
				iPlayer = iPlayers[i];
				if (wid == get_user_weapon(iPlayer, 0, 0))
				{
					if (isUsingCertainPlayersSkin(iPlayer, id, wid))
					{
						ArrayGetString(g_aSkinModel, index, model, 47);
						cs_set_viewmodel_body(iPlayer, wid, ArrayGetCell(g_aSkinBody, index, MaxClients, MaxClients));
						cs_set_modelformat(iPlayer, wid, model);
					}
				}
				i++;
			}
			if (wid == get_user_weapon(id, 0, 0))
			{
				ArrayGetString(g_aSkinModel, index, model, 47);
				cs_set_viewmodel_body(id, wid, ArrayGetCell(g_aSkinBody, index, MaxClients, MaxClients));
				cs_set_modelformat(id, wid, model);
			}
			client_cmd(id, "spk items/gunpickup2.wav");
			_ShowSkinMenu(id);
		}
		case 1:
		{
			g_bPublishedStattrackSkin[id] = item;
			new szItem[32];
			_GetItemName(index, szItem, 31);
			if (g_bPublishedStattrackSkin[id])
			{
				client_print_color(id, id, "\x04%s\x01 You selected\x04 StatTrack (TM) %s", "[CSGO Classy]", szItem);
				client_print_color(id, id, "\x04%s\x01 You have to \x04type a price\x01 for your \x04StatTrack (TM) %s", "[CSGO Classy]", szItem);
			}
			else
			{
				client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "ITEM_SELECT", szItem);
				client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "ITEM_SET_PRICE", szItem);
			}
			client_cmd(id, "messagemode SkinPrice");
		}
		case 2:
		{
			g_bGiftingStt[id] = item;
			new szItem[32];
			_GetItemName(index, szItem, 31);
			if (g_bGiftingStt[id])
			{
				client_print_color(id, id, "\x04%s\x01 You selected\x04 StatTrack (TM) %s", "[CSGO Classy]", szItem);
			}
			else
			{
				client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "GIFT_YOUR_GIFT", szItem);
			}
			_ShowGiftMenu(id);
		}
		case 3:
		{
			g_bDestroyStt[id] = item;
			destroySkin(id, index);
			_ShowDustbinMenu(id);
		}
		case 4:
		{
			g_bTradingStt[id] = item;
			new szItem[32];
			_GetItemName(index, szItem, 31);
			if (g_bTradingStt[id])
			{
				client_print_color(id, id, "\x04%s\x01 You selected\x04 StatTrack (TM) %s", "[CSGO Classy]", szItem);
				_ShowTradeMenu(id);
			}
			else
			{
				client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "TRADE_ITEM", szItem);
				_ShowTradeMenu(id);
			}
		}
		case 5:
		{
			g_bJackpotStt[id] = item;
			_ShowJackpotMenu(id);
		}
		case 6:
		{
			g_bUsedSttC[id][index] = item;
			new var1 = g_iSkinsInContract[id];
			var1++;
			g_iWeaponUsedInContract[id][var1] = index;
			if (g_bIsWeaponStattrack[id][index])
			{
				g_iUserChance[id] += 3;
			}
			else
			{
				g_iUserChance[id] += 1;
			}
			if (g_iSkinsInContract[id] == 10)
			{
				askToContinue(id);
			}
			else
			{
				_ShowContractMenu(id);
			}
		}
		case 7:
		{
			g_bBettingCFStt[id] = item;
			g_iCFItem[id] = index;
			if (g_bCFAccept[id])
			{
				confirmationCoinflip(id);
			}
			else
			{
				_ShowCFMenu(id);
			}
		}
		default:
		{
		}
	}
	_SaveData(id);
	menu_destroy(menu);
	return 1;
}

public Ham_Grenade_PA(ent)
{
	if (!pev_valid(ent) == 2)
	{
		return 0;
	}
	get_pdata_cbase(ent, 41, NULL_STRING, 5);
	ShortThrow = false;
	return 0;
}

public Ham_Grenade_SA(ent)
{
	if (!pev_valid(ent) == 2)
	{
		return 0;
	}
	get_pdata_cbase(ent, 41, NULL_STRING, 5);
	ExecuteHamB(87, ent);
	ShortThrow = true;
	return 0;
}

public grenade_throw(id, ent, csw)
{
	new var3;
	if (!pev_valid(ent) || ((0 < id && 32 >= id) || !is_user_connected(id)))
	{
		return 0;
	}
	switch (csw)
	{
		case 4:
		{
			new var4 = g_szNadeModels;
			engfunc(2, ent, var4[0][var4]);
		}
		case 9:
		{
			engfunc(2, ent, g_szNadeModels[2]);
		}
		case 25:
		{
			engfunc(2, ent, g_szNadeModels[1]);
		}
		default:
		{
		}
	}
	if (csw == 25)
	{
		set_pev(ent, 51, floatadd(1065353216, get_gametime()));
	}
	if (!ShortThrow)
	{
		return 0;
	}
	new Float:grenadeVelocity[3] = 0.0;
	pev(ent, "USAGE", grenadeVelocity);
	xs_vec_mul_scalar(grenadeVelocity, 0.5, grenadeVelocity);
	set_pev(ent, "USAGE", grenadeVelocity);
	return 0;
}

public Ham_Item_Deploy_Post(weapon_ent)
{
	new owner = fm_cs_get_weapon_ent_owner(weapon_ent);
	if (!is_user_alive(owner))
	{
		return 1;
	}
	new weaponid = cs_get_weapon_id(weapon_ent);
	if (weaponid == 6)
	{
		return 1;
	}
	new var1;
	if (!g_bLogged[owner] && g_szDefaultSkinModel[weaponid][0])
	{
		set_pev(owner, "bl", g_szDefaultSkinModel[weaponid]);
		return 1;
	}
	new userskin = g_iUserSelectedSkin[owner][weaponid];
	if (userskin != -1)
	{
		if (g_iUserSkins[owner][userskin] < 1)
		{
			g_iUserSelectedSkin[owner][weaponid] = -1;
			userskin = -1;
		}
	}
	new imp = pev(weapon_ent, 82);
	new model[48];
	if (0 < imp)
	{
		if (isUsingSomeoneElsesWeapon(owner, weaponid))
		{
			if (g_iUserSelectedSkin[getOriginalOwnerID(owner, weaponid)][weaponid] == -1)
			{
				set_pev(owner, "bl", g_szDefaultSkinModel[weaponid]);
			}
			else
			{
				new iIndex = g_iUserSelectedSkin[getOriginalOwnerID(owner, weaponid)][weaponid];
				ArrayGetString(g_aSkinModel, iIndex, model, 47);
				new sName[48];
				ArrayGetString(g_aSkinName, iIndex, sName, 47);
				g_bUsingM4A4[owner] = containi(sName, "M4A4") != -1;
				new iBodyValue = ArrayGetCell(g_aSkinBody, iIndex, MaxClients, MaxClients);
				if (iBodyValue != -1)
				{
					cs_set_viewmodel_body(owner, weaponid, iBodyValue);
					cs_set_modelformat(owner, weaponid, model);
				}
				else
				{
					set_pev(owner, "bl", model);
				}
			}
		}
		else
		{
			if (imp != 3812)
			{
				new iIndex = imp + -1;
				ArrayGetString(g_aSkinModel, iIndex, model, 47);
				new sName[48];
				ArrayGetString(g_aSkinName, iIndex, sName, 47);
				g_bUsingM4A4[owner] = containi(sName, "M4A4") != -1;
				new iBodyValue = ArrayGetCell(g_aSkinBody, iIndex, MaxClients, MaxClients);
				if (iBodyValue != -1)
				{
					cs_set_viewmodel_body(owner, weaponid, iBodyValue);
					cs_set_modelformat(owner, weaponid, model);
				}
				else
				{
					set_pev(owner, "bl", model);
				}
			}
			set_pev(owner, "bl", g_szDefaultSkinModel[weaponid]);
		}
	}
	else
	{
		if (userskin == -1)
		{
			if (g_szDefaultSkinModel[weaponid][0])
			{
				set_pev(owner, "bl", g_szDefaultSkinModel[weaponid]);
			}
		}
		ArrayGetString(g_aSkinModel, userskin, model, 47);
		new sName[48];
		ArrayGetString(g_aSkinName, userskin, sName, 47);
		g_bUsingM4A4[owner] = containi(sName, "M4A4") != -1;
		new iBodyValue = ArrayGetCell(g_aSkinBody, userskin, MaxClients, MaxClients);
		if (iBodyValue != -1)
		{
			cs_set_viewmodel_body(owner, weaponid, iBodyValue);
			cs_set_modelformat(owner, weaponid, model);
		}
		else
		{
			set_pev(owner, "bl", model);
		}
	}
	return 1;
}

fm_cs_get_weapon_ent_owner(ent)
{
	if (pev_valid(ent) != 2)
	{
		return -1;
	}
	return get_pdata_cbase(ent, 41, NULL_STRING, 5);
}

public Ham_Item_Can_Drop(ent)
{
	if (pev_valid(ent) != 2)
	{
		return 0;
	}
	new weapon = get_pdata_int(ent, 43, NULL_STRING, 5);
	new var1;
	if (weapon <= 0 || weapon > 30)
	{
		return 0;
	}
	if (1 << weapon & 570425936)
	{
		return 0;
	}
	new imp = pev(ent, 82);
	new id = get_pdata_cbase(ent, 41, NULL_STRING, 5);
	if (imp > 0)
	{
		return 0;
	}
	if (!is_user_connected(id))
	{
		return 0;
	}
	new skin = g_iUserSelectedSkin[id][weapon];
	new var2;
	if (skin == -1)
	{
		var2 = 3812;
	}
	else
	{
		var2 = skin + 1;
	}
	set_pev(ent, 82, var2);
	return 0;
}

_ShowOpenCaseCraftMenu(id)
{
	new temp[96];
	formatex(temp, 95, "\r%s \w%L", "[CSGO Classy]", id, "CRAFT_MENU");
	new menu = menu_create(temp, "oc_craft_menu_handler", MaxClients);
	new szItem[2];
	szItem[1] = 0;
	formatex(temp, 95, "\w%L \r[%L]\n", id, "OPENCASE", id, "OPENCASE_CK", g_iUserCases[id], g_iUserKeys[id]);
	szItem[0] = 0;
	menu_additem(menu, temp, szItem, MaxClients, -1);
	if (g_iDropType > 0)
	{
		formatex(temp, 95, "\r%L \r[%L]", id, "BUY_KEY", id, "KEY_PRICE", g_iKeyPrice);
		szItem[0] = 2;
		menu_additem(menu, temp, szItem, MaxClients, -1);
		formatex(temp, 95, "\r%L \r[%L]\n", id, "SELL_KEY", id, "KEY_CASHBACK", g_iKeyPrice / 2);
		szItem[0] = 3;
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	formatex(temp, 95, "\w%L \r[%L]", id, "CRAFT_SUBMENU", id, "CRAFT_SCRAPS", g_iUserScraps[id], g_iCraftCost);
	szItem[0] = 1;
	menu_additem(menu, temp, szItem, MaxClients, -1);
	menu_display(id, menu, MaxClients, -1);
	return 0;
}

public oc_craft_menu_handler(id, menu, item)
{
	if (item == -3)
	{
		_ShowMainMenu(id);
		menu_destroy(menu);
		return 1;
	}
	new itemdata[2];
	new dummy;
	new index;
	menu_item_getinfo(menu, item, dummy, itemdata, 1, 396508, MaxClients, dummy);
	index = itemdata[0];
	switch (index)
	{
		case 0:
		{
			new var1;
			if (g_iUserCases[id] < 1 || g_iUserKeys[id] < 1)
			{
				_ShowOpenCaseCraftMenu(id);
			}
			_ShowOpenCaseCraftMenu(id);
			_OpenCase(id);
			return 1;
		}
		case 1:
		{
			if (g_iUserScraps[id] < g_iCraftCost)
			{
				_ShowOpenCaseCraftMenu(id);
			}
			_ShowOpenCaseCraftMenu(id);
			_CraftSkin(id);
			return 1;
		}
		case 2:
		{
			if (g_iUserMoney[id] < g_iKeyPrice)
			{
				client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "NOT_ENOUGH_MONEY", g_iKeyPrice - g_iUserMoney[id]);
				_ShowOpenCaseCraftMenu(id);
			}
			else
			{
				client_cmd(id, "spk items/gunpickup2.wav");
				g_iUserMoney[id] -= g_iKeyPrice;
				g_iUserKeys[id]++;
				_SaveData(id);
				_ShowOpenCaseCraftMenu(id);
			}
		}
		case 3:
		{
			if (g_iUserKeys[id] < 1)
			{
				_ShowOpenCaseCraftMenu(id);
			}
			else
			{
				client_cmd(id, "spk items/gunpickup2.wav");
				new var2 = g_iUserMoney[id];
				var2 = var2[g_iKeyPrice / 2];
				g_iUserKeys[id]--;
				_SaveData(id);
				_ShowOpenCaseCraftMenu(id);
			}
		}
		default:
		{
		}
	}
	menu_destroy(menu);
	return 1;
}

_OpenCase(id)
{
	new iSysTime = get_systime(MaxClients);
	new iDelay = iSysTime - g_iOpenDelay[id];
	if (iDelay < 3)
	{
		return 0;
	}
	g_iOpenDelay[id] = iSysTime;
	new bool:succes;
	new rSkin;
	new rChance;
	new skinID = -1;
	new wChance;
	new bool:bNoSkinSelected = 1;
	while (bNoSkinSelected)
	{
		rSkin = random_num(MaxClients, g_iDropSkinNum + -1);
		rChance = random_num(1, 100);
		if (g_iDropSkinNum <= 0)
		{
			client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", -1, "NO_DROP_SKINS");
			_ShowOpenCaseCraftMenu(id);
			return 0;
		}
		skinID = ArrayGetCell(g_aDropSkin, rSkin, MaxClients, MaxClients);
		wChance = ArrayGetCell(g_aSkinChance, skinID, MaxClients, MaxClients);
		if (rChance >= wChance)
		{
			succes = true;
		}
		if (succes)
		{
			bNoSkinSelected = false;
			g_iUserCases[id]--;
			g_iUserKeys[id]--;
			new Skin[32];
			ArrayGetString(g_aSkinName, skinID, Skin, "");
			if (5 <= g_iUserSkins[id][skinID])
			{
				new iRandomValue = random_num(MaxClients, 1);
				new bool:bScrapsInstead = iRandomValue == 1;
				new iValue = 1;
				if (bScrapsInstead)
				{
					new var4 = g_iUserScraps[id];
					var4 = var4[iValue];
				}
				else
				{
					iValue = ArrayGetCell(g_aSkinCostMin, skinID, MaxClients, MaxClients) / 4;
					new var5 = g_iUserMoney[id];
					var5 = var5[iValue];
				}
				new var1;
				if (bScrapsInstead)
				{
					var1 = 397472;
				}
				else
				{
					var1 = 397500;
				}
				client_print_color(id, id, "\x04%s\x01 Since you already have\x04 5 pieces of %s\x01 you got\x04 %d%s\x01 instead", "[CSGO Classy]", Skin, iValue, var1);
			}
			else
			{
				g_iUserSkins[id][skinID]++;
				_SaveData(id);
				if (g_iShowDropCraft > 0)
				{
					new var2;
					if (random_num(1, 100) <= 5 && !g_bIsWeaponStattrack[id][skinID])
					{
						g_bIsWeaponStattrack[id][skinID] = true;
						client_print_color(MaxClients, id, "\x04%s\x01 \x04%s\x01 opened \x04StatTrack (TM) %s\x01 with a \x04chance of %d percent", "[CSGO Classy]", g_szName[id], Skin, 100 - wChance);
					}
					else
					{
						client_print_color(MaxClients, id, "\x04%s\x01 %L", "[CSGO Classy]", -1, "DROP_SUCCES", g_szName[id], Skin, 100 - wChance);
					}
				}
				new var3;
				if (random_num(1, 100) <= 5 && !g_bIsWeaponStattrack[id][skinID])
				{
					g_bIsWeaponStattrack[id][skinID] = true;
					client_print_color(id, id, "\x04%s\x01 \x04%s\x01 opened \x04StatTrack (TM) %s\x01 with a \x04chance of %d percent", "[CSGO Classy]", g_szName[id], Skin, 100 - wChance);
				}
				client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", -1, "DROP_SUCCES", g_szName[id], Skin, 100 - wChance);
			}
		}
		_SaveData(id);
		_ShowOpenCaseCraftMenu(id);
	}
	return 0;
}

_CraftSkin(id)
{
	new iSysTime = get_systime(MaxClients);
	new iDelay = iSysTime - g_iOpenDelay[id];
	if (iDelay < 3)
	{
		return 0;
	}
	g_iOpenDelay[id] = iSysTime;
	new bool:succes;
	new rSkin;
	new rChance;
	new skinID;
	new wChance;
	new bool:bNoSkinSelected = 1;
	while (bNoSkinSelected)
	{
		rSkin = random_num(MaxClients, g_iCraftSkinNum + -1);
		rChance = random_num(1, 100);
		if (g_iCraftSkinNum <= 0)
		{
			client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", -1, "NO_CRAFT_SKINS");
			_ShowOpenCaseCraftMenu(id);
			return 0;
		}
		skinID = ArrayGetCell(g_aCraftSkin, rSkin, MaxClients, MaxClients);
		wChance = ArrayGetCell(g_aSkinChance, skinID, MaxClients, MaxClients);
		if (rChance >= wChance)
		{
			succes = true;
		}
		if (succes)
		{
			bNoSkinSelected = false;
			new Skin[32];
			ArrayGetString(g_aSkinName, skinID, Skin, "");
			if (5 <= g_iUserSkins[id][skinID])
			{
				new iRandomValue = random_num(MaxClients, 1);
				new bool:bScrapsInstead = iRandomValue == 1;
				new iValue = 1;
				if (bScrapsInstead)
				{
					new var4 = g_iUserScraps[id];
					var4 = var4[iValue];
				}
				else
				{
					iValue = ArrayGetCell(g_aSkinCostMin, skinID, MaxClients, MaxClients) / 4;
					new var5 = g_iUserMoney[id];
					var5 = var5[iValue];
				}
				g_iUserScraps[id] -= g_iCraftCost;
				new var1;
				if (bScrapsInstead)
				{
					var1 = 398896;
				}
				else
				{
					var1 = 398924;
				}
				client_print_color(id, id, "\x04%s\x01 Since you already have\x04 5 pieces of %s\x01 you got\x04 %d%s\x01 instead", "[CSGO Classy]", Skin, iValue, var1);
			}
			else
			{
				if (g_iShowDropCraft > 0)
				{
					new var2;
					if (random_num(1, 100) <= 5 && !g_bIsWeaponStattrack[id][skinID])
					{
						g_bIsWeaponStattrack[id][skinID] = true;
						client_print_color(MaxClients, id, "\x04%s\x01 \x04%s\x01 crafted \x04StatTrack (TM) %s\x01 with a \x04chance of %d percent", "[CSGO Classy]", g_szName[id], Skin, 100 - wChance);
					}
					else
					{
						client_print_color(MaxClients, id, "\x04%s\x01 %L", "[CSGO Classy]", -1, "CRAFT_SUCCES", g_szName[id], Skin, 100 - wChance);
					}
				}
				else
				{
					new var3;
					if (random_num(1, 100) <= 5 && !g_bIsWeaponStattrack[id][skinID])
					{
						g_bIsWeaponStattrack[id][skinID] = true;
						client_print_color(id, id, "\x04%s\x01 \x04%s\x01 crafted \x04StatTrack (TM) %s\x01 with a \x04chance of %d percent", "[CSGO Classy]", g_szName[id], Skin, 100 - wChance);
					}
					client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", -1, "CRAFT_SUCCES", g_szName[id], Skin, 100 - wChance);
				}
				g_iUserSkins[id][skinID]++;
				g_iUserScraps[id] -= g_iCraftCost;
			}
			_SaveData(id);
			_ShowOpenCaseCraftMenu(id);
		}
	}
	return 0;
}

_ShowMarketMenu(id)
{
	new temp[96];
	formatex(temp, 95, "\r%s \w%L", "[CSGO Classy]", id, "MARKET_MENU", g_iUserMoney[id]);
	new menu = menu_create(temp, "market_menu_handler", MaxClients);
	new szItem[10];
	szItem[1] = 0;
	new szSkin[48];
	if (!_IsGoodItem(g_iUserSellItem[id]))
	{
		formatex(temp, 95, "\w%L", id, "SELECT_ITEM");
	}
	else
	{
		_GetItemName(g_iUserSellItem[id], szSkin, 47);
		new var1;
		if (g_bPublishedStattrackSkin[id])
		{
			var1 = 400220;
		}
		else
		{
			var1 = 400284;
		}
		formatex(temp, 95, "\r%s\w%s \r[%d$]", var1, szSkin, g_iUserItemPrice[id]);
	}
	szItem[0] = 33;
	menu_additem(menu, temp, szItem, MaxClients, -1);
	if (g_bUserSell[id])
	{
		formatex(temp, 95, "\r%L\n", id, "CANCEL_SELL");
		szItem[0] = 35;
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	else
	{
		formatex(temp, 95, "\r%L\n", id, "START_SELL");
		szItem[0] = 34;
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	new Pl[32];
	new n;
	new p;
	get_players(Pl, n, 400428, 400436);
	if (n)
	{
		new items;
		new sType[4];
		new bool:craft;
		new i;
		while (i < n)
		{
			p = Pl[i];
			if (g_bLogged[p] == true)
			{
				if (!id == p)
				{
					if (g_bUserSell[p])
					{
						new index = g_iUserSellItem[p];
						_GetItemName(index, szSkin, 47);
						if (_IsItemSkin(index))
						{
							ArrayGetString(g_aSkinType, index, sType, 3);
						}
						else
						{
							formatex(sType, 3, 400440);
						}
						if (equali(sType, 400448, MaxClients))
						{
							craft = true;
						}
						else
						{
							craft = false;
						}
						new crafted[64];
						if (craft)
						{
							crafted = {0};
						}
						else
						{
							crafted = {0};
						}
						new var2;
						if (g_bPublishedStattrackSkin[p])
						{
							var2 = 400560;
						}
						else
						{
							var2 = 400624;
						}
						formatex(temp, 95, "\w%s - \r%s\w%s \r[%d$]", g_szName[p], var2, szSkin, g_iUserItemPrice[p]);
						szItem[0] = p;
						menu_additem(menu, temp, szItem, MaxClients, -1);
						items++;
					}
				}
			}
			i++;
		}
		if (!items)
		{
			formatex(temp, 95, "\r%L", id, "NOBODY_SELL");
			num_to_str(2000, szItem, 9);
			menu_additem(menu, temp, szItem, MaxClients, -1);
		}
	}
	menu_display(id, menu, MaxClients, -1);
	return 0;
}

bool:_IsItemSkin(item)
{
	if (0 <= item < g_iSkinsNum)
	{
		return true;
	}
	return false;
}

bool:_IsGoodItem(item)
{
	new var1;
	if (0 <= item < g_iSkinsNum || item == -11 || item == -12)
	{
		return true;
	}
	return false;
}

public market_menu_handler(id, menu, item)
{
	if (item == -3)
	{
		_ShowMainMenu(id);
		menu_destroy(menu);
		return 1;
	}
	new itemdata[2];
	new dummy;
	new index;
	menu_item_getinfo(menu, item, dummy, itemdata, 1, 400696, MaxClients, dummy);
	index = itemdata[0];
	switch (index)
	{
		case 33:
		{
			if (g_bUserSell[id])
			{
				new Item[50];
				_GetItemName(g_iUserSellItem[id], Item, 49);
				if (g_bPublishedStattrackSkin[id])
				{
					format(Item, 49, "StatTrack (TM) %s", Item);
				}
				_ShowMarketMenu(id);
			}
			else
			{
				_ShowItems(id);
			}
		}
		case 34:
		{
			if (!_UserHasItem(id, g_iUserSellItem[id]))
			{
				client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "MUST_SELECT");
				_ShowMarketMenu(id);
			}
			else
			{
				if (g_iUserItemPrice[id] < 1)
				{
					new Item[50];
					_GetItemName(g_iUserSellItem[id], Item, 49);
					if (g_bPublishedStattrackSkin[id])
					{
						format(Item, 49, "StatTrack (TM) %s", Item);
					}
					client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "ITEM_SET_PRICE", Item);
					_ShowMarketMenu(id);
				}
				new wPriceMin;
				new wPriceMax;
				_CalcItemPrice(g_iUserSellItem[id], id, wPriceMin, wPriceMax);
				if (!wPriceMin <= g_iUserItemPrice[id] <= wPriceMax)
				{
					client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "ITEM_INFO", wPriceMin, wPriceMax);
					_ShowMarketMenu(id);
					return 1;
				}
				publicItemOnMarket(id, g_bPublishedStattrackSkin[id]);
			}
		}
		case 35:
		{
			g_bUserSell[id] = 0;
			g_iUserSellItem[id] = -1;
			g_bPublishedStattrackSkin[id] = 0;
			client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "CANCEL_SELL_M");
			_ShowMarketMenu(id);
		}
		case 2000:
		{
			client_print_color(id, id, "\x04%s\x01 You do not have any skins.", "[CSGO Classy]");
			_ShowMarketMenu(id);
			menu_destroy(menu);
			return 1;
		}
		default:
		{
			new var1;
			if (!index || index > 32)
			{
				client_print_color(id, id, "\x04%s\x01 There are \x04no skins\x01 on the \x04Market", "[CSGO Classy]");
				_ShowMarketMenu(id);
			}
			else
			{
				if (!g_bLogged[index])
				{
					client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "INVALID_SELLER");
					g_bUserSell[index] = 0;
					_ShowMarketMenu(id);
				}
				new tItem = g_iUserSellItem[index];
				new price = g_iUserItemPrice[index];
				if (!_UserHasItem(index, tItem))
				{
					client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "DONT_HAVE_ITEM");
					g_bUserSell[index] = 0;
					g_iUserSellItem[index] = -1;
					_ShowMarketMenu(id);
					return 1;
				}
				if (g_iUserMoney[id] < price)
				{
					client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "NOT_ENOUGH_MONEY", price - g_iUserMoney[id]);
					_ShowMarketMenu(id);
					return 1;
				}
				if (5 <= g_iUserSkins[id][tItem])
				{
					client_print_color(id, id, "\x04%s\x01 You can not buy this item anymore, you already have\x04 5 out of 5", "[CSGO Classy]");
					_ShowMarketMenu(id);
					return 1;
				}
				if (_UserHasItem(index, tItem))
				{
					new szItem[32];
					_GetItemName(g_iUserSellItem[index], szItem, 31);
					g_iUserSkins[id][tItem]++;
					g_iUserSkins[index][tItem]--;
					g_iUserMoney[id] -= price;
					new var2 = g_iUserMoney[index];
					var2 = var2[price];
					checkInstantDefault(index, tItem);
					if (g_bPublishedStattrackSkin[index])
					{
						g_bIsWeaponStattrack[id][tItem] = true;
						g_bIsWeaponStattrack[index][tItem] = false;
						g_iUserStattrackKillCount[index][tItem] = 0;
						g_bPublishedStattrackSkin[index] = 0;
						client_print_color(MaxClients, MaxClients, "\x04%s\x01 \x04%s\x01 bought \x04StatTrack (TM) %s\x01 from \x04%s", "[CSGO Classy]", g_szName[id], szItem, g_szName[index]);
					}
					else
					{
						client_print_color(MaxClients, MaxClients, "\x04%s\x01 %L", "[CSGO Classy]", -1, "ITEM_BOUGHT", g_szName[id], szItem, g_szName[index]);
					}
					_SaveData(id);
					_SaveData(index);
					g_iUserSellItem[index] = -1;
					g_bUserSell[index] = 0;
					g_iUserItemPrice[index] = 0;
					_ShowMarketMenu(id);
				}
			}
		}
	}
	menu_destroy(menu);
	return 1;
}

publicItemOnMarket(id, bool:bPublicStt)
{
	g_bUserSell[id] = 1;
	g_iLastPlace[id] = get_systime(MaxClients);
	new Item[32];
	_GetItemName(g_iUserSellItem[id], Item, 31);
	if (bPublicStt)
	{
		client_print_color(MaxClients, id, "\x04%s\x01 \x04%s\x01 is selling \x04StatTrack (TM) %s\x01 for\x04 %d$", "[CSGO Classy]", g_szName[id], Item, g_iUserItemPrice[id]);
	}
	else
	{
		client_print_color(MaxClients, id, "\x04%s %L", "[CSGO Classy]", id, "SELL_ANNOUNCE", g_szName[id], Item, g_iUserItemPrice[id]);
	}
	return 0;
}

_ShowItems(id)
{
	if (notAnySkins(id))
	{
		_ShowMainMenu(id);
		return 0;
	}
	_ShowSkinMenu(id);
	return 0;
}

openSellMenu(id, iWeaponId)
{
	new temp[64];
	formatex(temp, 63, "\r%s \w%L", "[CSGO Classy]", id, "INVENTORY");
	new menu = menu_create(temp, "item_menu_handler", MaxClients);
	new szItem[10];
	szItem[1] = 0;
	new total;
	new szSkin[32];
	new num;
	new type[2];
	new i;
	new wid;
	while (i < g_iSkinsNum)
	{
		num = g_iUserSkins[id][i];
		if (num > 0)
		{
			wid = ArrayGetCell(g_aSkinWeaponID, i, MaxClients, MaxClients);
			if (iWeaponId != wid)
			{
				i++;
			}
			ArrayGetString(g_aSkinName, i, szSkin, "");
			ArrayGetString(g_aSkinType, i, type, 1);
			new applied[64];
			switch (type[0])
			{
				case 99:
				{
					applied = {0};
				}
				default:
				{
					applied = {0};
				}
			}
			new var1;
			if (g_bIsWeaponStattrack[id][i])
			{
				var1 = 403640;
			}
			else
			{
				var1 = 403704;
			}
			formatex(temp, 63, "\r%s\w%s \r[%d]", var1, szSkin, num);
			num_to_str(i, szItem, 9);
			menu_additem(menu, temp, szItem, MaxClients, -1);
			total++;
		}
		i++;
	}
	if (!total)
	{
		formatex(temp, 63, "\d%L", id, "NO_ITEMS");
		num_to_str(2000, szItem, 9);
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	menu_display(id, menu, MaxClients, -1);
	return 0;
}

public item_menu_handler(id, menu, item)
{
	if (item == -3)
	{
		_ShowMarketMenu(id);
		menu_destroy(menu);
		return 1;
	}
	new itemdata[5];
	new dummy;
	new index;
	menu_item_getinfo(menu, item, dummy, itemdata, NULL_STRING, 403764, MaxClients, dummy);
	index = str_to_num(itemdata);
	if (index == 2000)
	{
		_ShowMarketMenu(id);
		return 1;
	}
	if (ArrayGetCell(g_aSkinWeaponID, index, MaxClients, MaxClients) != g_iWeaponIdToCheck[id])
	{
		_ShowMarketMenu(id);
		menu_destroy(menu);
		return 1;
	}
	g_iUserSellItem[id] = index;
	new szItem[50];
	_GetItemName(index, szItem, 49);
	if (g_bIsWeaponStattrack[id][index])
	{
		if (1 < g_iUserSkins[id][index])
		{
			askWhichType(id, index);
			g_iAskType[id] = 1;
			return 1;
		}
		g_bPublishedStattrackSkin[id] = 1;
		format(szItem, 49, "StatTrack (TM) %s", szItem);
	}
	else
	{
		g_bPublishedStattrackSkin[id] = 0;
	}
	client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "ITEM_SELECT", szItem);
	client_cmd(id, "messagemode SkinPrice");
	client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "ITEM_SET_PRICE", szItem);
	menu_destroy(menu);
	return 1;
}

public concmd_itemprice(id)
{
	new item = g_iUserSellItem[id];
	if (!_IsGoodItem(item))
	{
		return 1;
	}
	new data[16];
	read_args(data, 15);
	remove_quotes(data);
	new uPrice;
	new wPriceMin;
	new wPriceMax;
	uPrice = str_to_num(data);
	_CalcItemPrice(item, id, wPriceMin, wPriceMax);
	new var1;
	if (uPrice < wPriceMin || uPrice > wPriceMax)
	{
		client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "ITEM_INFO", wPriceMin, wPriceMax);
		client_cmd(id, "messagemode SkinPrice");
		return 1;
	}
	g_iUserItemPrice[id] = uPrice;
	_ShowMarketMenu(id);
	return 1;
}

bool:_UserHasItem(id, item)
{
	if (!_IsGoodItem(item))
	{
		return false;
	}
	switch (item)
	{
		default:
		{
			if (g_iUserSkins[id][item] > 0)
			{
				return true;
			}
			return false;
		}
	}
}

_CalcItemPrice(item, id, &min, &max)
{
	switch (item)
	{
		default:
		{
			min = ArrayGetCell(g_aSkinCostMin, item, MaxClients, MaxClients);
			new i = min;
			new var1;
			if (g_bIsWeaponStattrack[id][item] && g_bPublishedStattrackSkin[id])
			{
				min = min * 2;
				i *= 2;
			}
			max = i * 2;
			return 0;
		}
	}
}

_ShowDustbinMenu(id)
{
	new temp[64];
	formatex(temp, 63, "\r%s \w%L", "[CSGO Classy]", id, "DESTROY_MENU");
	new menu = menu_create(temp, "dustbin_menu_handler", MaxClients);
	new szItem[2];
	szItem[1] = 0;
	formatex(temp, 63, "\w%L\n\dDestroy skins to get scraps", id, "GET_SCRAPS");
	szItem[0] = 1;
	menu_additem(menu, temp, szItem, MaxClients, -1);
	formatex(temp, 63, "\w%L\n\dDestroy skins to get money", id, "GET_MONEY");
	szItem[0] = 2;
	menu_additem(menu, temp, szItem, MaxClients, -1);
	menu_display(id, menu, MaxClients, -1);
	return 0;
}

public dustbin_menu_handler(id, menu, item)
{
	if (item == -3)
	{
		_ShowMainMenu(id);
		menu_destroy(menu);
		return 1;
	}
	new itemdata[2];
	new dummy;
	new index;
	menu_item_getinfo(menu, item, dummy, itemdata, 1, 405020, MaxClients, dummy);
	index = itemdata[0];
	new i;
	new total;
	new num;
	while (i < g_iSkinsNum)
	{
		num = g_iUserSkins[id][i];
		if (num > 0)
		{
			total++;
		}
		i++;
	}
	if (!total)
	{
		_ShowMainMenu(id);
		menu_destroy(menu);
		return 1;
	}
	g_iMenuType[id] = index;
	_ShowSkins(id);
	menu_destroy(menu);
	return 1;
}

_ShowSkins(id)
{
	if (notAnySkins(id))
	{
		_ShowMainMenu(id);
		return 0;
	}
	_ShowSkinMenu(id);
	return 0;
}

openDustbinSkins(id, iWeaponId)
{
	new temp[64];
	formatex(temp, 63, "\r%s \w%L", "[CSGO Classy]", id, "INVENTORY");
	new menu = menu_create(temp, "db_skins_menu_handler", MaxClients);
	new szItem[10];
	szItem[1] = 0;
	new szSkin[32];
	new num;
	new type[2];
	new total;
	new i;
	new wid;
	while (i < g_iSkinsNum)
	{
		num = g_iUserSkins[id][i];
		if (num > 0)
		{
			wid = ArrayGetCell(g_aSkinWeaponID, i, MaxClients, MaxClients);
			if (iWeaponId != wid)
			{
				i++;
			}
			ArrayGetString(g_aSkinName, i, szSkin, "");
			ArrayGetString(g_aSkinType, i, type, 1);
			new applied[64];
			switch (type[0])
			{
				case 99:
				{
					applied = {0};
				}
				default:
				{
					applied = {0};
				}
			}
			new var1;
			if (g_bIsWeaponStattrack[id][i])
			{
				var1 = 405320;
			}
			else
			{
				var1 = 405384;
			}
			formatex(temp, 63, "\r%s\w%s \r[%d]", var1, szSkin, num);
			num_to_str(i, szItem, 9);
			menu_additem(menu, temp, szItem, MaxClients, -1);
			total++;
		}
		i++;
	}
	if (!total)
	{
		formatex(temp, 63, "\r%L", id, "NO_ITEMS");
		num_to_str(2000, szItem, 9);
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	menu_display(id, menu, MaxClients, -1);
	return 0;
}

public db_skins_menu_handler(id, menu, item)
{
	if (item == -3)
	{
		_ShowSkinMenu(id);
		menu_destroy(menu);
		return 1;
	}
	new itemdata[5];
	new dummy;
	new index;
	menu_item_getinfo(menu, item, dummy, itemdata, NULL_STRING, 405444, MaxClients, dummy);
	index = str_to_num(itemdata);
	if (index == 2000)
	{
		_ShowSkinMenu(id);
		menu_destroy(menu);
		return 1;
	}
	if (g_iUserSellItem[id] == index)
	{
		new Item[50];
		_GetItemName(g_iUserSellItem[id], Item, 49);
		if (g_bPublishedStattrackSkin[id])
		{
			format(Item, 49, "Stattrack (TM) %s", Item);
		}
		client_print_color(id, id, "\x04%s\x01 You are \x04currently selling\x01 that \x04skin\x01, you \x04can not\x01 destroy it", "[CSGO Classy]", Item);
		_ShowDustbinMenu(id);
		menu_destroy(menu);
		return 1;
	}
	if (g_bIsWeaponStattrack[id][index])
	{
		if (1 <= g_iMenuType[id] <= 2)
		{
			if (1 < g_iUserSkins[id][index])
			{
				askWhichType(id, index);
				g_iAskType[id] = 3;
				return 1;
			}
			g_bDestroyStt[id] = 1;
		}
	}
	if (ArrayGetCell(g_aSkinWeaponID, index, MaxClients, MaxClients) != g_iWeaponIdToCheck[id])
	{
		_ShowSkins(id);
		menu_destroy(menu);
		return 1;
	}
	destroySkin(id, index);
	_ShowDustbinMenu(id);
	menu_destroy(menu);
	return 1;
}

destroySkin(id, index)
{
	switch (g_iMenuType[id])
	{
		case 1:
		{
			g_iUserSkins[id][index]--;
			new Skin[32];
			ArrayGetString(g_aSkinName, index, Skin, "");
			if (g_bDestroyStt[id])
			{
				g_iDustForTransform = 5;
				client_print_color(id, id, "\x04%s\x01 You got\x04 %d scraps\x01 out of \x04StatTrack (TM) %s", "[CSGO Classy]", g_iDustForTransform, Skin);
				g_iUserStattrackKillCount[id][index] = 0;
				g_bIsWeaponStattrack[id][index] = false;
			}
			else
			{
				client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "TRANSFORM", g_iDustForTransform, Skin);
			}
			client_cmd(id, "spk items/gunpickup2.wav");
			new var2 = g_iUserScraps[id];
			var2 = var2[g_iDustForTransform];
			g_iDustForTransform = 1;
			_SaveData(id);
		}
		case 2:
		{
			g_iUserSkins[id][index]--;
			new Skin[32];
			ArrayGetString(g_aSkinName, index, Skin, "");
			new sPrice = ArrayGetCell(g_aSkinCostMin, index, MaxClients, MaxClients);
			new rest = sPrice / g_iReturnPercent;
			client_cmd(id, "spk items/gunpickup2.wav");
			if (g_bDestroyStt[id])
			{
				rest *= 3;
				client_print_color(id, id, "\x04%s\x01 You destroyed your \x04StatTrack (TM) %s\x01 and received\x04 %d$", "[CSGO Classy]", Skin, rest);
				g_iUserStattrackKillCount[id][index] = 0;
				g_bIsWeaponStattrack[id][index] = false;
			}
			else
			{
				client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "DESTROY", Skin, rest);
			}
			new var1 = g_iUserMoney[id];
			var1 = var1[rest];
			_SaveData(id);
		}
		default:
		{
		}
	}
	g_bDestroyStt[id] = 0;
	g_iMenuType[id] = 0;
	return 0;
}

_ShowGiftMenu(id)
{
	new temp[64];
	formatex(temp, 63, "\r%s \w%L", "[CSGO Classy]", id, "GIFT_MENU");
	new menu = menu_create(temp, "gift_menu_handler", MaxClients);
	new bool:HasTarget;
	new bool:HasItem;
	new target = g_iGiftTarget[id];
	if (target)
	{
		formatex(temp, 63, "\w%L", id, "GIFT_TARGET", g_szName[target]);
		menu_additem(menu, temp, 381156, MaxClients, -1);
		HasTarget = true;
	}
	else
	{
		formatex(temp, 63, "\r%L", id, "GIFT_SELECT_TARGET");
		menu_additem(menu, temp, 381156, MaxClients, -1);
	}
	if (!_IsGoodItem(g_iGiftItem[id]))
	{
		formatex(temp, 63, "\r%L\n", id, "GIFT_SELECT_ITEM");
		menu_additem(menu, temp, 381156, MaxClients, -1);
	}
	else
	{
		new Item[32];
		_GetItemName(g_iGiftItem[id], Item, 31);
		new var1;
		if (g_bGiftingStt[id])
		{
			var1 = 407376;
		}
		else
		{
			var1 = 407440;
		}
		formatex(temp, 63, "\r%s\w%s\n", var1, Item);
		menu_additem(menu, temp, 381156, MaxClients, -1);
		HasItem = true;
	}
	new var2;
	if (HasTarget && HasItem)
	{
		formatex(temp, 63, "\r%L", id, "GIFT_SEND");
		menu_additem(menu, temp, 381156, MaxClients, -1);
	}
	menu_display(id, menu, MaxClients, -1);
	return 0;
}

public gift_menu_handler(id, menu, item)
{
	if (item == -3)
	{
		_ShowMainMenu(id);
		menu_destroy(menu);
		return 1;
	}
	switch (item)
	{
		case 0:
		{
			_SelectTarget(id);
		}
		case 1:
		{
			_SelectItem(id);
		}
		case 2:
		{
			new target = g_iGiftTarget[id];
			new _item = g_iGiftItem[id];
			new var2;
			if (g_bLogged[target] == true && (0 < target && 32 >= target))
			{
				client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "INVALID_TARGET");
				g_iGiftTarget[id] = 0;
				_ShowGiftMenu(id);
			}
			else
			{
				if (!_UserHasItem(id, _item))
				{
					client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "NO_LONGER");
					g_iGiftItem[id] = -1;
					_ShowGiftMenu(id);
				}
				giftPlayer(id, target, _item);
				g_iGiftTarget[id] = 0;
				g_iGiftItem[id] = -1;
			}
		}
		default:
		{
		}
	}
	menu_destroy(menu);
	return 1;
}

giftPlayer(id, target, iSkin)
{
	if (5 <= g_iUserSkins[target][iSkin])
	{
		client_print_color(id, id, "\x04%s\x01 \x04%s\x01 can not receive that skin anymore, he already have\x04 5 out of 5", "[CSGO Classy]", g_szName[target]);
		_ShowGiftMenu(id);
		return 1;
	}
	new Skin[32];
	_GetItemName(iSkin, Skin, 31);
	if (g_bGiftingStt[id])
	{
		client_print_color(id, id, "\x04%s\x01 You gifted your \x04StatTrack (TM) %s\x01 to\x04 %s", "[CSGO Classy]", Skin, g_szName[target]);
		client_print_color(target, target, "\x04%s\x01 You received a \x04gift\x01 from\x04 %s \x01containing\x04 StatTrack (TM) %s", "[CSGO Classy]", g_szName[id], Skin);
		g_iUserStattrackKillCount[id][iSkin] = 0;
		g_bIsWeaponStattrack[id][iSkin] = false;
		g_bIsWeaponStattrack[target][iSkin] = true;
	}
	else
	{
		client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "SEND_GIFT", Skin, g_szName[target]);
		client_print_color(target, target, "\x04%s\x01 %L", "[CSGO Classy]", target, "RECEIVE_GIFT", g_szName[id], Skin);
	}
	g_iUserSkins[id][iSkin]--;
	g_iUserSkins[target][iSkin]++;
	checkInstantDefault(id, iSkin);
	g_bGiftingStt[id] = 0;
	_SaveData(id);
	_SaveData(target);
	return 1;
}

_SelectTarget(id)
{
	new temp[64];
	formatex(temp, 63, "\r%s \y%L", "[CSGO Classy]", id, "GIFT_SELECT_TARGET");
	new menu = menu_create(temp, "st_menu_handler", MaxClients);
	new szItem[10];
	szItem[1] = 0;
	new Pl[32];
	new n;
	new p;
	get_players(Pl, n, 409204, 409212);
	new total;
	if (n)
	{
		new i;
		while (i < n)
		{
			p = Pl[i];
			if (g_bLogged[p])
			{
				if (!id == p)
				{
					szItem[0] = p;
					menu_additem(menu, g_szName[p], szItem, MaxClients, -1);
					total++;
				}
			}
			i++;
		}
	}
	if (!total)
	{
		formatex(temp, 63, "\r%L", id, "NO_REGISTERED_PLAYERS");
		num_to_str(2000, szItem, 9);
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	menu_display(id, menu, MaxClients, -1);
	return 0;
}

public st_menu_handler(id, menu, item)
{
	if (item == -3)
	{
		_ShowGiftMenu(id);
		menu_destroy(menu);
		return 1;
	}
	new itemdata[2];
	new dummy;
	new index;
	new name[32];
	menu_item_getinfo(menu, item, dummy, itemdata, 1, name, "", dummy);
	index = itemdata[0];
	switch (index)
	{
		case 2000:
		{
			_ShowGiftMenu(id);
			menu_destroy(menu);
			return 1;
		}
		default:
		{
			g_iGiftTarget[id] = index;
			client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "GIFT_YOUR_TARGET", name);
			_ShowGiftMenu(id);
			menu_destroy(menu);
			return 1;
		}
	}
}

_SelectItem(id)
{
	if (notAnySkins(id))
	{
		_ShowMainMenu(id);
		return 0;
	}
	_ShowSkinMenu(id);
	return 0;
}

openGiftMenu(id, iWeaponId)
{
	new temp[64];
	formatex(temp, 63, "\r%s \w%L", "[CSGO Classy]", id, "INVENTORY");
	new menu = menu_create(temp, "si_menu_handler", MaxClients);
	new szItem[10];
	szItem[1] = 0;
	new total;
	new szSkin[32];
	new num;
	new type[2];
	new i;
	new wid;
	while (i < g_iSkinsNum)
	{
		num = g_iUserSkins[id][i];
		if (num > 0)
		{
			wid = ArrayGetCell(g_aSkinWeaponID, i, MaxClients, MaxClients);
			if (iWeaponId != wid)
			{
				i++;
			}
			ArrayGetString(g_aSkinName, i, szSkin, "");
			ArrayGetString(g_aSkinType, i, type, 1);
			new var1;
			if (g_bIsWeaponStattrack[id][i])
			{
				var1 = 409744;
			}
			else
			{
				var1 = 409808;
			}
			formatex(temp, 63, "\r%s\w%s \r[%d]", var1, szSkin, num);
			num_to_str(i, szItem, 9);
			menu_additem(menu, temp, szItem, MaxClients, -1);
			total++;
		}
		i++;
	}
	if (!total)
	{
		formatex(temp, 63, "\r%L", id, "NO_ITEMS");
		num_to_str(2000, szItem, 9);
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	menu_display(id, menu, MaxClients, -1);
	return 0;
}

public si_menu_handler(id, menu, item)
{
	if (item == -3)
	{
		_ShowMainMenu(id);
		menu_destroy(menu);
		return 1;
	}
	new itemdata[5];
	new dummy;
	new index;
	menu_item_getinfo(menu, item, dummy, itemdata, NULL_STRING, 409868, MaxClients, dummy);
	index = str_to_num(itemdata);
	switch (index)
	{
		case 2000:
		{
			_ShowGiftMenu(id);
			menu_destroy(menu);
			return 1;
		}
		default:
		{
			new var1;
			if (g_iUserSellItem[id] == index && g_bUserSell[id])
			{
				new Item[50];
				_GetItemName(g_iUserSellItem[id], Item, 49);
				if (g_bPublishedStattrackSkin[id])
				{
					format(Item, 49, "StatTrack (TM) %s", Item);
				}
				client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "INVALID_GIFT", Item);
				_SelectItem(id);
			}
			else
			{
				if (ArrayGetCell(g_aSkinWeaponID, index, MaxClients, MaxClients) != g_iWeaponIdToCheck[id])
				{
					_ShowGiftMenu(id);
					menu_destroy(menu);
					return 1;
				}
				g_iGiftItem[id] = index;
				if (g_bIsWeaponStattrack[id][index])
				{
					if (1 < g_iUserSkins[id][index])
					{
						askWhichType(id, index);
						g_iAskType[id] = 2;
						return 1;
					}
					g_bGiftingStt[id] = 1;
					_ShowGiftMenu(id);
				}
				g_bGiftingStt[id] = 0;
				new szItem[32];
				_GetItemName(index, szItem, 31);
				client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "GIFT_YOUR_GIFT", szItem);
				_ShowGiftMenu(id);
			}
			menu_destroy(menu);
			return 1;
		}
	}
}

_ShowTradeMenu(id)
{
	if (g_bTradeAccept[id])
	{
		client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "TRADE_INFO2");
		return 0;
	}
	new temp[64];
	formatex(temp, 63, "\r%s \w%L", "[CSGO Classy]", id, "TRADE_MENU");
	new menu = menu_create(temp, "trade_menu_handler", MaxClients);
	new szItem[2];
	szItem[1] = 0;
	new bool:HasTarget;
	new bool:HasItem;
	new target = g_iTradeTarget[id];
	if (target)
	{
		formatex(temp, 63, "\w%L", id, "GIFT_TARGET", g_szName[target]);
		szItem[0] = 0;
		menu_additem(menu, temp, szItem, MaxClients, -1);
		HasTarget = true;
	}
	else
	{
		formatex(temp, 63, "\r%L", id, "GIFT_SELECT_TARGET");
		szItem[0] = 0;
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	if (!_IsGoodItem(g_iTradeItem[id]))
	{
		formatex(temp, 63, "\r%L\n", id, "GIFT_SELECT_ITEM");
		szItem[0] = 1;
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	else
	{
		new Item[32];
		_GetItemName(g_iTradeItem[id], Item, 31);
		new var1;
		if (g_bTradingStt[id])
		{
			var1 = 410880;
		}
		else
		{
			var1 = 410944;
		}
		formatex(temp, 63, "\r%s\w%s\n", var1, Item);
		szItem[0] = 1;
		menu_additem(menu, temp, szItem, MaxClients, -1);
		HasItem = true;
	}
	new var2;
	if (HasTarget && HasItem)
	{
		formatex(temp, 63, "\r%L", id, "TRADE_SEND_OFFER");
		szItem[0] = 2;
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	new var3;
	if (g_bTradeActive[id] || g_bTradeSecond[id])
	{
		formatex(temp, 63, "\r%L", id, "TRADE_CANCEL");
		szItem[0] = 3;
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	menu_display(id, menu, MaxClients, -1);
	return 0;
}

public trade_menu_handler(id, menu, item)
{
	if (item == -3)
	{
		if (g_bTradeSecond[id])
		{
			clcmd_say_deny(id);
		}
		_ShowMainMenu(id);
		menu_destroy(menu);
		return 1;
	}
	new itemdata[2];
	new dummy;
	new index;
	menu_item_getinfo(menu, item, dummy, itemdata, 1, 411108, MaxClients, dummy);
	index = itemdata[0];
	switch (index)
	{
		case 0:
		{
			new var5;
			if (g_bTradeActive[id] || g_bTradeSecond[id])
			{
				client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "TRADE_LOCKED");
				_ShowTradeMenu(id);
			}
			else
			{
				_SelectTradeTarget(id);
			}
		}
		case 1:
		{
			new var4;
			if (g_bTradeActive[id] && !g_bTradeSecond[id])
			{
				client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "TRADE_LOCKED");
				_ShowTradeMenu(id);
			}
			else
			{
				_SelectTradeItem(id);
			}
		}
		case 2:
		{
			new target = g_iTradeTarget[id];
			new _item = g_iTradeItem[id];
			new var2;
			if (!g_bLogged[target] || (0 < target && 32 >= target))
			{
				client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "INVALID_TARGET");
				_ResetTradeData(id);
				_ShowTradeMenu(id);
			}
			else
			{
				if (!_UserHasItem(id, _item))
				{
					client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "NO_LONGER");
					g_iTradeItem[id] = -1;
					_ShowTradeMenu(id);
					return 1;
				}
				new var3;
				if (g_bTradeSecond[id] && !_UserHasItem(target, g_iTradeItem[target]))
				{
					client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "TRADE_FAILED");
					client_print_color(target, target, "\x04%s\x01 %L", "[CSGO Classy]", target, "TRADE_FAILED");
					_ResetTradeData(id);
					_ResetTradeData(target);
					_ShowTradeMenu(id);
					return 1;
				}
				if (5 <= g_iUserSkins[target][_item])
				{
					client_print_color(id, id, "\x04%s\x01 \x04%s\x01 can not receive that skin anymore, he already have\x04 5 out of 5", "[CSGO Classy]", g_szName[target]);
					_ShowGiftMenu(id);
					_ShowTradeMenu(id);
					return 1;
				}
				g_bTradeActive[id] = 1;
				g_iTradeRequest[target] = id;
				new szItem[50];
				_GetItemName(g_iTradeItem[id], szItem, 49);
				if (g_bTradingStt[id])
				{
					format(szItem, 49, "StatTrack (TM) %s", szItem);
				}
				if (!g_bTradeSecond[id])
				{
					client_print_color(target, target, "\x04%s\x01 %L", "[CSGO Classy]", target, "TRADE_INFO1", g_szName[id], szItem);
					client_print_color(target, target, "\x04%s\x01 %L", "[CSGO Classy]", target, "TRADE_INFO2");
				}
				else
				{
					if (5 <= g_iUserSkins[id][_item])
					{
						client_print_color(id, id, "\x04%s\x01 \x04%s\x01 can not receive that skin anymore, he already have\x04 5 out of 5", "[CSGO Classy]", g_szName[id]);
						_ShowTradeMenu(target);
						return 1;
					}
					new yItem[50];
					_GetItemName(g_iTradeItem[target], yItem, 49);
					if (g_bTradingStt[target])
					{
						format(yItem, 49, "StatTrack (TM) %s", yItem);
					}
					client_print_color(target, target, "\x04%s %L", "[CSGO Classy]", target, "TRADE_INFO3", g_szName[id], szItem, yItem);
					client_print_color(target, target, "\x04%s\x01 %L", "[CSGO Classy]", target, "TRADE_INFO2");
					g_bTradeAccept[target] = 1;
				}
				client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "TRADE_SEND", g_szName[target]);
			}
		}
		case 3:
		{
			if (g_bTradeSecond[id])
			{
				clcmd_say_deny(id);
			}
			else
			{
				_ResetTradeData(id);
			}
			client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "TRADE_CANCELED");
			_ShowTradeMenu(id);
		}
		default:
		{
		}
	}
	menu_destroy(menu);
	return 1;
}

_SelectTradeTarget(id)
{
	new temp[64];
	formatex(temp, 63, "\r%s %L", "[CSGO Classy]", id, "GIFT_SELECT_TARGET");
	new menu = menu_create(temp, "tst_menu_handler", MaxClients);
	new szItem[10];
	szItem[1] = 0;
	new Pl[32];
	new n;
	new p;
	get_players(Pl, n, 413840, 413848);
	new total;
	if (n)
	{
		new i;
		while (i < n)
		{
			p = Pl[i];
			if (g_bLogged[p])
			{
				if (!id == p)
				{
					szItem[0] = p;
					menu_additem(menu, g_szName[p], szItem, MaxClients, -1);
					total++;
				}
			}
			i++;
		}
	}
	if (!total)
	{
		formatex(temp, 63, "\r%L", id, "NO_REGISTERED_PLAYERS");
		num_to_str(2000, szItem, 9);
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	menu_display(id, menu, MaxClients, -1);
	return 0;
}

public tst_menu_handler(id, menu, item)
{
	if (item == -3)
	{
		_ShowTradeMenu(id);
		menu_destroy(menu);
		return 1;
	}
	new itemdata[2];
	new dummy;
	new index;
	new name[32];
	menu_item_getinfo(menu, item, dummy, itemdata, 1, name, "", dummy);
	index = itemdata[0];
	switch (index)
	{
		case 2000:
		{
			_ShowMainMenu(id);
			menu_destroy(menu);
			return 1;
		}
		default:
		{
			if (g_iTradeRequest[index])
			{
				client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "TARGET_TRADE_ACTIVE", name);
			}
			else
			{
				g_iTradeTarget[id] = index;
				client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "TRADE_TARGET", name);
			}
			_ShowTradeMenu(id);
			menu_destroy(menu);
			return 1;
		}
	}
}

_SelectTradeItem(id)
{
	if (notAnySkins(id))
	{
		_ShowMainMenu(id);
		return 0;
	}
	_ShowSkinMenu(id);
	return 0;
}

openTradeMenu(id, iWeaponId)
{
	new temp[64];
	formatex(temp, 63, "\r%s \w%L", "[CSGO Classy]", id, "INVENTORY");
	new menu = menu_create(temp, "tsi_menu_handler", MaxClients);
	new szItem[10];
	szItem[1] = 0;
	new total;
	new szSkin[32];
	new num;
	new type[2];
	new i;
	new wid;
	while (i < g_iSkinsNum)
	{
		num = g_iUserSkins[id][i];
		if (num > 0)
		{
			wid = ArrayGetCell(g_aSkinWeaponID, i, MaxClients, MaxClients);
			if (iWeaponId != wid)
			{
				i++;
			}
			ArrayGetString(g_aSkinName, i, szSkin, "");
			ArrayGetString(g_aSkinType, i, type, 1);
			new applied[64];
			switch (type[0])
			{
				case 99:
				{
					applied = {0};
				}
				default:
				{
					applied = {0};
				}
			}
			new var1;
			if (g_bIsWeaponStattrack[id][i])
			{
				var1 = 414544;
			}
			else
			{
				var1 = 414608;
			}
			formatex(temp, 63, "\r%s\w%s \r[%d]", var1, szSkin, num);
			num_to_str(i, szItem, 9);
			menu_additem(menu, temp, szItem, MaxClients, -1);
			total++;
		}
		i++;
	}
	if (!total)
	{
		formatex(temp, 63, "\r%L", id, "NO_ITEMS");
		num_to_str(2000, szItem, 9);
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	menu_display(id, menu, MaxClients, -1);
	return 0;
}

public tsi_menu_handler(id, menu, item)
{
	if (item == -3)
	{
		_ShowTradeMenu(id);
		menu_destroy(menu);
		return 1;
	}
	new itemdata[5];
	new dummy;
	new index;
	menu_item_getinfo(menu, item, dummy, itemdata, NULL_STRING, 414668, MaxClients, dummy);
	index = str_to_num(itemdata);
	switch (index)
	{
		case 2000:
		{
			_ShowTradeMenu(id);
			menu_destroy(menu);
			return 1;
		}
		default:
		{
			new var1;
			if (g_iUserSellItem[id] == index && g_bUserSell[id])
			{
				new Item[50];
				_GetItemName(g_iUserSellItem[id], Item, 49);
				if (g_bPublishedStattrackSkin[id])
				{
					format(Item, 49, "StatTrack (TM) %s", Item);
				}
				client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "TRADE_INVALID_ITEM", Item);
				_SelectTradeItem(id);
			}
			else
			{
				if (ArrayGetCell(g_aSkinWeaponID, index, MaxClients, MaxClients) != g_iWeaponIdToCheck[id])
				{
					_SelectTradeItem(id);
					menu_destroy(menu);
					return 1;
				}
				g_iTradeItem[id] = index;
				if (g_bIsWeaponStattrack[id][index])
				{
					if (1 < g_iUserSkins[id][index])
					{
						askWhichType(id, index);
						g_iAskType[id] = 4;
						return 1;
					}
					g_bTradingStt[id] = 1;
				}
				else
				{
					g_bTradingStt[id] = 0;
				}
				new szItem[32];
				_GetItemName(index, szItem, 31);
				if (g_bTradingStt[id])
				{
					client_print_color(id, id, "\x04%s\x01 You choosed \x04StatTrack (TM) %s\x01 to be offered in the \x04trade offer", "[CSGO Classy]", szItem);
				}
				else
				{
					client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "TRADE_ITEM", szItem);
				}
				_ShowTradeMenu(id);
			}
			menu_destroy(menu);
			return 1;
		}
	}
}

_ResetTradeData(id)
{
	g_bTradeActive[id] = 0;
	g_bTradeSecond[id] = 0;
	g_bTradeAccept[id] = 0;
	g_iTradeTarget[id] = 0;
	g_iTradeItem[id] = -1;
	g_iTradeRequest[id] = 0;
	g_bTradingStt[id] = 0;
	return 0;
}

public clcmd_say_accept(id)
{
	new sender = g_iTradeRequest[id];
	new var1;
	if (1 > sender || 32 < sender)
	{
		client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "DONT_HAVE_TRADE");
		return 1;
	}
	new var3;
	if (!g_bLogged[sender] || (0 < sender && 32 >= sender))
	{
		_ResetTradeData(id);
		client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "TRADE_INVALID_SENDER");
		return 1;
	}
	new var4;
	if (!g_bTradeActive[sender] && g_iTradeTarget[sender] == id)
	{
		client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "TRADE_IS_CANCELED", g_iTradeRequest[id]);
		_ResetTradeData(id);
		return 1;
	}
	if (g_bTradeAccept[id])
	{
		new sItem = g_iTradeItem[sender];
		new tItem = g_iTradeItem[id];
		new var5;
		if (!_UserHasItem(id, tItem) || !_UserHasItem(sender, sItem))
		{
			client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "TRADE_FAILED2");
			client_print_color(sender, sender, "\x04%s\x01 %L", "[CSGO Classy]", sender, "TRADE_FAILED2");
			_ResetTradeData(id);
			_ResetTradeData(sender);
			return 1;
		}
		switch (sItem)
		{
			default:
			{
				g_iUserSkins[id][sItem]++;
				g_iUserSkins[sender][sItem]--;
				switch (tItem)
				{
					default:
					{
						g_iUserSkins[id][tItem]--;
						g_iUserSkins[sender][tItem]++;
						checkInstantDefault(sender, sItem);
						checkInstantDefault(id, tItem);
						new sItemsz[50];
						new tItemsz[50];
						_GetItemName(tItem, tItemsz, 49);
						_GetItemName(sItem, sItemsz, 49);
						if (g_bTradingStt[sender])
						{
							g_bIsWeaponStattrack[sender][sItem] = false;
							g_iUserStattrackKillCount[sender][sItem] = 0;
							g_bIsWeaponStattrack[id][sItem] = true;
							format(sItemsz, 49, "StatTrack (TM) %s", sItemsz);
						}
						if (g_bTradingStt[id])
						{
							g_bIsWeaponStattrack[id][tItem] = false;
							g_iUserStattrackKillCount[id][tItem] = 0;
							g_bIsWeaponStattrack[sender][tItem] = true;
							format(tItemsz, 49, "StatTrack (TM) %s", tItemsz);
						}
						client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "TRADE_SUCCESS", tItemsz, sItemsz);
						client_print_color(sender, sender, "\x04%s\x01 %L", "[CSGO Classy]", sender, "TRADE_SUCCESS", sItemsz, tItemsz);
						g_bTradingStt[id] = 0;
						g_bTradingStt[sender] = 0;
						_ResetTradeData(id);
						_ResetTradeData(sender);
					}
				}
			}
		}
	}
	else
	{
		if (!g_bTradeSecond[id])
		{
			g_iTradeTarget[id] = sender;
			g_iTradeItem[id] = -1;
			g_bTradeSecond[id] = 1;
			g_iMenuToOpen[id] = 6;
			_ShowTradeMenu(id);
		}
	}
	_SaveData(id);
	_SaveData(sender);
	return 1;
}

public clcmd_say_deny(id)
{
	new sender = g_iTradeRequest[id];
	new var1;
	if (sender < 1 || sender > 32)
	{
		client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "DONT_HAVE_TRADE");
		return 1;
	}
	new var3;
	if (!g_bLogged[sender] || (0 < sender && 32 >= sender))
	{
		_ResetTradeData(id);
		client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "TRADE_INVALID_SENDER");
		return 1;
	}
	new var4;
	if (!g_bTradeActive[sender] && g_iTradeTarget[sender] == id)
	{
		client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "TRADE_IS_CANCELED");
		_ResetTradeData(id);
		return 1;
	}
	_ResetTradeData(id);
	_ResetTradeData(sender);
	client_print_color(sender, sender, "\x04%s\x01 %L", "[CSGO Classy]", sender, "TRADE_REFUSE_TARGET", g_szName[id]);
	client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "TRADE_REFUSE_SENDER", g_szName[sender]);
	return 1;
}

_ShowGamesMenu(id)
{
	new temp[64];
	formatex(temp, 63, "\r%s \w%L", "[CSGO Classy]", id, "GAMBLING");
	new menu = menu_create(temp, "games_menu_handler", MaxClients);
	new szItem[2];
	szItem[1] = 0;
	formatex(temp, 63, "\w%L", id, "GAME_RAFFLE", g_iTombolaCost);
	menu_additem(menu, temp, szItem, MaxClients, -1);
	formatex(temp, 63, "\w%L", id, "GAME_ROULETTE");
	menu_additem(menu, temp, szItem, MaxClients, -1);
	formatex(temp, 63, "\w%L", id, "GAME_JACKPOT");
	menu_additem(menu, temp, szItem, MaxClients, -1);
	formatex(temp, 63, "\w%L", id, "GAME_COINFLIP");
	menu_additem(menu, temp, szItem, MaxClients, -1);
	menu_display(id, menu, MaxClients, -1);
	return 0;
}

public games_menu_handler(id, menu, item)
{
	if (item == -3)
	{
		_ShowMainMenu(id);
		menu_destroy(menu);
		return 1;
	}
	switch (item)
	{
		case 0:
		{
			_ShowTombolaMenu(id);
		}
		case 1:
		{
			new money = g_iUserMoney[id];
			if (money < g_iRouletteCost)
			{
				client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "NOT_ENOUGH_MONEY", g_iRouletteCost - money);
				_ShowGamesMenu(id);
			}
			else
			{
				if (g_bRoulettePlay[id])
				{
					client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "ROULETTE_NEXT");
					_ShowGamesMenu(id);
				}
				_ShowRouletteMenu(id);
			}
		}
		case 2:
		{
			if (g_bJackpotWork)
			{
				g_iMenuToOpen[id] = 7;
				_ShowJackpotMenu(id);
			}
			else
			{
				client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "JACKPOT_UNAVAIBLE", get_pcvar_num(c_JackpotTimer));
				_ShowGamesMenu(id);
			}
		}
		case 3:
		{
			g_iMenuToOpen[id] = 2;
			_ShowCFMenu(id);
		}
		default:
		{
		}
	}
	menu_destroy(menu);
	return 1;
}

_ShowTombolaMenu(id)
{
	new temp[64];
	formatex(temp, 63, "\r%s \w%L", "[CSGO Classy]", id, "RAFFLE_MENU");
	new menu = menu_create(temp, "tombola_menu_handler", MaxClients);
	new szItem[2];
	szItem[1] = 0;
	new Timer[32];
	_FormatTime(Timer, 31, g_iNextTombolaStart);
	formatex(temp, 63, "\w%L", id, "COUNTDOWN", Timer);
	szItem[0] = 0;
	menu_additem(menu, temp, szItem, MaxClients, -1);
	formatex(temp, 63, "\w%L", id, "RAFFLE_PLAYERS", g_iTombolaPlayers);
	szItem[0] = 0;
	menu_additem(menu, temp, szItem, MaxClients, -1);
	formatex(temp, 63, "\w%L\n", id, "RAFFLE_TOTAL_STAKE", g_iTombolaPrize);
	szItem[0] = 0;
	menu_additem(menu, temp, szItem, MaxClients, -1);
	if (g_bUserPlay[id])
	{
		formatex(temp, 63, "\r%L", id, "RAFFLE_ALREADY_JOINED");
		szItem[0] = 0;
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	else
	{
		formatex(temp, 63, "\r%L \r[%d$]", id, "RAFFLE_JOIN", g_iTombolaCost);
		szItem[0] = 1;
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	menu_display(id, menu, MaxClients, -1);
	return 0;
}

_FormatTime(timer[], len, nextevent)
{
	new seconds = nextevent - get_systime(MaxClients);
	new minutes;
	while (seconds >= 60)
	{
		seconds += -60;
		minutes++;
	}
	new bool:add_before;
	new temp[32];
	if (seconds)
	{
		new second[64];
		if (seconds == 1)
		{
			formatex(second, 63, "%L", 0, "TEXT_SECOND");
		}
		else
		{
			formatex(second, 63, "%L", 0, "TEXT_SECONDS");
		}
		formatex(temp, "", "%i %s", seconds, second);
		add_before = true;
	}
	if (minutes)
	{
		if (add_before)
		{
			new minute[64];
			if (minutes == 1)
			{
				formatex(minute, 63, "%L", 0, "TEXT_MINUTE");
			}
			else
			{
				formatex(minute, 63, "%L", 0, "TEXT_MINUTES");
			}
			format(temp, "", "%i %s and %s", minutes, minute, temp);
		}
		new minute[64];
		if (minutes == 1)
		{
			formatex(minute, 63, "%L", 0, "TEXT_MINUTE");
		}
		else
		{
			formatex(minute, 63, "%L", 0, "TEXT_MINUTES");
		}
		formatex(temp, "", "%i %s", minutes, minute);
		add_before = true;
	}
	if (add_before)
	{
		formatex(timer, len, "%s", temp);
	}
	return 0;
}

public tombola_menu_handler(id, menu, item)
{
	if (item == -3)
	{
		_ShowGamesMenu(id);
		menu_destroy(menu);
		return 1;
	}
	new itemdata[2];
	new dummy;
	new index;
	menu_item_getinfo(menu, item, dummy, itemdata, 1, 419524, MaxClients, dummy);
	index = itemdata[0];
	switch (index)
	{
		case 0:
		{
			_ShowTombolaMenu(id);
		}
		case 1:
		{
			new uMoney = g_iUserMoney[id];
			if (!g_bTombolaWork)
			{
			}
			else
			{
				if (uMoney < g_iTombolaCost)
				{
					client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "NOT_ENOUGH_MONEY", g_iTombolaCost - uMoney);
					_ShowTombolaMenu(id);
					return 1;
				}
				g_iUserMoney[id] -= g_iTombolaCost;
				g_iTombolaPrize = g_iTombolaPrize + g_iTombolaCost;
				g_bUserPlay[id] = 1;
				ArrayPushCell(g_aTombola, id);
				g_iTombolaPlayers = g_iTombolaPlayers + 1;
				_SaveData(id);
				client_print_color(MaxClients, id, "\x04%s\x01 %L", "[CSGO Classy]", -1, "RAFFLE_ANNOUNCE_JOIN", g_szName[id]);
				_ShowTombolaMenu(id);
			}
		}
		default:
		{
		}
	}
	menu_destroy(menu);
	return 1;
}

public task_TombolaRun(task)
{
	if (1 > g_iTombolaPlayers)
	{
		client_print_color(MaxClients, MaxClients, "\x04%s\x01 %L", "[CSGO Classy]", -1, "RAFFLE_NOBODY_JOINED");
	}
	else
	{
		if (2 > g_iTombolaPlayers)
		{
			client_print_color(MaxClients, MaxClients, "\x04%s\x01 %L", "[CSGO Classy]", -1, "RAFFLE_ONLY_ONE");
		}
		new id;
		new size = ArraySize(g_aTombola);
		new bool:succes;
		new random;
		new run;
		do {
			random = random_num(MaxClients, size + -1);
			id = ArrayGetCell(g_aTombola, random, MaxClients, MaxClients);
			new var1;
			if ((0 < id && 32 >= id) || !is_user_connected(id))
			{
				succes = true;
				if (2 > g_iTombolaPlayers)
				{
					new var3 = g_iUserMoney[id];
					var3 = var3[g_iTombolaCost];
					_SaveData(id);
				}
				else
				{
					new var4 = g_iUserMoney[id];
					var4 = var4[g_iTombolaPrize];
					_SaveData(id);
					new Name[32];
					get_user_name(id, Name, "");
					client_print_color(MaxClients, MaxClients, "\x04%s\x01 %L", "[CSGO Classy]", -1, "RAFFLE_WINNER", Name, g_iTombolaPrize);
				}
			}
			else
			{
				ArrayDeleteItem(g_aTombola, random);
				size--;
			}
			if (!succes)
			{
				if (size > 0)
				{
				}
			}
		} while (run);
	}
	arrayset(g_bUserPlay, MaxClients, 33);
	g_iTombolaPlayers = 0;
	g_iTombolaPrize = 0;
	ArrayClear(g_aTombola);
	g_iNextTombolaStart = get_systime(MaxClients) + g_iTombolaTimer;
	new Timer[32];
	_FormatTime(Timer, 31, g_iNextTombolaStart);
	return 0;
}

_ShowRouletteMenu(id)
{
	new temp[64];
	formatex(temp, 63, "\r%s \w%L", "[CSGO Classy]", id, "GAME_ROULETTE");
	new menu = menu_create(temp, "roulette_menu_handler", MaxClients);
	new szItem[2];
	szItem[1] = 0;
	formatex(temp, 63, "\w%L", id, "ROULETTE_UNDER", g_iRouletteMin);
	menu_additem(menu, temp, szItem, MaxClients, -1);
	formatex(temp, 63, "\w%L", id, "ROULETTE_OVER", g_iRouletteMin);
	menu_additem(menu, temp, szItem, MaxClients, -1);
	formatex(temp, 63, "\w%L\n", id, "ROULETTE_EQUAL", g_iRouletteMax);
	menu_additem(menu, temp, szItem, MaxClients, -1);
	formatex(temp, 63, "\w%L", id, "ROULETTE_BET", g_iUserBetMoney[id]);
	menu_additem(menu, temp, szItem, MaxClients, -1);
	menu_display(id, menu, MaxClients, -1);
	return 0;
}

public roulette_menu_handler(id, menu, item)
{
	if (item == -3)
	{
		_ShowGamesMenu(id);
		menu_destroy(menu);
		return 1;
	}
	if (0 <= item <= 2)
	{
		if (g_iUserMoney[id] >= g_iUserBetMoney[id])
		{
			g_iUserMoney[id] -= g_iUserBetMoney[id];
		}
		client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "NOT_ENOUGH_MONEY", g_iUserBetMoney[id] - g_iUserMoney[id]);
		return 1;
	}
	new chance = random_num(1, 100);
	switch (item)
	{
		case 0:
		{
			if (chance <= 48)
			{
				_RouletteWin(id, g_iRouletteMin);
			}
			else
			{
				_RouletteLoose(id, chance);
			}
		}
		case 1:
		{
			if (chance >= 53)
			{
				_RouletteWin(id, g_iRouletteMin);
			}
			else
			{
				_RouletteLoose(id, chance);
			}
		}
		case 2:
		{
			if (48 <= chance <= 53)
			{
				_RouletteWin(id, g_iRouletteMax);
			}
			else
			{
				_RouletteLoose(id, chance);
			}
		}
		case 3:
		{
			client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "ROULETTE_STAKE");
			client_cmd(id, "messagemode BetMoney");
		}
		default:
		{
		}
	}
	menu_destroy(menu);
	return 1;
}

_RouletteWin(id, multi)
{
	new num = g_iUserBetMoney[id] * multi;
	new var1 = g_iUserMoney[id];
	var1 = var1[num];
	g_bRoulettePlay[id] = 1;
	client_print_color(MaxClients, id, "\x04%s\x01 %L", "[CSGO Classy]", -1, "ROULETTE_WIN", g_szName[id], num);
	_SaveData(id);
	client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "ROULETTE_NEXT");
	return 0;
}

_RouletteLoose(id, num)
{
	client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "ROULETTE_LOOSE", num);
	_SaveData(id);
	_ShowGamesMenu(id);
	return 0;
}

public concmd_betmoney(id)
{
	new data[16];
	read_args(data, 15);
	remove_quotes(data);
	new Amount = str_to_num(data);
	new var1;
	if (Amount < 100 || Amount > 1000)
	{
		client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "ROULETTE_INFO", 100, 1000);
		client_cmd(id, "messagemode BetMoney");
		return 1;
	}
	g_iUserBetMoney[id] = Amount;
	_ShowRouletteMenu(id);
	return 1;
}

_ShowJackpotMenu(id)
{
	new temp[64];
	formatex(temp, 63, "\r%s \w%L", "[CSGO Classy]", id, "GAME_JACKPOT");
	new menu = menu_create(temp, "jackpot_menu_handler", MaxClients);
	new szItem[2];
	szItem[1] = 0;
	if (!_IsGoodItem(g_iUserJackpotItem[id]))
	{
		formatex(temp, 63, "\w%L", id, "SELECT_ITEM");
		szItem[0] = 1;
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	else
	{
		new Item[50];
		_GetItemName(g_iUserJackpotItem[id], Item, 49);
		new var1;
		if (g_bJackpotStt[id])
		{
			var1 = 422260;
		}
		else
		{
			var1 = 422324;
		}
		formatex(temp, 63, "\r%s\w%s", var1, Item);
		szItem[0] = 1;
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	if (g_bUserPlayJackpot[id])
	{
		formatex(temp, 63, "\r%L\n", id, "JACKPOT_ALREADY_JOINED");
		szItem[0] = 0;
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	else
	{
		formatex(temp, 63, "\r%L\n", id, "JACKPOT_JOIN");
		szItem[0] = 2;
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	new Timer[32];
	_FormatTime(Timer, 31, g_iJackpotClose);
	formatex(temp, 63, "\w%L", id, "COUNTDOWN", Timer);
	szItem[0] = 0;
	menu_additem(menu, temp, szItem, MaxClients, -1);
	menu_display(id, menu, MaxClients, -1);
	return 0;
}

public jackpot_menu_handler(id, menu, item)
{
	if (item == -3)
	{
		_ShowGamesMenu(id);
		menu_destroy(menu);
		return 1;
	}
	new itemdata[2];
	new dummy;
	new index;
	menu_item_getinfo(menu, item, dummy, itemdata, 1, 422580, MaxClients, dummy);
	index = itemdata[0];
	if (!g_bJackpotWork)
	{
		_ShowGamesMenu(id);
		menu_destroy(menu);
		return 1;
	}
	switch (index)
	{
		case 0:
		{
			_ShowJackpotMenu(id);
		}
		case 1:
		{
			if (g_bUserPlayJackpot[id])
			{
				_ShowJackpotMenu(id);
			}
			else
			{
				_SelectJackpotSkin(id);
			}
		}
		case 2:
		{
			new skin = g_iUserJackpotItem[id];
			if (!_IsGoodItem(skin))
			{
				client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "JACKPOT_JOIN_PRESS");
				_ShowJackpotMenu(id);
			}
			else
			{
				if (!_UserHasItem(id, skin))
				{
					client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "NO_LONGER");
					g_iUserJackpotItem[id] = -1;
				}
				g_bUserPlayJackpot[id] = 1;
				g_iUserSkins[id][skin]--;
				checkInstantDefault(id, skin);
				ArrayPushCell(g_aJackpotSkins, skin);
				ArrayPushCell(g_aJackpotUsers, id);
				ArrayPushCell(g_aJackPotSttSkins, g_bJackpotStt[id]);
				new szItem[50];
				_GetItemName(skin, szItem, 49);
				if (g_bJackpotStt[id])
				{
					format(szItem, 49, "StatTrack (TM) %s", szItem);
					g_iUserStattrackKillCount[id][skin] = 0;
					g_bIsWeaponStattrack[id][skin] = false;
				}
				client_print_color(MaxClients, MaxClients, "\x04%s %L", "[CSGO Classy]", -1, "JACKPOT_JOINED", g_szName[id], szItem);
				_SaveData(id);
			}
		}
		default:
		{
		}
	}
	menu_destroy(menu);
	return 1;
}

_SelectJackpotSkin(id)
{
	_ShowSkinMenu(id);
	return 0;
}

openJackpotMenu(id, iWeaponId)
{
	new temp[64];
	formatex(temp, 63, "\r%s \w%L", "[CSGO Classy]", id, "INVENTORY");
	new menu = menu_create(temp, "jp_skins_menu_handler", MaxClients);
	new szItem[10];
	szItem[1] = 0;
	new szSkin[32];
	new num;
	new type[2];
	new total;
	new i;
	new wid;
	while (i < g_iSkinsNum)
	{
		num = g_iUserSkins[id][i];
		if (num > 0)
		{
			wid = ArrayGetCell(g_aSkinWeaponID, i, MaxClients, MaxClients);
			if (iWeaponId != wid)
			{
				i++;
			}
			ArrayGetString(g_aSkinName, i, szSkin, "");
			ArrayGetString(g_aSkinType, i, type, 1);
			new applied[64];
			switch (type[0])
			{
				case 99:
				{
					applied = {0};
				}
				default:
				{
					applied = {0};
				}
			}
			new var1;
			if (g_bIsWeaponStattrack[id][i])
			{
				var1 = 423388;
			}
			else
			{
				var1 = 423452;
			}
			formatex(temp, 63, "\r%s\w%s \r[%d]", var1, szSkin, num);
			num_to_str(i, szItem, 9);
			menu_additem(menu, temp, szItem, MaxClients, -1);
			total++;
		}
		i++;
	}
	if (!total)
	{
		formatex(temp, 63, "\r%L", id, "NO_ITEMS");
		num_to_str(2000, szItem, 9);
		menu_additem(menu, temp, szItem, MaxClients, -1);
	}
	menu_display(id, menu, MaxClients, -1);
	return 0;
}

public jp_skins_menu_handler(id, menu, item)
{
	if (item == -3)
	{
		_ShowJackpotMenu(id);
		menu_destroy(menu);
		return 1;
	}
	new itemdata[5];
	new dummy;
	new index;
	menu_item_getinfo(menu, item, dummy, itemdata, NULL_STRING, 423512, MaxClients, dummy);
	index = str_to_num(itemdata);
	if (index == 2000)
	{
		_ShowGamesMenu(id);
		menu_destroy(menu);
		return 1;
	}
	if (g_iUserSellItem[id] == index)
	{
		new Item[50];
		_GetItemName(g_iUserSellItem[id], Item, 49);
		if (g_bPublishedStattrackSkin[id])
		{
			format(Item, 49, "Stattrack (TM) %s", Item);
		}
		client_print_color(id, id, "\x04%s\x01 You are \x04currently selling\x01 your \x04%s\x01, you \x04can not\x01 bet it at the \x04Jackpot", "[CSGO Classy]", Item);
		_SelectJackpotSkin(id);
		menu_destroy(menu);
		return 1;
	}
	g_iUserJackpotItem[id] = index;
	if (g_bIsWeaponStattrack[id][index])
	{
		if (1 < g_iUserSkins[id][index])
		{
			askWhichType(id, index);
			g_iAskType[id] = 5;
			return 1;
		}
		g_bJackpotStt[id] = 1;
	}
	else
	{
		g_bJackpotStt[id] = 0;
	}
	_ShowJackpotMenu(id);
	menu_destroy(menu);
	return 1;
}

public task_Jackpot(task)
{
	if (!g_bJackpotWork)
	{
		return 0;
	}
	new id;
	new size = ArraySize(g_aJackpotUsers);
	if (1 > size)
	{
		client_print_color(MaxClients, MaxClients, "\x04%s %L", "[CSGO Classy]", -1, "JACKPOT_NO_ONE");
		_ClearJackpot();
		return 0;
	}
	if (2 > size)
	{
		client_print_color(MaxClients, MaxClients, "\x04%s %L", "[CSGO Classy]", -1, "JACKPOT_ONLY_ONE");
		new id;
		new k;
		id = ArrayGetCell(g_aJackpotUsers, MaxClients, MaxClients, MaxClients);
		new var1;
		if ((0 < id && 32 >= id) || !is_user_connected(id))
		{
			k = ArrayGetCell(g_aJackpotSkins, MaxClients, MaxClients, MaxClients);
			g_iUserSkins[id][k]++;
		}
		_ClearJackpot();
		return 0;
	}
	new bool:succes;
	new random;
	new run;
	do {
		random = random_num(MaxClients, size + -1);
		id = ArrayGetCell(g_aJackpotUsers, random, MaxClients, MaxClients);
		new var3;
		if ((0 < id && 32 >= id) || !is_user_connected(id))
		{
			succes = true;
			new i;
			new j;
			new k;
			i = ArraySize(g_aJackpotSkins);
			j = 0;
			while (j < i)
			{
				k = ArrayGetCell(g_aJackpotSkins, j, MaxClients, MaxClients);
				g_bIsWeaponStattrack[id][k] = ArrayGetCell(g_aJackPotSttSkins, j, MaxClients, MaxClients);
				g_iUserSkins[id][k]++;
				j++;
			}
			_SaveData(id);
			client_print_color(MaxClients, MaxClients, "\x04%s %L", "[CSGO Classy]", -1, "JACKPOT_WINNER", g_szName[id]);
		}
		else
		{
			ArrayDeleteItem(g_aJackpotUsers, random);
			size--;
		}
		new var5;
		if (!succes && size > 0)
		{
			_ClearJackpot();
			return 0;
		}
	} while (run);
	_ClearJackpot();
	return 0;
}

_ClearJackpot()
{
	ArrayClear(g_aJackpotSkins);
	ArrayClear(g_aJackPotSttSkins);
	ArrayClear(g_aJackpotUsers);
	arrayset(g_bUserPlayJackpot, MaxClients, 33);
	g_bJackpotWork = false;
	new i;
	while (i < 33)
	{
		g_bJackpotStt[i] = 0;
		i++;
	}
	return 0;
}

public ev_DeathMsg()
{
	new killer = read_data(1);
	new victim = read_data(2);
	new head = read_data(3);
	new szWeapon[24];
	read_data(NULL_STRING, szWeapon, 23);
	if (killer == victim)
	{
		return 0;
	}
	new assist = g_iMostDamage[victim];
	new var1;
	if (is_user_connected(assist) && killer != assist && cs_get_user_team(killer, 0) == cs_get_user_team(assist, 0))
	{
		_GiveBonus(assist, 0);
	}
	if (equal(szWeapon, "knife", MaxClients))
	{
		set_user_scraps(killer, get_user_scraps(killer) + 5);
		client_print_color(MaxClients, killer, "\x04%s\x01 %L", "[CSGO Classy]", -1, "KNIFE_KILL", g_szName[killer], g_szName[victim]);
	}
	g_iRoundKills[killer]++;
	if (!g_bLogged[killer])
	{
		return 0;
	}
	g_iUserKills[killer]++;
	_SaveData(killer);
	new bool:levelup;
	if (ArraySize(g_aRankKills) - 1 <= g_iUserRank[killer])
	{
		return 0;
	}
	if (ArrayGetCell(g_aRankKills, g_iUserRank[killer][0], MaxClients, MaxClients) < g_iUserKills[killer])
	{
		g_iUserRank[killer]++;
		_SaveData(killer);
		levelup = true;
		new szRank[32];
		ArrayGetString(g_aRankName, g_iUserRank[killer], szRank, "");
		client_print_color(MaxClients, killer, "\x04%s\x01 %L", "[CSGO Classy]", -1, "RANKUP", g_szName[killer], szRank);
	}
	new rmoney;
	new rchance;
	if (head)
	{
		rmoney = random_num(g_iHMinMoney, g_iHMaxMoney);
		rchance = random_num(g_iHMinChance, g_iHMaxChance);
	}
	else
	{
		rmoney = random_num(g_iKMinMoney, g_iKMaxMoney);
		rchance = random_num(g_iKMinChance, g_iKMaxChance);
	}
	new var3 = g_iUserMoney[killer];
	var3 = var3[rmoney];
	_SaveData(killer);
	if (rchance > g_iDropChance)
	{
		new r;
		if (g_iDropType > 0)
		{
			r = 1;
		}
		else
		{
			r = random_num(1, 2);
		}
		switch (r)
		{
			case 1:
			{
				g_iUserCases[killer]++;
				_SaveData(killer);
			}
			case 2:
			{
				g_iUserKeys[killer]++;
				_SaveData(killer);
			}
			default:
			{
			}
		}
	}
	if (levelup)
	{
		new szBonus[16];
		get_pcvar_string(c_RankUpBonus, szBonus, 15);
		new keys;
		new cases;
		new money;
		new i;
		while (szBonus[i] != 124 && 16 > i)
		{
			switch (szBonus[i])
			{
				case 99:
				{
					cases++;
				}
				case 107:
				{
					keys++;
				}
				default:
				{
				}
			}
			i++;
		}
		new temp[8];
		strtok(szBonus, temp, 7, szBonus, 15, 124, MaxClients);
		if (szBonus[0])
		{
			money = str_to_num(szBonus);
		}
		if (keys > 0)
		{
			new var4 = g_iUserKeys[killer];
			var4 = var4[keys];
		}
		if (cases > 0)
		{
			new var5 = g_iUserCases[killer];
			var5 = var5[cases];
		}
		if (money > 0)
		{
			new var6 = g_iUserMoney[killer];
			var6 = var6[money];
		}
		_SaveData(killer);
		client_print_color(killer, killer, "\x04%s\x01 %L", "[CSGO Classy]", killer, "RANKUP_BONUS", keys, cases, money);
	}
	return 0;
}

public ev_Damage(id)
{
	new var1;
	if (id && id <= g_iMaxPlayers)
	{
		return 0;
	}
	static att;
	att = get_user_attacker(id);
	new var2;
	if (0 < att && att <= g_iMaxPlayers)
	{
		return 0;
	}
	static damage;
	damage = read_data(2);
	new var3 = g_iDealDamage[att];
	var3 = var3[damage];
	new var4 = g_iDamage[id][att];
	var4 = var4[damage];
	new topDamager = g_iMostDamage[id];
	if (g_iDamage[id][att] > g_iDamage[id][topDamager])
	{
		g_iMostDamage[id] = att;
	}
	return 0;
}

public concmd_givemoney(id, level, cid)
{
	if (!cmd_access(id, level, cid, 3, false))
	{
		return 1;
	}
	new arg1[32];
	new arg2[16];
	read_argv(1, arg1, "");
	read_argv(2, arg2, 15);
	new target;
	if (arg1[0] == 64)
	{
		_GiveToAll(id, arg1, arg2, 0);
		return 1;
	}
	target = cmd_target(id, arg1, 3);
	if (!target)
	{
		console_print(id, "%s %L", "[CSGO Classy]", id, "PLAYER_NOT_FOUND", arg1);
		return 1;
	}
	new amount = str_to_num(arg2);
	if (amount < 0)
	{
		new var1 = g_iUserMoney[target];
		var1 = var1[amount];
		if (g_iUserMoney[target] < 0)
		{
			g_iUserMoney[target] = 0;
		}
		console_print(id, "%s %L %L", "[CSGO Classy]", id, "SUBSTRACT", arg1, amount, id, "VALUE_MONEY");
		client_print_color(target, id, "\x04%s\x01 %L %L", "[CSGO Classy]", target, "ADMIN_SUBSTRACT", g_szName[id], amount, target, "VALUE_MONEY");
		_SaveData(target);
		return 1;
	}
	if (amount > 0)
	{
		new var2 = g_iUserMoney[target];
		var2 = var2[amount];
		console_print(id, "[CSGO Classy] You gave %s %d money", arg1, amount);
		client_print_color(target, id, "\x04%s\x01 %L %L", "[CSGO Classy]", target, "ADMIN_ADD", g_szName[id], amount, target, "VALUE_MONEY");
	}
	return 1;
}

public concmd_givecases(id, level, cid)
{
	if (!cmd_access(id, level, cid, 3, false))
	{
		return 1;
	}
	new arg1[32];
	new arg2[16];
	read_argv(1, arg1, "");
	read_argv(2, arg2, 15);
	new target;
	if (arg1[0] == 64)
	{
		_GiveToAll(id, arg1, arg2, 1);
		return 1;
	}
	target = cmd_target(id, arg1, 3);
	if (!target)
	{
		console_print(id, "%s %L", "[CSGO Classy]", id, "PLAYER_NOT_FOUND", arg1);
		return 1;
	}
	new amount = str_to_num(arg2);
	if (amount < 0)
	{
		new var1 = g_iUserCases[target];
		var1 = var1[amount];
		if (g_iUserCases[target] < 0)
		{
			g_iUserCases[target] = 0;
		}
		console_print(id, "%s %L %L", "[CSGO Classy]", id, "SUBSTRACT", arg1, amount, id, "VALUE_CASES");
		client_print_color(target, id, "\x04%s\x01 %L %L", "[CSGO Classy]", target, "ADMIN_SUBSTRACT", g_szName[id], amount, target, "VALUE_CASES");
		_SaveData(target);
		return 1;
	}
	if (amount > 0)
	{
		new var2 = g_iUserCases[target];
		var2 = var2[amount];
		console_print(id, "%s %L %L", "[CSGO Classy]", id, "ADD", arg1, amount, id, "VALUE_CASES");
		client_print_color(target, id, "\x04%s\x01 %L %L", "[CSGO Classy]", target, "ADMIN_ADD", g_szName[id], amount, target, "VALUE_CASES");
	}
	return 1;
}

public concmd_givekeys(id, level, cid)
{
	if (!cmd_access(id, level, cid, 3, false))
	{
		return 1;
	}
	new arg1[32];
	new arg2[16];
	read_argv(1, arg1, "");
	read_argv(2, arg2, 15);
	new target;
	if (arg1[0] == 64)
	{
		_GiveToAll(id, arg1, arg2, 2);
		return 1;
	}
	target = cmd_target(id, arg1, 3);
	if (!target)
	{
		console_print(id, "%s %L", "[CSGO Classy]", id, "PLAYER_NOT_FOUND", arg1);
		return 1;
	}
	new amount = str_to_num(arg2);
	if (amount < 0)
	{
		new var1 = g_iUserKeys[target];
		var1 = var1[amount];
		if (g_iUserKeys[target] < 0)
		{
			g_iUserKeys[target] = 0;
		}
		console_print(id, "%s %L %L", "[CSGO Classy]", id, "SUBSTRACT", arg1, amount, id, "VALUE_KEYS");
		client_print_color(target, id, "\x04%s\x01 %L %L", "[CSGO Classy]", target, "ADMIN_SUBSTRACT", g_szName[id], amount, target, "VALUE_KEYS");
		_SaveData(target);
		return 1;
	}
	if (amount > 0)
	{
		new var2 = g_iUserKeys[target];
		var2 = var2[amount];
		console_print(id, "%s %L %L", "[CSGO Classy]", id, "ADD", arg1, amount, id, "VALUE_KEYS");
		client_print_color(target, id, "\x04%s\x01 %L %L", "[CSGO Classy]", target, "ADMIN_ADD", g_szName[id], amount, target, "VALUE_KEYS");
	}
	return 1;
}

public concmd_givescraps(id, level, cid)
{
	if (!cmd_access(id, level, cid, 3, false))
	{
		return 1;
	}
	new arg1[32];
	new arg2[16];
	read_argv(1, arg1, "");
	read_argv(2, arg2, 15);
	new target;
	if (arg1[0] == 64)
	{
		_GiveToAll(id, arg1, arg2, 3);
		return 1;
	}
	target = cmd_target(id, arg1, 3);
	if (!target)
	{
		console_print(id, "%s %L", "[CSGO Classy]", id, "PLAYER_NOT_FOUND", arg1);
		return 1;
	}
	new amount = str_to_num(arg2);
	if (amount < 0)
	{
		new var1 = g_iUserScraps[target];
		var1 = var1[amount];
		if (g_iUserScraps[target] < 0)
		{
			g_iUserScraps[target] = 0;
		}
		console_print(id, "%s %L %L", "[CSGO Classy]", id, "SUBSTRACT", arg1, amount, id, "VALUE_SCRAPS");
		client_print_color(target, id, "\x04%s\x01 %L %L", "[CSGO Classy]", target, "ADMIN_SUBSTRACT", g_szName[id], amount, target, "VALUE_SCRAPS");
		_SaveData(target);
		return 1;
	}
	if (amount > 0)
	{
		new var2 = g_iUserScraps[target];
		var2 = var2[amount];
		console_print(id, "%s %L %L", "[CSGO Classy]", id, "ADD", arg1, amount, id, "VALUE_SCRAPS");
		client_print_color(target, id, "\x04%s\x01 %L %L", "[CSGO Classy]", target, "ADMIN_ADD", g_szName[id], amount, target, "VALUE_SCRAPS");
	}
	return 1;
}

_GiveToAll(id, arg1[], arg2[], type)
{
	new Pl[32];
	new n;
	new target;
	new amount = str_to_num(arg2);
	if (amount)
	{
		switch (arg1[1])
		{
			case 65, 97:
			{
				get_players(Pl, n, 428348, 428356);
			}
			case 67, 99:
			{
				get_players(Pl, n, "eh", "CT");
			}
			case 84, 116:
			{
				get_players(Pl, n, "eh", "TERRORIST");
			}
			default:
			{
			}
		}
		if (n)
		{
			switch (type)
			{
				case 0:
				{
					new i;
					while (i < n)
					{
						target = Pl[i];
						if (g_bLogged[target])
						{
							if (amount < 0)
							{
								new var7 = g_iUserMoney[target];
								var7 = var7[amount];
								if (g_iUserMoney[target] < 0)
								{
									g_iUserMoney[target] = 0;
								}
								client_print_color(target, id, "\x04%s\x01 %L %L", "[CSGO Classy]", target, "ADMIN_SUBSTRACT", g_szName[id], amount, target, "VALUE_MONEY");
							}
							new var8 = g_iUserMoney[target];
							var8 = var8[amount];
							client_print_color(target, id, "\x04%s\x01 %L %L", "[CSGO Classy]", target, "ADMIN_ADD", g_szName[id], amount, target, "VALUE_MONEY");
						}
						i++;
					}
					new temp[64];
					if (amount > 0)
					{
						if (amount == 1)
						{
							formatex(temp, 63, "You gave 1 money to all connected players", id);
						}
						else
						{
							formatex(temp, 63, "You gave %d money to all connected players", amount);
						}
						console_print(id, "%s %s", "[CSGO Classy]", temp);
					}
					else
					{
						if (amount == -1)
						{
							formatex(temp, 63, "You got 1 money from all connected players", id);
						}
						else
						{
							amount *= -1;
							formatex(temp, 63, "You got %d money from all connected players", amount * -1);
						}
						console_print(id, "%s %s", "[CSGO Classy]", temp);
					}
				}
				case 1:
				{
					new i;
					while (i < n)
					{
						target = Pl[i];
						if (g_bLogged[target])
						{
							if (amount < 0)
							{
								new var5 = g_iUserCases[target];
								var5 = var5[amount];
								if (g_iUserCases[target] < 0)
								{
									g_iUserCases[target] = 0;
								}
								client_print_color(target, id, "\x04%s\x01 %L %L", "[CSGO Classy]", target, "ADMIN_SUBSTRACT", g_szName[id], amount, target, "VALUE_CASES");
							}
							new var6 = g_iUserCases[target];
							var6 = var6[amount];
							client_print_color(target, id, "\x04%s\x01 %L %L", "[CSGO Classy]", target, "ADMIN_ADD", g_szName[id], amount, target, "VALUE_CASES");
						}
						i++;
					}
					new temp[64];
					if (amount > 0)
					{
						if (amount == 1)
						{
							formatex(temp, 63, "You gave 1 case to all connected players", id);
						}
						else
						{
							formatex(temp, 63, "You gave %d cases to all connected players", amount);
						}
						console_print(id, "%s %s", "[CSGO Classy]", temp);
					}
					else
					{
						if (amount == -1)
						{
							formatex(temp, 63, "You got 1 case from all connected players", id);
						}
						else
						{
							amount *= -1;
							formatex(temp, 63, "You got %d cases from all connected players", amount * -1);
						}
						console_print(id, "%s %s", "[CSGO Classy]", temp);
					}
				}
				case 2:
				{
					new i;
					while (i < n)
					{
						target = Pl[i];
						if (g_bLogged[target])
						{
							if (amount < 0)
							{
								new var3 = g_iUserKeys[target];
								var3 = var3[amount];
								if (g_iUserKeys[target] < 0)
								{
									g_iUserKeys[target] = 0;
								}
								client_print_color(target, id, "\x04%s\x01 %L %L", "[CSGO Classy]", target, "ADMIN_SUBSTRACT", g_szName[id], amount, target, "VALUE_KEYS");
							}
							new var4 = g_iUserKeys[target];
							var4 = var4[amount];
							client_print_color(target, id, "\x04%s\x01 %L %L", "[CSGO Classy]", target, "ADMIN_ADD", g_szName[id], amount, target, "VALUE_KEYS");
						}
						i++;
					}
					new temp[64];
					if (amount > 0)
					{
						if (amount == 1)
						{
							formatex(temp, 63, "You gave 1 key to all connected players", id);
						}
						else
						{
							formatex(temp, 63, "You gave %d keys to all connected players", amount);
						}
						console_print(id, "%s %s", "[CSGO Classy]", temp);
					}
					else
					{
						if (amount == -1)
						{
							formatex(temp, 63, "You got 1 key from all connected players", id);
						}
						else
						{
							amount *= -1;
							formatex(temp, 63, "You got %d keys from all connected players", amount * -1);
						}
						console_print(id, "%s %s", "[CSGO Classy]", temp);
					}
				}
				case 3:
				{
					new i;
					while (i < n)
					{
						target = Pl[i];
						if (g_bLogged[target])
						{
							if (amount < 0)
							{
								new var1 = g_iUserScraps[target];
								var1 = var1[amount];
								if (g_iUserScraps[target] < 0)
								{
									g_iUserScraps[target] = 0;
								}
								client_print_color(target, id, "\x04%s\x01 %L %L", "[CSGO Classy]", target, "ADMIN_SUBSTRACT", g_szName[id], amount, target, "VALUE_SCRAPS");
							}
							new var2 = g_iUserScraps[target];
							var2 = var2[amount];
							client_print_color(target, id, "\x04%s\x01 %L %L", "[CSGO Classy]", target, "ADMIN_ADD", g_szName[id], amount, target, "VALUE_SCRAPS");
						}
						i++;
					}
					new temp[64];
					if (amount > 0)
					{
						if (amount == 1)
						{
							formatex(temp, 63, "You gave 1 scrap to all connected players", id);
						}
						else
						{
							formatex(temp, 63, "You gave %d scraps to all connected players", amount);
						}
						console_print(id, "%s %s", "[CSGO Classy]", temp);
					}
					else
					{
						if (amount == -1)
						{
							formatex(temp, 63, "You got 1 scrap from all connected players", id);
						}
						else
						{
							amount *= -1;
							formatex(temp, 63, "You got %d scraps from all connected players", amount * -1);
						}
						console_print(id, "%s %s", "[CSGO Classy]", temp);
					}
				}
				default:
				{
				}
			}
		}
		else
		{
			console_print(id, "%s No players found in the chosen category [%s]", "[CSGO Classy]", arg1);
		}
		return 0;
	}
	console_print(id, "%s <Amount> It must not be 0 (zero)", "[CSGO Classy]");
	return 0;
}

public concmd_setrank(id, level, cid)
{
	if (!cmd_access(id, level, cid, 3, false))
	{
		return 1;
	}
	new arg1[32];
	new arg2[8];
	read_argv(1, arg1, "");
	read_argv(2, arg2, 7);
	new target = cmd_target(id, arg1, 3);
	if (!target)
	{
		console_print(id, "%s %L", "[CSGO Classy]", id, "PLAYER_NOT_FOUND", arg1);
		return 1;
	}
	new rank = str_to_num(arg2);
	new var1;
	if (rank < 0 || rank >= g_iRanksNum)
	{
		console_print(id, "%s %L", "[CSGO Classy]", id, "INVALID_RANK_ID", g_iRanksNum + -1);
		return 1;
	}
	g_iUserRank[target] = rank;
	if (rank)
	{
		g_iUserKills[target] = ArrayGetCell(g_aRankKills, rank + -1, MaxClients, MaxClients);
	}
	else
	{
		g_iUserKills[target] = 0;
	}
	_SaveData(target);
	new szRank[32];
	ArrayGetString(g_aRankName, g_iUserRank[target], szRank, "");
	console_print(id, "%s %L", "[CSGO Classy]", id, "SET_RANK", arg1, szRank);
	client_print_color(target, id, "\x04%s\x01 %L", "[CSGO Classy]", target, "ADMIN_SET_RANK", g_szName[id], szRank);
	return 1;
}

public concmd_giveskins(id, level, cid)
{
	if (!cmd_access(id, level, cid, 5, false))
	{
		return 1;
	}
	new arg1[32];
	new arg2[8];
	new arg3[16];
	new arg4[2];
	read_argv(1, arg1, "");
	read_argv(2, arg2, 7);
	read_argv(3, arg3, 15);
	read_argv(NULL_STRING, arg4, 1);
	new target = cmd_target(id, arg1, 3);
	if (!target)
	{
		console_print(id, "%s %L", "[CSGO Classy]", id, "PLAYER_NOT_FOUND", arg1);
		return 1;
	}
	new skin = str_to_num(arg2);
	new bool:bAll = arg2[0] == 64;
	new var2;
	if (!bAll && (skin < 0 || skin >= g_iSkinsNum))
	{
		console_print(id, "%s %L", "[CSGO Classy]", id, "INVALID_SKIN_ID", g_iSkinsNum + -1);
		return 1;
	}
	new amount = str_to_num(arg3);
	new szSkin[32];
	if (!bAll)
	{
		ArrayGetString(g_aSkinName, skin, szSkin, "");
	}
	if (amount < 0)
	{
		g_iUserSkins[target][skin] -= amount;
		if (g_iUserSkins[target][skin] < 0)
		{
			g_iUserSkins[target][skin] = 0;
		}
		new bool:bStt = str_to_num(arg4);
		if (bStt)
		{
			if (bAll)
			{
				new i;
				while (i <= g_iSkinsNum)
				{
					g_bIsWeaponStattrack[target][i] = false;
					g_iUserStattrackKillCount[target][i] = 0;
					i++;
				}
			}
			else
			{
				g_bIsWeaponStattrack[target][skin] = false;
				g_iUserStattrackKillCount[target][skin] = 0;
			}
			format(szSkin, "", "StatTrack (TM) %s", szSkin);
		}
		if (bAll)
		{
			szSkin = {65,108,108,32,83,107,105,110,115,0};
		}
		console_print(id, "%s %L x %s", "[CSGO Classy]", id, "SUBSTRACT", arg1, amount, szSkin);
		client_print_color(target, id, "\x04%s\x01 %L x \x03%s", "[CSGO Classy]", target, "ADMIN_SUBSTRACT", g_szName[id], amount, szSkin);
	}
	else
	{
		if (amount > 0)
		{
			if (amount > 5)
			{
				amount = 5;
			}
			new bool:bStt = str_to_num(arg4);
			if (bAll)
			{
				new i;
				while (i <= g_iSkinsNum)
				{
					new var6 = g_iUserSkins[target][i];
					var6 = var6[amount];
					if (5 < g_iUserSkins[target][i])
					{
						g_iUserSkins[target][i] = 5;
					}
					new var3;
					if (!bStt && g_bIsWeaponStattrack[target][i])
					{
					}
					else
					{
						g_bIsWeaponStattrack[target][i] = bStt;
					}
					i++;
				}
			}
			else
			{
				new var7 = g_iUserSkins[target][skin];
				var7 = var7[amount];
				if (5 < g_iUserSkins[target][skin])
				{
					g_iUserSkins[target][skin] = 5;
				}
				if (bStt)
				{
					g_bIsWeaponStattrack[target][skin] = true;
				}
			}
			if (bStt)
			{
				new var4;
				if (bAll)
				{
					var4 = 435200;
				}
				else
				{
					var4 = szSkin;
				}
				format(szSkin, "", "StatTrack (TM) %s", var4);
			}
			else
			{
				new var5;
				if (bAll)
				{
					var5 = 435252;
				}
				else
				{
					var5 = szSkin;
				}
				format(szSkin, "", "%s", var5);
			}
			console_print(id, "%s %L x %s", "[CSGO Classy]", id, "ADD", arg1, amount, szSkin);
			client_print_color(target, id, "\x04%s\x01 %L x \x03%s", "[CSGO Classy]", target, "ADMIN_ADD", g_szName[id], amount, szSkin);
		}
	}
	_SaveData(target);
	return 1;
}

public native_get_user_money(iPluginID, iParamNum)
{
	if (iParamNum != 1)
	{
		log_error(10, "[CSGO Classy] Invalid param num. [PlayerID]");
		return -1;
	}
	new id = get_param(1);
	new var1;
	if ((0 < id && 32 >= id) || !is_user_connected(id))
	{
		log_error(10, "[CSGO Classy] Player is not connected [%d]", id);
		return -1;
	}
	return g_iUserMoney[id];
}

public native_set_user_money(iPluginID, iParamNum)
{
	if (iParamNum != 2)
	{
		log_error(10, "[CSGO Classy] Invalid param num. [PlayerID, Amount]");
		return 0;
	}
	new id = get_param(1);
	new var1;
	if ((0 < id && 32 >= id) || !is_user_connected(id))
	{
		log_error(10, "[CSGO Classy] Player is not connected [%d]", id);
		return 0;
	}
	new amount = get_param(2);
	if (amount < 0)
	{
		log_error(10, "[CSGO Classy] Invalid amount value [%d]", amount);
		return 0;
	}
	g_iUserMoney[id] = amount;
	_SaveData(id);
	return 1;
}

public native_get_user_cases(iPluginID, iParamNum)
{
	if (iParamNum != 1)
	{
		log_error(10, "[CSGO Classy] Invalid param num. [PlayerID]");
		return -1;
	}
	new id = get_param(1);
	new var1;
	if ((0 < id && 32 >= id) || !is_user_connected(id))
	{
		log_error(10, "[CSGO Classy] Player is not connected [%d]", id);
		return -1;
	}
	return g_iUserCases[id];
}

public native_set_user_cases(iPluginID, iParamNum)
{
	if (iParamNum != 2)
	{
		log_error(10, "[CSGO Classy] Invalid param num. [PlayerID, Amount]");
		return 0;
	}
	new id = get_param(1);
	new var1;
	if ((0 < id && 32 >= id) || !is_user_connected(id))
	{
		log_error(10, "[CSGO Classy] Player is not connected [%d]", id);
		return 0;
	}
	new amount = get_param(2);
	if (amount < 0)
	{
		log_error(10, "[CSGO Classy] Invalid amount value [%d]", amount);
		return 0;
	}
	g_iUserCases[id] = amount;
	_SaveData(id);
	return 1;
}

public native_get_user_keys(iPluginID, iParamNum)
{
	if (iParamNum != 1)
	{
		log_error(10, "[CSGO Classy] Invalid param num. [PlayerID]");
		return -1;
	}
	new id = get_param(1);
	new var1;
	if ((0 < id && 32 >= id) || !is_user_connected(id))
	{
		log_error(10, "[CSGO Classy] Player is not connected [%d]", id);
		return -1;
	}
	return g_iUserKeys[id];
}

public native_set_user_keys(iPluginID, iParamNum)
{
	if (iParamNum != 2)
	{
		log_error(10, "[CSGO Classy] Invalid param num. [PlayerID, Amount]");
		return 0;
	}
	new id = get_param(1);
	new var1;
	if ((0 < id && 32 >= id) || !is_user_connected(id))
	{
		log_error(10, "[CSGO Classy] Player is not connected [%d]", id);
		return 0;
	}
	new amount = get_param(2);
	if (amount < 0)
	{
		log_error(10, "[CSGO Classy] Invalid amount value [%d]", amount);
		return 0;
	}
	g_iUserKeys[id] = amount;
	_SaveData(id);
	return 1;
}

public native_get_user_scraps(iPluginID, iParamNum)
{
	if (iParamNum != 1)
	{
		log_error(10, "[CSGO Classy] Invalid param num. [PlayerID]");
		return -1;
	}
	new id = get_param(1);
	new var1;
	if ((0 < id && 32 >= id) || !is_user_connected(id))
	{
		log_error(10, "[CSGO Classy] Player is not connected [%d]", id);
		return -1;
	}
	return g_iUserScraps[id];
}

public native_set_user_scraps(iPluginID, iParamNum)
{
	if (iParamNum != 2)
	{
		log_error(10, "[CSGO Classy] Invalid param num. [PlayerID, Amount]");
		return 0;
	}
	new id = get_param(1);
	new var1;
	if ((0 < id && 32 >= id) || !is_user_connected(id))
	{
		log_error(10, "[CSGO Classy] Player is not connected [%d]", id);
		return 0;
	}
	new amount = get_param(2);
	if (amount < 0)
	{
		log_error(10, "[CSGO Classy] Invalid amount value [%d]", amount);
		return 0;
	}
	g_iUserScraps[id] = amount;
	_SaveData(id);
	return 1;
}

public native_get_user_rank(iPluginID, iParamNum)
{
	if (iParamNum != 3)
	{
		log_error(10, "[CSGO Classy] Invalid param num. [PlayerID, Output, Len]");
		return -1;
	}
	new id = get_param(1);
	new var1;
	if ((0 < id && 32 >= id) || !is_user_connected(id))
	{
		log_error(10, "[CSGO Classy] Player is not connected [%d]", id);
		return -1;
	}
	new rank = g_iUserRank[id];
	new szRank[32];
	ArrayGetString(g_aRankName, rank, szRank, "");
	new len = get_param(3);
	set_string(2, szRank, len);
	return rank;
}

public native_set_user_rank(iPluginID, iParamNum)
{
	if (iParamNum != 2)
	{
		log_error(10, "[CSGO Classy] Invalid param num! Valid: (PlayerID, RankID)");
		return 0;
	}
	new id = get_param(1);
	new var1;
	if ((0 < id && 32 >= id) || !is_user_connected(id))
	{
		log_error(10, "[CSGO Classy] Player is not connected (%d)", id);
		return 0;
	}
	new rank = get_param(2);
	new var3;
	if (rank < 0 || rank >= g_iRanksNum)
	{
		log_error(10, "[CSGO Classy] Invalid RankID (%d)", rank);
		return 0;
	}
	g_iUserRank[id] = rank;
	g_iUserKills[id] = ArrayGetCell(g_aRankKills, rank + -1, MaxClients, MaxClients);
	_SaveData(id);
	return 1;
}

public native_get_user_skins(iPluginID, iParamNum)
{
	if (iParamNum != 2)
	{
		log_error(10, "[CSGO Classy] Invalid param num! Valid: (PlayerID, SkinID)");
		return -1;
	}
	new id = get_param(1);
	new var1;
	if ((0 < id && 32 >= id) || !is_user_connected(id))
	{
		log_error(10, "[CSGO Classy] Player is not connected (%d)", id);
		return -1;
	}
	new skin = get_param(2);
	new var3;
	if (skin < 0 || skin >= g_iSkinsNum)
	{
		log_error(10, "[CSGO Classy] Invalid SkinID (%d)", skin);
		return -1;
	}
	new amount = g_iUserSkins[id][skin];
	return amount;
}

public _getCurrentSkin()
{
	return g_iUserSelectedSkin[get_param(1)][get_param(2)];
}

public native_set_user_skins()
{
	new id = get_param(1);
	new iSkinID = get_param(2);
	g_iUserSkins[id][iSkinID]++;
	g_bIsWeaponStattrack[id][iSkinID] = get_param(3);
	_SaveData(id);
	return 0;
}

public native_is_user_logged(iPluginID, iParamNum)
{
	if (iParamNum != 1)
	{
		log_error(10, "[CSGO Classy] Invalid param num! Valid: (PlayerID)");
		return 0;
	}
	new id = get_param(1);
	new var1;
	if ((0 < id && 32 >= id) || !is_user_connected(id))
	{
		log_error(10, "[CSGO Classy] Player is not connected (%d)", id);
		return 0;
	}
	return g_bLogged[id];
}

public concmd_finddata(id, level, cid)
{
	if (!cmd_access(id, level, cid, 2, false))
	{
		return 1;
	}
	new arg1[32];
	read_argv(1, arg1, "");
	if (g_Vault == -1)
	{
		console_print(id, "%s Reading from vault has failed", "[CSGO Classy]");
		return 1;
	}
	new Data[64];
	new Timestamp;
	if (nvault_lookup(g_Vault, arg1, Data, 63, Timestamp))
	{
		new userData[6][16] = {
			{
				37, 115, 32, 78, 97, 109, 101, 58, 32, 37, 115, 32, 124, 32, 80, 97
			},
			{
				115, 115, 119, 111, 114, 100, 58, 32, 37, 115, 0, 91, 67, 83, 71, 79
			},
			{
				32, 67, 108, 97, 115, 115, 121, 93, 0, 37, 115, 32, 77, 111, 110, 101
			},
			{
				121, 58, 32, 37, 115, 32, 124, 32, 82, 97, 110, 107, 58, 32, 37, 115
			},
			{
				0, 91, 67, 83, 71, 79, 32, 67, 108, 97, 115, 115, 121, 93, 0, 37
			},
			{
				115, 32, 75, 101, 121, 115, 58, 32, 37, 115, 32, 124, 32, 67, 97, 115
			}
		};
		new password[16];
		new buffer[48];
		strtok(Data, password, 15, Data, 63, 61, MaxClients);
		strtok(Data, buffer, 47, Data, 63, 42, MaxClients);
		new i;
		while (i < 6)
		{
			strtok(buffer, userData[i], 15, buffer, 47, 44, MaxClients);
			i++;
		}
		new rank = str_to_num(userData[5]);
		new szRank[32];
		ArrayGetString(g_aRankName, rank, szRank, "");
		console_print(id, 441188, "[CSGO Classy]", arg1, password);
		console_print(id, "%s Money: %s | Rank: %s", "[CSGO Classy]", userData[0][userData], szRank);
		console_print(id, "%s Keys: %s | Cases: %s", "[CSGO Classy]", userData[2], userData[3]);
		console_print(id, "%s Scraps: %s | Kills: %s", "[CSGO Classy]", userData[1], userData[4]);
	}
	else
	{
		console_print(id, "%s This account was not found: %s", "[CSGO Classy]", arg1);
	}
	return 1;
}

public concmd_resetdata(id, level, cid)
{
	if (!cmd_access(id, level, cid, 2, false))
	{
		return 1;
	}
	new arg1[32];
	read_argv(1, arg1, "");
	if (g_Vault == -1)
	{
		console_print(id, "%s Reading from vault has failed", "[CSGO Classy]");
		return 1;
	}
	new Data[512];
	new Timestamp;
	if (nvault_lookup(g_Vault, arg1, Data, 511, Timestamp))
	{
		nvault_remove(g_Vault, arg1);
		new infobuff[64];
		new weapbuff[320];
		new skinbuff[450];
		new password[16];
		strtok(Data, password, 15, Data, 511, 61, MaxClients);
		formatex(infobuff, 63, "%s=%d,%d,%d,%d,%d,%d", password, 0, 0, 0, 0, 0, 0);
		formatex(weapbuff, 319, "%d", 0);
		new i = 1;
		while (i < 450)
		{
			format(weapbuff, 319, "%s,%d", weapbuff, 0);
			i++;
		}
		formatex(skinbuff, 449, "%d", -1);
		i = 2;
		while (i <= 30)
		{
			format(skinbuff, 449, "%s,%d", skinbuff, -1);
			i++;
		}
		formatex(Data, 511, "%s*%s#%s", infobuff, weapbuff, skinbuff);
		nvault_set(g_Vault, arg1, Data);
		resetStattrackStatus(arg1);
		console_print(id, "%s The account has been reseted [%s]", "[CSGO Classy]", arg1);
	}
	else
	{
		console_print(id, "%s The account was not found [%s]", "[CSGO Classy]", arg1);
	}
	return 1;
}

resetStattrackStatus(arg1[])
{
	if (g_nVaultStattrack == -1)
	{
		return 0;
	}
	new Data[512];
	new Timestamp;
	if (nvault_lookup(g_nVaultStattrack, arg1, Data, 511, Timestamp))
	{
		nvault_remove(g_nVaultStattrack, arg1);
		formatex(Data, 511, "%d", 0);
		new i = 1;
		while (i < 450)
		{
			format(Data, 511, "%s,%d", Data, 0);
			i++;
		}
		nvault_set(g_nVaultStattrack, arg1, Data);
		resetNvaultKillsToo(arg1);
	}
	return 0;
}

resetNvaultKillsToo(arg1[])
{
	new Data[512];
	new Timestamp;
	if (nvault_lookup(g_nVaultStattrackKills, arg1, Data, 511, Timestamp))
	{
		nvault_remove(g_nVaultStattrackKills, arg1);
		formatex(Data, 511, "%d", 0);
		new i = 1;
		while (i < 450)
		{
			format(Data, 511, "%s,%d", Data, 0);
			i++;
		}
		nvault_set(g_nVaultStattrackKills, arg1, Data);
	}
	return 0;
}

public concmd_getinfo(id, level, cid)
{
	if (!cmd_access(id, level, cid, 3, false))
	{
		return 1;
	}
	new arg1[8];
	new arg2[8];
	read_argv(1, arg1, 7);
	read_argv(2, arg2, 7);
	new num = str_to_num(arg2);
	switch (arg1[0])
	{
		case 82, 114:
		{
			new var2;
			if (num < 0 || num >= g_iRanksNum)
			{
				console_print(id, "%s Wrong index. Please choose a number between 0 and %d", "[CSGO Classy]", g_iRanksNum + -1);
			}
			else
			{
				new Name[32];
				ArrayGetString(g_aRankName, num, Name, "");
				new Kills = ArrayGetCell(g_aRankKills, num, MaxClients, MaxClients);
				console_print(id, "%s Information about rank with index: %d", "[CSGO Classy]", num);
				console_print(id, "%s Name: %s | Required kills: %d", "[CSGO Classy]", Name, Kills);
			}
		}
		case 83, 115:
		{
			new var1;
			if (num < 0 || num >= g_iSkinsNum)
			{
				console_print(id, "%s Wrong index. Please choose a number between 0 and %d", "[CSGO Classy]", g_iSkinsNum + -1);
			}
			else
			{
				new Name[32];
				ArrayGetString(g_aSkinName, num, Name, "");
				new Type[8];
				ArrayGetString(g_aSkinType, num, Type, 7);
				console_print(id, "%s Information about skin with index: %d", "[CSGO Classy]", num);
				switch (Type[0])
				{
					case 100:
					{
						console_print(id, "%s Name: %s | Type: Drop (D)", "[CSGO Classy]", Name);
					}
					default:
					{
						console_print(id, "%s Name: %s | Type: Craft (C)", "[CSGO Classy]", Name);
					}
				}
			}
		}
		default:
		{
			console_print(id, "%s Wrong index. Choose R or S", "[CSGO Classy]");
		}
	}
	return 1;
}

public concmd_kill(id)
{
	console_print(id, "You can not commit suicide");
	return 4;
}

bool:ValidMap(mapname[])
{
	if (is_map_valid(mapname))
	{
		return true;
	}
	new len = strlen(mapname) - 4;
	if (0 > len)
	{
		return false;
	}
	if (equali(mapname[len], ".bsp", MaxClients))
	{
		mapname[len] = 0;
		if (is_map_valid(mapname))
		{
			return true;
		}
	}
	return false;
}

readMapCycle(szFileName[], szNext[], iNext)
{
	new b;
	new i;
	new iMaps;
	new szBuffer[32];
	new szFirst[32];
	if (file_exists(szFileName, MaxClients))
	{
		i++;
		while (read_file(szFileName, i, szBuffer, "", b))
		{
			new var1;
			if (!(!isalnum(szBuffer[0]) || !ValidMap(szBuffer)))
			{
				if (!iMaps)
				{
					copy(szFirst, "", szBuffer);
				}
				iMaps++;
				if (iMaps > g_pos)
				{
					copy(szNext, iNext, szBuffer);
					g_pos = iMaps;
					return 0;
				}
			}
		}
	}
	if (!iMaps)
	{
		log_amx(g_warning, szFileName);
		get_mapname(szFirst, "");
	}
	copy(szNext, iNext, szFirst);
	g_pos = 1;
	return 0;
}

public client_death(killer, victim, weapon, hitplace)
{
	new victim_name[32];
	get_user_name(victim, victim_name, "");
	new killer_team = get_user_team(killer, {0}, MaxClients);
	new victim_team = get_user_team(victim, {0}, MaxClients);
	new var1;
	if (victim != killer && !victim_team == killer_team && !hitplace == 1 && !weapon == 4 && !weapon == 29)
	{
		xp[killer]++;
	}
	new var2;
	if (hitplace == 1 && !weapon == 29 && !victim_team == killer_team)
	{
		xp[killer] += 3;
	}
	new var3;
	if (weapon == 29 && !hitplace == 1 && !victim_team == killer_team)
	{
		xp[killer] += 5;
	}
	new var4;
	if (weapon == 29 && hitplace == 1 && !victim_team == killer_team)
	{
		xp[killer] += 7;
	}
	new var5;
	if (weapon == 4 && victim != killer && !victim_team == killer_team)
	{
		xp[killer] += 5;
	}
	if (victim == killer)
	{
		xp[killer] -= 2;
	}
	check_level(killer, 1);
	save_data(killer);
	return 0;
}

public check_level(id, sound)
{
	if (!is_user_connected(id))
	{
		return 1;
	}
	new name[32];
	get_user_name(id, name, "");
	if (40 > level[id])
	{
		while (xp_num[level[id]] <= xp[id])
		{
			level[id]++;
			if (sound)
			{
				if (level[id] == 40)
				{
					client_print_color(MaxClients, MaxClients, "\x04%s\x01 %L", "[CSGO Classy]", id, "RANGUP", name, ranks_names[rank[id][0]]);
					client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "RANGUP_BONUS", get_pcvar_num(rankLevelBonus));
					set_user_money(id, get_pcvar_num(rankLevelBonus) + get_user_money(id));
					return 1;
				}
				client_print_color(MaxClients, MaxClients, "\x04%s\x01 %L", "[CSGO Classy]", id, "RANGUP", name, ranks_names[rank[id][0]]);
				client_print_color(id, id, "\x04%s\x01 %L", "[CSGO Classy]", id, "RANGUP_BONUS", get_pcvar_num(rankLevelBonus));
				set_user_money(id, get_pcvar_num(rankLevelBonus) + get_user_money(id));
				set_ranks(id);
			}
		}
	}
	new var1;
	if (level[id] == 40 && xp[id] > xp_num[level[id] - 1])
	{
		xp[id] = xp_num[level[id] - 1];
		save_data(id);
	}
	if (40 <= level[id])
	{
		level[id] = 40;
		xp[id] = xp_num[level[id] - 1];
		save_data(id);
	}
	return 1;
}

public set_ranks(id)
{
	if (level[id] == 1)
	{
		rank[id] = 0;
	}
	if (level[id] == 2)
	{
		rank[id] = 1;
	}
	if (level[id] == 3)
	{
		rank[id] = 2;
	}
	if (level[id] == 4)
	{
		rank[id] = 3;
	}
	if (level[id] == 5)
	{
		rank[id] = 4;
	}
	if (level[id] == 6)
	{
		rank[id] = 5;
	}
	if (level[id] == 7)
	{
		rank[id] = 6;
	}
	if (level[id] == 8)
	{
		rank[id] = 7;
	}
	if (level[id] == 9)
	{
		rank[id] = 8;
	}
	if (level[id] == 10)
	{
		rank[id] = 9;
	}
	if (level[id] == 11)
	{
		rank[id] = 10;
	}
	if (level[id] == 12)
	{
		rank[id] = 11;
	}
	if (level[id] == 13)
	{
		rank[id] = 12;
	}
	if (level[id] == 14)
	{
		rank[id] = 13;
	}
	if (level[id] == 15)
	{
		rank[id] = 14;
	}
	if (level[id] == 16)
	{
		rank[id] = 15;
	}
	if (level[id] == 17)
	{
		rank[id] = 16;
	}
	if (level[id] == 18)
	{
		rank[id] = 17;
	}
	if (level[id] == 19)
	{
		rank[id] = 18;
	}
	if (level[id] == 20)
	{
		rank[id] = 19;
	}
	if (level[id] == 21)
	{
		rank[id] = 20;
	}
	if (level[id] == 22)
	{
		rank[id] = 21;
	}
	if (level[id] == 23)
	{
		rank[id] = 22;
	}
	if (level[id] == 24)
	{
		rank[id] = 23;
	}
	if (level[id] == 25)
	{
		rank[id] = 24;
	}
	if (level[id] == 26)
	{
		rank[id] = 25;
	}
	if (level[id] == 27)
	{
		rank[id] = 26;
	}
	if (level[id] == 28)
	{
		rank[id] = 27;
	}
	if (level[id] == 29)
	{
		rank[id] = 28;
	}
	if (level[id] == 30)
	{
		rank[id] = 29;
	}
	if (level[id] == 31)
	{
		rank[id] = 30;
	}
	if (level[id] == 32)
	{
		rank[id] = 31;
	}
	if (level[id] == 33)
	{
		rank[id] = 32;
	}
	if (level[id] == 34)
	{
		rank[id] = 33;
	}
	if (level[id] == 35)
	{
		rank[id] = 34;
	}
	if (level[id] == 36)
	{
		rank[id] = 35;
	}
	if (level[id] == 37)
	{
		rank[id] = 36;
	}
	if (level[id] == 38)
	{
		rank[id] = 37;
	}
	if (level[id] == 39)
	{
		rank[id] = 38;
	}
	if (level[id] == 40)
	{
		rank[id] = 39;
	}
	return 0;
}

public save_data(id)
{
	if (!is_user_connected(id))
	{
		return 1;
	}
	new auth[40];
	new data[50];
	switch (get_pcvar_num(rankSaveType))
	{
		case 1:
		{
			get_user_ip(id, auth, 39, 1);
		}
		case 2:
		{
			get_user_name(id, auth, 39);
		}
		case 3:
		{
			get_user_authid(id, auth, 39);
		}
		default:
		{
		}
	}
	formatex(data, 49, "%d %d", level[id], xp[id]);
	fvault_pset_data("csgoclassyrangs", auth, data);
	return 1;
}

public client_authorized(id)
{
	new var1;
	if (!is_user_bot(id) || !is_user_hltv(id))
	{
		get_user_authid(id, g_szAuthId[id], 35);
	}
	new auth[40];
	new data[50];
	new x1[10];
	new x2[10];
	switch (get_pcvar_num(rankSaveType))
	{
		case 1:
		{
			get_user_ip(id, auth, 39, 1);
		}
		case 2:
		{
			get_user_name(id, auth, 39);
		}
		case 3:
		{
			get_user_authid(id, auth, 39);
		}
		default:
		{
		}
	}
	fvault_get_data("csgoclassyrangs", auth, data, 49, 0);
	parse(data, x1, 9, x2, 9);
	level[id] = str_to_num(x1);
	xp[id] = str_to_num(x2);
	set_task(1073741824, "set_ranks", id, 353964, MaxClients, 353592, MaxClients);
	check_level(id, 0);
	return 0;
}

public showStatus(id)
{
	new var1;
	if (!is_user_bot(id) && is_user_connected(id))
	{
		new name[32];
		new pid = read_data(2);
		new userRank = g_iUserRank[pid];
		new szRank[32];
		ArrayGetString(g_aRankName, userRank, szRank, "");
		get_user_name(pid, name, "");
		new xxx = get_user_team(id, {0}, MaxClients);
		new xxx2 = get_user_team(pid, {0}, MaxClients);
		if (xxx2 == xxx)
		{
			set_hudmessage(47, 79, 79, -1082130432, 1058642330, 1, 1008981770, 1077936128, 1008981770, 1008981770, -1);
			ShowSyncHudMsg(id, g_status_sync, "%s \n%s \n%s [%d/%d]", name, szRank, ranks_names[rank[pid]], xp[pid], xp_num[level[pid]]);
		}
	}
	return 0;
}

public hideStatus(id)
{
	ClearSyncHud(id, g_status_sync);
	return 0;
}

notAnySkins(id)
{
	new i;
	new total;
	new num;
	while (i < g_iSkinsNum)
	{
		num = g_iUserSkins[id][i];
		if (num > 0)
		{
			total++;
		}
		i++;
	}
	return !total;
}

public joinGiveaway(id)
{
	if (g_bGiveAwayStarted)
	{
		client_print_color(id, id, "\x04[CSGO Classy]\x01 The \x04Giveaway\x01 is \x04avaible\x01 in the first\x04 25 rounds\x01 of every \x04match");
		return 1;
	}
	new iMenu = menu_create("\r[CSGO Classy] \wGiveaway", "ga_handler", MaxClients);
	new szItem[128];
	formatex(szItem, 127, "Skin \r[StatTrack (TM) %s]", g_szSkinName);
	menu_additem(iMenu, szItem, 381156, MaxClients, -1);
	formatex(szItem, 127, "Players \r[%d]", getGiveAwayPlayersNum());
	menu_additem(iMenu, szItem, 381156, MaxClients, -1);
	if (25 - g_iCurrentRound)
	{
		formatex(szItem, 127, "Countdown \r[%d rounds left]\n", 25 - g_iCurrentRound);
	}
	else
	{
		formatex(szItem, 127, "Countdown \r[Now]\n", 25 - g_iCurrentRound);
	}
	menu_additem(iMenu, szItem, 381156, MaxClients, -1);
	if (g_bJoinedGiveAway[id] == true)
	{
		formatex(szItem, 127, "%L", id, "RAFFLE_ALREADY_JOINED");
	}
	else
	{
		formatex(szItem, 127, "%L", id, "RAFFLE_JOIN");
	}
	menu_additem(iMenu, szItem, 381156, MaxClients, -1);
	menu_display(id, iMenu, MaxClients, -1);
	return 1;
}

public ga_handler(id, iMenu, iItem)
{
	if (iItem == -3)
	{
		_ShowMainMenu(id);
		menu_destroy(iMenu);
		return 1;
	}
	switch (iItem)
	{
		case 0, 1, 2:
		{
			joinGiveaway(id);
			menu_destroy(iMenu);
			return 1;
		}
		case 3:
		{
			if (g_bJoinedGiveAway[id])
			{
				joinGiveaway(id);
				menu_destroy(iMenu);
				return 1;
			}
			if (5 <= g_iUserSkins[id][g_iSkinID])
			{
				client_print_color(id, id, "\x04%s You \x04can not join\x01 the \x04Giveaway\x01, you already have the \x04max ammount\x01 of that\x04 skin", "[CSGO Classy]");
				joinGiveaway(id);
				return 1;
			}
			g_bJoinedGiveAway[id] = 1;
			new szName[32];
			get_user_name(id, szName, "");
			client_print_color(MaxClients, id, "\x04[CSGO Classy] %s\x01 has joined the \x04Giveaway", szName);
		}
		default:
		{
		}
	}
	menu_destroy(iMenu);
	return 1;
}

public event_RoundStart()
{
	if (g_bGiveAwayStarted)
	{
		return 0;
	}
	if (g_bWarmUp == true)
	{
		g_bGiveAwayStarted = 1;
	}
	g_iCurrentRound += 1;
	if (g_iCurrentRound == 25)
	{
		if (!getGiveAwayPlayersNum())
		{
			g_bGiveAwayStarted = 1;
			client_print_color(MaxClients, MaxClients, "\x04[CSGO Classy]\x01 Nobody joined the \x04Giveaway");
			return 0;
		}
		set_task(1065353216, "countDown", MaxClients, 353964, MaxClients, 447168, 10);
	}
	return 0;
}

public countDown()
{
	static iTime;
	if (!iTime)
	{
		iTime = 10;
	}
	set_hudmessage(47, 79, 79, 1017370378, 1051931443, MaxClients, 1036831949, 1065353216, 1036831949, 1045220557, -1);
	new var1;
	if (iTime == 1)
	{
		var1 = 447384;
	}
	else
	{
		var1 = 447388;
	}
	show_hudmessage(MaxClients, "The Giveaway winner will be choosen in %d second%s", iTime, var1);
	iTime -= 1;
	if (!iTime)
	{
		new iWinner = getRandomWinner();
		if (iWinner == -1)
		{
			return 0;
		}
		set_user_skins(iWinner, g_iSkinID, 1);
		new szWinnerName[32];
		get_user_name(iWinner, szWinnerName, "");
		client_print_color(MaxClients, MaxClients, "\x04[CSGO Classy] %s\x01 won\x04 StatTrack (TM) %s\x01 at the \x04Giveaway", szWinnerName, g_szSkinName);
		new iPlayers[32];
		new iNum;
		get_players(iPlayers, iNum, "ch", 351508);
		new i;
		while (i < iNum)
		{
			g_bJoinedGiveAway[iPlayers[i]] = 0;
			i++;
		}
		remove_task(121232, MaxClients);
		g_bGiveAwayStarted = 1;
	}
	return 0;
}

getRandomWinner()
{
	if (!getGiveAwayPlayersNum())
	{
		return -1;
	}
	new iPlayers[32];
	new iNum;
	new iPlayer;
	get_players(iPlayers, iNum, "ch", 351508);
	while (!g_bJoinedGiveAway[iPlayer] || !is_user_connected(iPlayer))
	{
	}
	new var2;
	if (g_bJoinedGiveAway[iPlayer])
	{
		var2 = iPlayer;
	}
	else
	{
		var2 = iPlayers[random(iNum)];
	}
	return var2;
}

getGiveAwayPlayersNum()
{
	new iPlayers[32];
	new iNum;
	new iCount;
	get_players(iPlayers, iNum, "ch", 351508);
	new i;
	while (i < iNum)
	{
		if (g_bJoinedGiveAway[iPlayers[i]])
		{
			iCount++;
		}
		i++;
	}
	return iCount;
}

public message_setfov(msg_id, msg_dest, id)
{
	if (!is_user_alive(id))
	{
		return 0;
	}
	zoom_control[id] = get_msg_arg_int(1);
	if (get_msg_arg_int(1) == 90)
	{
		set_msg_arg_int(1, get_msg_argtype(1), menus_control[id][3][22]);
	}
	return 0;
}

public fw_Weapon_Reload_Post(ent)
{
	static id;
	id = pev(ent, 18);
	new zoom = cs_get_user_zoom(id);
	new var1;
	if (get_user_weapon(id, 0, 0) == 8 || get_user_weapon(id, 0, 0) == 27)
	{
		if (zoom == 1)
		{
			UnScope(id);
		}
	}
	return 2;
}

public Event_New_Round()
{
	new id;
	new players[32];
	new num;
	get_players(players, num, "ac", 351508);
	new i;
	while (i < num)
	{
		id = players[i];
		new var1;
		if (get_user_weapon(id, 0, 0) == 8 || get_user_weapon(id, 0, 0) == 27)
		{
			UnScope(id);
		}
		i++;
	}
	return 0;
}

public FW_CmdStart(id, uc_handle, seed)
{
	if (!is_user_alive(id))
	{
		return 1;
	}
	if (is_user_bot(id))
	{
		return 1;
	}
	static zoom;
	static NewButton;
	NewButton = get_uc(uc_handle, 7);
	if (NewButton & 2048)
	{
		new var1;
		if (get_user_weapon(id, 0, 0) == 8 || get_user_weapon(id, 0, 0) == 27)
		{
			if (get_gametime() > g_ZoomTime[id])
			{
				zoom = cs_get_user_zoom(id);
				new var2;
				if (g_Zoom[id] && zoom == 1)
				{
					UnScope(id);
				}
				else
				{
					new var3;
					if (!g_Zoom[id] && zoom == 4)
					{
						Scope(id);
					}
				}
				g_ZoomTime[id] = get_gametime();
			}
		}
		g_Zoom[id] = 0;
	}
	return 2;
}

public fw_PlayerKilled(victim, attacker)
{
	set_task(1056964608, "hook_weapon", victim + 100, 353964, MaxClients, 353592, MaxClients);
	return 0;
}

public hook_weapon(id)
{
	HookCurWeapon2(id);
	new var1;
	if (!is_user_alive(id) && is_user_connected(id))
	{
		set_task(1056964608, "hook_weapon", id + 100, 353964, MaxClients, 353592, MaxClients);
	}
	return 0;
}

public select_crosshair(id)
{
	if (!is_user_connected(id))
	{
		return 0;
	}
	new cevir[10];
	new menu = menu_create("\r[CSGO Classy] \wCrosshair", "select_crosshair2", MaxClients);
	num_to_str(13, cevir, 9);
	new i;
	while (i < 12)
	{
		num_to_str(i, cevir, 9);
		menu_additem(menu, crosshair_list[i][0], cevir, MaxClients, -1);
		i++;
	}
	menu_display(id, menu, MaxClients, -1);
	return 0;
}

public select_crosshair2(id, menu, item)
{
	if (item == -3)
	{
		_ShowMainMenu(id);
		menu_destroy(menu);
		return 1;
	}
	new data[6];
	new iName[64];
	new access;
	new callback;
	menu_item_getinfo(menu, item, access, data, 5, iName, 63, callback);
	new key = str_to_num(data);
	menus_control[id][0] = key;
	HookCurWeapon2(id);
	save_crosshair(id);
	return 1;
}

public load_cross(id)
{
	new toplam[64];
	new bilgilertoplam[15];
	new steamid[32];
	new cross[5];
	new assault[5];
	new sniper[5];
	new fov[5];
	get_user_authid(id, steamid, "");
	formatex(toplam, 63, "%s-STEAMID", steamid);
	nvault_get(crosshairvault, toplam, bilgilertoplam, 14);
	parse(bilgilertoplam, cross, 4, assault, 4, sniper, 4, fov, 4);
	menus_control[id][0] = str_to_num(cross);
	menus_control[id][1] = str_to_num(assault);
	menus_control[id][2] = str_to_num(sniper);
	menus_control[id][3] = str_to_num(fov);
	new var1;
	if (menus_control[id][3] > 0 || menus_control[id][3] < 0)
	{
		menus_control[id][3] = 0;
	}
	if (equali(bilgilertoplam, 448020, MaxClients))
	{
		new var2;
		if (crosshaircontrols < -1 || crosshaircontrols > 12)
		{
			menus_control[id][0] = 0;
		}
		else
		{
			menus_control[id][0] = crosshaircontrols;
		}
		menus_control[id][1] = 0;
		menus_control[id][2] = 0;
		menus_control[id][3] = 0;
	}
	set_task(1056964608, "hook_weapon", id + 100, 353964, MaxClients, 353592, MaxClients);
	return 0;
}

public save_crosshair(id)
{
	new toplam[64];
	new bilgilertoplam[15];
	new steamid[32];
	get_user_authid(id, steamid, "");
	new var1;
	if (menus_control[id][3] > 0 || menus_control[id][3] < 0)
	{
		menus_control[id][3] = 0;
	}
	formatex(bilgilertoplam, 14, "%i %i %i %i", menus_control[id], menus_control[id][1], menus_control[id][2], menus_control[id][3]);
	formatex(toplam, 63, "%s-STEAMID", steamid);
	nvault_set(crosshairvault, toplam, bilgilertoplam);
	return 0;
}

public HookCurWeapon2(id)
{
	if (!is_user_connected(id))
	{
		return 0;
	}
	if (menus_control[id][0] != -1)
	{
		Hide_NormalCrosshair(id, 1);
	}
	new clip;
	new ammo;
	new w = get_user_weapon(id, clip, ammo);
	new var1;
	if (w == 18 || w == 3 || w == 24 || w == 13)
	{
		Hide_NormalCrosshair(id, 1);
		if (g_Zoom[id])
		{
			Msg_SetFOV(id, menus_control[id][3][22]);
			g_Zoom[id] = 0;
		}
		else
		{
			if (90 <= zoom_control[id])
			{
				Msg_SetFOV(id, menus_control[id][3][22]);
			}
		}
		g_bSomeBool = ~1 << id & 31 & g_bSomeBool;
		Msg_CurWeapon(id, 0, 0, 0);
		if (menus_control[id][2])
		{
			Msg_WeaponList(id, "csgoclassy/awp_scope", weapons_list[w][1][0], weapons_list[w][2][0], weapons_list[w][3][0], weapons_list[w][4][0], weapons_list[w][5][0], 0, 2, weapons_list[w][8][0]);
		}
		else
		{
			Msg_WeaponList(id, "weapon_awp", weapons_list[w][1][0], weapons_list[w][2][0], weapons_list[w][3][0], weapons_list[w][4][0], weapons_list[w][5][0], 0, 2, weapons_list[w][8][0]);
		}
		g_bSomeBool = ~1 << id & 31 & g_bSomeBool;
		Msg_CurWeapon(id, 1, 2, clip);
		return 0;
	}
	if (menus_control[id][0] == -1)
	{
		hook_weapon(id);
		new var2;
		if ((g_Zoom[id] == 1 && w == 8) || (g_Zoom[id] == 2 && w == 27))
		{
			Msg_SetFOV(id, 55);
		}
		else
		{
			if (g_Zoom[id])
			{
				UnScope(id);
			}
			Msg_SetFOV(id, menus_control[id][3][22]);
		}
		return 0;
	}
	new var5;
	if (w == 8 || w == 27)
	{
		new var9;
		if (g_Zoom[id] && menus_control[id][1] && ((g_Zoom[id] == 1 && w == 8) || (g_Zoom[id] == 2 && w == 27)))
		{
			Msg_WeaponList(id, "csgoclassy/aug_sprite", weapons_list[w][1][0], weapons_list[w][2][0], weapons_list[w][3][0], weapons_list[w][4][0], weapons_list[w][5][0], 0, 2, weapons_list[w][8][0]);
		}
		else
		{
			Msg_WeaponList(id, crosshair_list[menus_control[id][0]][2], weapons_list[w][1][0], weapons_list[w][2][0], weapons_list[w][3][0], weapons_list[w][4][0], weapons_list[w][5][0], 0, 2, weapons_list[w][8][0]);
		}
		Msg_SetFOV(id, 89);
		g_bSomeBool = ~1 << id & 31 & g_bSomeBool;
		Msg_CurWeapon(id, 1, 2, clip);
		g_bSomeBool = 1 << id & 31 | g_bSomeBool;
		new var10;
		if ((g_Zoom[id] == 1 && w == 8) || (g_Zoom[id] == 2 && w == 27))
		{
			Msg_SetFOV(id, 55);
		}
		else
		{
			if (g_Zoom[id])
			{
				UnScope(id);
			}
			Msg_SetFOV(id, menus_control[id][3][22]);
		}
		return 0;
	}
	if (g_Zoom[id])
	{
		UnScope(id);
	}
	Msg_WeaponList(id, crosshair_list[menus_control[id][0]][2], weapons_list[w][1][0], weapons_list[w][2][0], weapons_list[w][3][0], weapons_list[w][4][0], weapons_list[w][5][0], 0, 2, weapons_list[w][8][0]);
	Msg_SetFOV(id, 89);
	g_bSomeBool = ~1 << id & 31 & g_bSomeBool;
	Msg_CurWeapon(id, 1, 2, clip);
	g_bSomeBool = 1 << id & 31 | g_bSomeBool;
	Msg_SetFOV(id, menus_control[id][3][22]);
	return 0;
}

Scope(id)
{
	new clip;
	new ammo;
	new w = get_user_weapon(id, clip, ammo);
	if (w == 8)
	{
		g_Zoom[id] = 1;
	}
	else
	{
		if (w == 27)
		{
			g_Zoom[id] = 2;
		}
	}
	if (!menus_control[id][1])
	{
		HookCurWeapon2(id);
		return 0;
	}
	HookCurWeapon2(id);
	return 0;
}

UnScope(id)
{
	g_Zoom[id] = 0;
	if (!menus_control[id][1])
	{
		HookCurWeapon2(id);
		return 0;
	}
	HookCurWeapon2(id);
	return 0;
}

Hide_NormalCrosshair(id, flag)
{
	if (flag == 1)
	{
		message_begin(1, g_msgHideWeapon, 448208, id);
		write_byte(64);
		message_end();
	}
	else
	{
		message_begin(1, g_msgHideWeapon, 448208, id);
		write_byte(128);
		message_end();
	}
	return 0;
}

public block(iMsgID, iMsgType, iPlrID)
{
	if (1 << iPlrID & 31 & g_bSomeBool)
	{
		return 1;
	}
	return 0;
}

Msg_WeaponList(id, WeaponName[], PrimaryAmmoID, PrimaryAmmoMaxAmount, SecondaryAmmoID, SecondaryAmmoMaxAmount, SlotID, NumberInSlot, WeaponID, Flags)
{
	message_begin(1, g_Messages[0], 448208, id);
	write_string(WeaponName);
	write_byte(PrimaryAmmoID);
	write_byte(PrimaryAmmoMaxAmount);
	write_byte(SecondaryAmmoID);
	write_byte(SecondaryAmmoMaxAmount);
	write_byte(SlotID);
	write_byte(NumberInSlot);
	write_byte(WeaponID);
	write_byte(Flags);
	message_end();
	return 0;
}

Msg_CurWeapon(id, IsActive, WeaponID, ClipAmmo)
{
	message_begin(1, g_Messages[1], 448208, id);
	write_byte(IsActive);
	write_byte(WeaponID);
	write_byte(ClipAmmo);
	message_end();
	return 0;
}

Msg_SetFOV(id, Degrees)
{
	message_begin(1, g_Messages[3], 448208, id);
	write_byte(Degrees);
	message_end();
	return 0;
}

checkInstantDefault(id, iItemID)
{
	new iWeaponId = ArrayGetCell(g_aSkinWeaponID, iItemID, MaxClients, MaxClients);
	if (g_iUserSelectedSkin[id][iWeaponId] == iItemID)
	{
		if (iWeaponId == get_user_weapon(id, 0, 0))
		{
			new var1;
			if (g_bIsWeaponStattrack[id][iItemID] && !g_bShallUseStt[id][iWeaponId])
			{
				return 0;
			}
			set_pev(id, "bl", g_szDefaultSkinModel[iWeaponId]);
		}
		g_iUserSelectedSkin[id][iWeaponId] = -1;
		cs_set_viewmodel_body(id, iWeaponId, -1);
		cs_set_modelformat(id, iWeaponId, 448220);
		new var2;
		if (g_bIsWeaponStattrack[id][iItemID] && g_bShallUseStt[id][iWeaponId] && g_bUsedSttC[id][iItemID])
		{
			g_bIsWeaponStattrack[id][iItemID] = false;
		}
	}
	return 0;
}

getGiveawaySkin(szSkinName[])
{
	new model[48];
	new iRandomSkin = random_num(MaxClients, g_iSkinsNum);
	ArrayGetString(g_aSkinName, iRandomSkin, model, 47);
	copy(szSkinName, 47, model);
	return iRandomSkin;
}

public client_disconnected(id)
{
	g_iKills[id] = 0;
	g_iHS[id] = 0;
	g_fDmg[id] = 0;
	return 0;
}

public OnTakeDamage(iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits)
{
	new var1;
	if (is_user_connected(iAttacker) && iVictim != iAttacker && is_user_connected(iVictim))
	{
		if (cs_get_user_team(iVictim, 0) != cs_get_user_team(iAttacker, 0))
		{
			new var2 = g_fDmg[iAttacker];
			var2 = floatadd(var2, fDamage);
		}
		new var3 = g_fDmg[iAttacker];
		var3 = floatsub(var3, fDamage);
	}
	return 0;
}

public OnPlayerKilled()
{
	new iAttacker = read_data(1);
	new iVictim = read_data(2);
	new var1;
	if (is_user_connected(iAttacker) && iVictim != iAttacker && is_user_connected(iVictim))
	{
		if (cs_get_user_team(iVictim, 0) != cs_get_user_team(iAttacker, 0))
		{
			g_iKills[iAttacker]++;
			if (read_data(3))
			{
				g_iHS[iAttacker]++;
			}
		}
		g_iKills[iAttacker]--;
		if (read_data(3))
		{
			g_iHS[iAttacker]--;
		}
	}
	return 0;
}

public OnRoundEnd()
{
	new id = get_best_player();
	if (id == -1)
	{
		return 0;
	}
	new szName[32];
	get_user_name(id, szName, "");
	new var1;
	if (g_iHS[id] == 1)
	{
		var1 = 448576;
	}
	else
	{
		var1 = 448580;
	}
	client_print_color(MaxClients, id, "\x04[CSGO Classy] MVP\x01 of the round is\x04 %s\x01 with\x04 %i kills [%i headshot%s and %.1f damage]", szName, g_iKills[id], g_iHS[id], var1, g_fDmg[id]);
	_GiveBonus(id, 1);
	arrayset(g_iKills, MaxClients, 33);
	arrayset(g_iHS, MaxClients, 33);
	new i;
	while (i < 33)
	{
		g_fDmg[i] = 0;
		i++;
	}
	return 0;
}

get_best_player()
{
	new iPlayers[32];
	new iPnum;
	new id;
	get_players(iPlayers, iPnum, 389708, 351508);
	new i;
	new iPlayer;
	while (i < iPnum)
	{
		iPlayer = iPlayers[i];
		if (g_iKills[id] < g_iKills[iPlayer])
		{
			id = iPlayer;
		}
		else
		{
			if (g_iKills[id] == g_iKills[iPlayer])
			{
				if (g_fDmg[iPlayer] > g_fDmg[id])
				{
					id = iPlayer;
				}
			}
		}
		i++;
	}
	new var1;
	if (g_iKills[id])
	{
		var1 = id;
	}
	else
	{
		var1 = -1;
	}
	return var1;
}

renegade wrote:
05 Mar 2021, 13:59
iar tu, Adi, stii bine care a fost primul client, ca de acolo te-ai inspirat si tu, zana mica.
Am zis primul client la modul tau, nu nubo cu antilicenta =)))

Care e problema sa fii inspirat sa faci un anumit lucru lmao
renegade wrote:
05 Mar 2021, 13:59
Apropo, cand reusiti sa realizati si voi ceva, ma anuntati si pe mine sa va trimit o felicitare.
https://github.com/ShadowsAdi/CSGORemake Mod CSGO Remake GRATUIT care are mult mai multe functii si mult mai optimizat + credite celor care le merita. Tot ce ai tu in modul tau poate fi usor recreeat in modul acesta folosind nativele si apelativele pe care le-am pus la dispozitie.
User avatar
andrei0465
Membru, skill 0
Membru, skill 0
Posts: 65
Joined: 01 Nov 2016, 17:04
Detinator Steam: Da
CS Status: Busy
SteamID: andrei0465
Reputatie: Membru Club eXtreamCS (21.03 - 21.04)
Fond eXtream: 0
Has thanked: 3 times
Been thanked: 4 times

05 Mar 2021, 14:54

Incerc cat pot de mult sa vorbesc frumos, dar se pare ca esti de pe alta planeta si nu intelegi, tu doar crezi ca toti sunt invidiosi pe tine.
renegade wrote:Syko, e fost client de-al meu...
renegade wrote:EDIT 3: Syko, chiar nu imi aduc aminte cine esti...
Si asa se manifesta schizofrenia, copii.
renegade wrote:Lysis nu functioneaza pe mod
Serios? Functioneaza si chiar foarte bine. Daca vrei sa vezi un exemplu de protectie uite aici (incearca sa decompilezi cu orice metoda existenta): https://github.com/kuamquat940/csgorema ... ke1gx.amxx
renegade wrote:Apropo, kuamquat, nu mai lua CS de la rusi si dupa mananci cct ca primesti crash cand intrii pe server
Nu, nu folosesc CS de la rusi, e cel original de pe steam.
renegade wrote:Apropo, cand reusiti sa realizati si voi ceva, ma anuntati si pe mine sa va trimit o felicitare
Furtul de pluginuri nu se pune ca realizare, imi pare rau.
User avatar
renegade
Membru, skill +1
Membru, skill +1
Posts: 150
Joined: 10 Mar 2018, 12:54
Detinator Steam: Da
CS Status: Disconnected
SteamID: /id/renegadeidg
Fond eXtream: 0
Has thanked: 11 times
Been thanked: 4 times

05 Mar 2021, 15:07

User avatar
Syko
Membru, skill +1
Membru, skill +1
Posts: 131
Joined: 14 Apr 2019, 21:45
Detinator Steam: Da
CS Status: Good
SteamID: sykozawr
Fond eXtream: 0
Location: Bucuresti
Discord: sykozawr
Has thanked: 10 times
Been thanked: 5 times
Contact:

05 Mar 2021, 15:46

renegade wrote:
05 Mar 2021, 13:59
Vorbiti numai tampenii, erorile alea doua ce sunt sunt doar niste index out of bounds, Syko, e fost client de-al meu, nu stiu sigur care era, dar oricum, vorbeste mult, prost si fara rost. Lysis nu functioneaza pe mod, apreciez totusi vorbele, iar tu, Adi, stii bine care a fost primul client, ca de acolo te-ai inspirat si tu, zana mica. Nu mai comentez ca uzez tastatura pe niste oameni care nu merita, salut. Apropo, kuamquat, nu mai lua CS de la rusi si dupa mananci cct ca primesti crash cand intrii pe server =)))
Apropo, cand reusiti sa realizati si voi ceva, ma anuntati si pe mine sa va trimit o felicitare. Pana atunci ciocu' mic si observati in continuare.

EDIT: continuati ca e foarte entertaining
Pana atunci va las o piesa sa plangeti pe ea in continuare: https://www.youtube.com/watch?v=5MkK-gY ... aliVijelie

EDIT 2: Syko, bugul ala de zici tu la VIP nu e bug, ala e facut daca tu vrei sa adaugi mai mult de 100hp la vip, iar daca adaugi, abilitatea hpregeneration sa-ti ofere suport pentru el.

EDIT 3: Syko, chiar nu imi aduc aminte cine esti, dar mai mult ca sigur esti vreun frustrat care a pierdut suportul de la mine pentru fitele care le face, corect?
Nu sunt client de-al tau, nu am cumparat modul si nici n-o sa-l cumpar vreodata, nu-mi trebuie :))

Proiectul meu - > serverul de la profilul meu, uita-te peste mod, avand in vedere ca Carnacior n-a vrut sa mi dea sursa a trebuit sa mi-o fac singur!
Site de la 0 - > http://serverul de la profilul meu
Addons Deathrun facut pentru dr.reclama.ro (mysql ca eu doar asa lucrez).
Addons CSGO Mod pe care am vrut sa-l vand insa n-are sens ca toti cumpara de la tine.
Mai am un site la vanzare daca te uiti prin sectiunea anunturi, un site facut pe adminlte 2.

Cat despre erorile alea, eu n-am zis ca nu stii sa le rezolvi, am mentionat clar SE SPAMEAZA LOGS CU ELE.
Last edited by Syko on 05 Mar 2021, 17:34, edited 2 times in total.
Post Reply

Return to “Anunturi”

  • Information