Zombie Survival ( 2.5 alpha )

Aici vom publica si discuta despre diverse moduri necesare serverelor dedicate.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
N3v3rM1nd
Membru, skill +2
Membru, skill +2
Posts: 794
Joined: 06 Oct 2018, 14:41
Detinator Steam: Da
SteamID: /id/kidd0x/
Fond eXtream: 0
Location: Constangeles
Discord: kidd0x#1886
Has thanked: 135 times
Been thanked: 73 times

24 Jan 2023, 22:40

Ma plictiseam si am zis sa fac si eu ceva sa treaca timpul mai repede 😅
Modul este unul PvE, in care omori zombie, iti upgradezi abilitatile, deblochezi efecte si pet-uri si multe altele

Pe partea de Scripting nu este ceva wow pentru ca nu prea mi-am batut capul.

⭐ Modul este la inceput, deci va ma primii update-uri⭐
⭐ Modul este facut pe Windows, HLDS, AMXX 190, netestat pe Linux)⭐
⭐ Resursele contin modele/sprites/amxx/sma si alte fisiere aditionale ⭐
⭐ To install: Drag & Drop in Half-Life/cstrike/⭐

Credite
🏆 tuturor de unde m-am inspirat cu bucati de cod :) 🏆
🏆 DeclineD, a ajutat si el pe ici colo :) 🏆

Update 2.5 alpa
- adaugate cvar-uri
  • cvar_min_players (minimul de playeri pentru ca modul sa inceapa)
    cvar_norecoil_price (pret norecoil)
    cvar_jumps_price (x2 jump price)
    cvar_max_hpap (upgrade maxim la hp & ap)
    cvar_hpap_price (pret upgrade hp & ap)
    cvar_speed_price (pret upgrade viteza)
    cvar_max_speed (upgrade maxim la viteza)
    cvar_gravity_price (pret upgrade la gravitatie)
    cvar_max_gravity (upgrade maxim la gravitatie)
    cvar_damage_price (pret upgrade damage)
    cvar_max_damage (upgrade maxim la damage)
    cvar_chattag_price (pret la chat tag)
    cvar_glow_price (pret player glow)
    cvar_wplaser_price (pret weapon tracers)
    cvar_pet_price (pret pet)
    cvar_killeffects_price (pret kill effects)
  • Codul-ul a fost 'retusat'
  • Au fost adaugate evolutii
Sursa

Code: Select all

#include <amxmodx>
#include <cstrike>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta_util>
#include <rog>
#include <engine>
#include <nvault>
#include <fun>

#define TAG "^4[Zombie Mode]^1"
#define MAX_LEVELS 31
#define MAX_EVOLUTIONS 5

#define chx(%1)	charsmax(%1)
#pragma unused CheckPointsForVisibility

enum _: lvldata
{
	LevelTag[25],
	LevelReqKills,
	LevelUpBonusPoints
}

enum _: wpndata
{
	weaponname[32],
	weapon_data[16],
	weapon_level
}

enum _: evodata
{
	evo_name[32],
	evo_state // folosit pentru urmatorul update
}

enum
{
	Save = 0,
	Load
}

enum (+= 100)
{
	CAN_START_TASKID = 900,
	HUD_TASKID,
	CHAT_TAG_TASKID,
	RANDOM_THINGS_TASKID
}

enum plData
{
	EVOLUTION,
	POINTS,
	KILLS,
	LEVEL,
	GRAVES
}

enum plUpgrades
{
	NORECOIL,
	HP_AP,
	SPEED,
	GRAVITY,
	DAMAGE,
	JUMPS
}

enum plCosmetics
{
	CHAT_TAG,
	GLOW,
	TRACERS,
	PET,
	KILL_EFFECTS
}



new const LevelData[MAX_LEVELS][lvldata] = 
{
	{"N00b", 0, 10},
	{"Level 1", 10, 10}, 	{"Level 11", 200, 10}, 	{"Level 21", 1400, 10},
	{"Level 2", 20, 20}, 	{"Level 12", 300, 10}, 	{"Level 22", 1600, 10},
	{"Level 3", 30, 30}, 	{"Level 13", 400, 10}, 	{"Level 23", 1800, 10},
	{"Level 4", 40, 40}, 	{"Level 14", 500, 10}, 	{"Level 24", 2000, 10},
	{"Level 5", 50, 50}, 	{"Level 15", 600, 10}, 	{"Level 25", 2200, 10},
	{"Level 6", 60, 60}, 	{"Level 16", 700, 10}, 	{"Level 26", 2400, 10},
	{"Level 7", 70, 70}, 	{"Level 17", 800, 10}, 	{"Level 27", 2600, 10},
	{"Level 8", 80, 80}, 	{"Level 18", 900, 10}, 	{"Level 28", 2800, 10},
	{"Level 9", 90, 90}, 	{"Level 19", 1000, 10}, {"Level 29", 3000, 10},
	{"Level 10", 100, 100},	{"Level 20", 1200, 10}, {"Level 30", 5000, 10}	
}

new const Evolutions[MAX_EVOLUTIONS][evodata] =
{
	{"Evolution Phase I", 1},
	{"Evolution Phase II", 2},
	{"Evolution Phase III", 3},
	{"Evolution Phase IV", 4},
	{"Evolution Phase V", 5}
}

new const WeaponData[][wpndata] =
{
	{"P90", "weapon_p90", 0},
	{"M4A1", "weapon_m4a1", 5},
	{"AK47", "weapon_ak47", 15},
	{"XM1014", "weapon_xm1014", 30}
}

new const ZombieModels[][] =
{
	"zombie_model",
	"zombie_model2",
	"zombie_model3",
	"zombie_model4"
}

new const BonusDropsModels[][] =
{
	"models/zombie_mod/cadou.mdl"
}

new const PetModels[][] =
{
	"models/zombie_mod/rodrigo.mdl",
	"models/zombie_mod/floater.mdl",
	"models/zombie_mod/liliac.mdl",
	"models/zombie_mod/gorila.mdl",
	"models/zombie_mod/joker.mdl"
}

new const PetSounds[5][] =
{
	"zombie_mod/pet_sounds/joker_spawn.wav",
	"zombie_mod/pet_sounds/harambe_spawn.wav",
	"zombie_mod/pet_sounds/liliac_spawn.wav",
	"zombie_mod/pet_sounds/floater_spawn.wav",
	"zombie_mod/pet_sounds/rodrigo_spawn.wav"
}


new const GraveModels[][] =
{
	"models/zombie_mod/grave.mdl"
}

new const GraveSounds[1][] =
{
	"zombie_mod/grave_sounds/grave_destroy.wav"
}



new const Float: g_flCoords[][] =
{
    {0.50, 0.40},
    {0.56, 0.44},
    {0.60, 0.50},
    {0.56, 0.56},
    {0.50, 0.60},
    {0.44, 0.56},
    {0.40, 0.50},
    {0.44, 0.44}
}

new g_iPlayerPos[MAX_PLAYERS + 1]

new const BlockedHams[][] =
{
	"weaponbox",
	"armoury_entity",
	"weapon_shield",
	"func_bomb_target",
	"weapon_c4"
}

new const BlockedCommands[][] =
{
	"drop"
}

const ZOMBIE_HP = 10
const KILL_POINTS = 50

const BLOCKED_WEAPONS = (1<<CSW_KNIFE|1<<CSW_HEGRENADE|1<<CSW_FLASHBANG|1<<CSW_SMOKEGRENADE|1<<CSW_C4)
new const g_maxammo[] = 
{
	0, 13, 0, 10, 0, 7, 0, 30, 30, 0, 15, 20,
    25, 30, 35, 25, 12, 20, 10, 30, 100, 8, 
    30, 30, 20, 0, 7, 30, 30, 0, 50
}

static const BonusDropClassName[] = "BonusDrop"
static const PetClassName[] = "BatClass"
static const GraveClassName[] = "CruceaMatii"

new sync
new bool: g_bCanGameStart
new bool: g_bCanSetTagChat[MAX_PLAYERS + 1], 
		  g_PlayerTag[33][MAX_PLAYERS + 1]

new bool: g_bRandomGlowSet[MAX_PLAYERS + 1], g_bRandommenuSet[MAX_PLAYERS + 1]
new g_PlayerPetModel[MAX_PLAYERS + 1][64]

new g_TraceBeams
new color[MAX_PLAYERS + 1][3]
new iJumpNum[MAX_PLAYERS + 1] = 0
new bool: bDoJump[MAX_PLAYERS + 1] = false

new Float: g_flPushAngle[MAX_PLAYERS + 1][3]

new pet[MAX_PLAYERS + 1], g_bHasPetSpawned[MAX_PLAYERS + 1]
new g_plPet[MAX_PLAYERS + 1], g_plKillEffect[MAX_PLAYERS + 1]

new g_name[MAX_PLAYERS + 1][MAX_NAME_LENGTH]
new g_nVault,
	g_nVaultFile[] = "alupigus"

new g_ShowAdminsFile[MAX_FMT_LENGTH]
new g_msgLightning, g_msgExplode

new g_plData[MAX_PLAYERS + 1][plData]
new g_plUpgrades[MAX_PLAYERS + 1][plUpgrades]
new g_plCosmetics[MAX_PLAYERS + 1][plCosmetics]

new cvar_min_players, cvar_norecoil_price, cvar_jumps_price, cvar_hpap_price, cvar_max_hpap, 
		cvar_speed_price, cvar_max_speed, cvar_gravity_price, cvar_max_gravity,
		cvar_damage_price, cvar_max_damage, cvar_chattag_price, cvar_glow_price,
		cvar_wplaser_price, cvar_pet_price, cvar_killeffects_price

public plugin_init()
{
	register_plugin("[Zombie Mod v2]", "2.5 alpha", "kidd0x")

	register_message(get_user_msgid("ShowMenu"), "message_show_menu")
	register_message(get_user_msgid("VGUIMenu"), "message_vgui_menu")

	RegisterHam(Ham_Spawn, "player", "ham_spawn", 1)
	RegisterHam(Ham_TakeDamage, "player", "fwd_takedamage")

	for(new i; i < sizeof BlockedHams; i++)
		RegisterHam(Ham_Touch, BlockedHams[i], "@goto_hamsupercede")

	for(new i; i < sizeof BlockedCommands; i++)
		register_clcmd(BlockedCommands[i], "@goto_return_handled")

	register_clcmd("jointeam", "to_open_menu")
	register_clcmd("chooseteam", "to_open_menu")

	register_clcmd("say", "hook_say")
	register_clcmd("say_team", "hook_say")
	register_clcmd("say /cam", "open_camera")

	register_event("ResetHUD", "ev_resethud", "be")
	register_event("DeathMsg", "ev_deathmessage", "a")
	register_event("CurWeapon", "ev_curweapon", "be", "1=1")
	register_event("CurWeapon", "ev_maketracer", "be", "1=1", "3>0")
	register_event("Damage", "ev_damage", "b", "2>0", "3=0")
	register_event("TextMsg", "ev_restartround", "a", "2&#Game_C", "2&#Game_w")

	register_forward(FM_Touch, "Touch")
	register_forward(FM_Think, "FM_Think_hook")

	new wn[24]
	for(new i = 1; i <= 30; i++)
	{
		if(!(BLOCKED_WEAPONS & 1 << i) && get_weaponname(i, wn, chx(wn)))
		{
			RegisterHam(Ham_Weapon_PrimaryAttack, wn, "fwd_weapon_primaryattack_pre")
			RegisterHam(Ham_Weapon_PrimaryAttack, wn, "fwd_weapon_primaryattack_post", 1)
		}
	}

	new szConfigsDir[128]
	get_configsdir(szConfigsDir, chx(szConfigsDir))
	formatex(g_ShowAdminsFile, chx(g_ShowAdminsFile), "%s/amx_who.ini", szConfigsDir)

	ROGInitialize(100.0) // incercam sa spawnam botii cat mai aproape unu de altul

	g_nVault = nvault_open(g_nVaultFile)
	if(g_nVault == INVALID_HANDLE)
		set_fail_state("[ZombieMod] Ooops, ceva s-a intamplat cu fisierul nVault !")

	cvar_min_players = register_cvar("zm_min_players", "1")
	cvar_norecoil_price = register_cvar("zm_no_recoil_price", "10000")
	cvar_jumps_price = register_cvar("zm_jumps_price", "3000")
	cvar_max_hpap = register_cvar("zm_max_hpap", "20")
	cvar_hpap_price = register_cvar("zm_hpap_price", "1500")
	cvar_speed_price = register_cvar("zm_speed_price", "5000")
	cvar_max_speed = register_cvar("zm_max_speed", "5")
	cvar_gravity_price = register_cvar("zm_gravity_price", "2000")
	cvar_max_gravity = register_cvar("zm_max_gravity", "3")
	cvar_damage_price = register_cvar("zm_damage_price", "2500")
	cvar_max_damage = register_cvar("zm_max_damage", "5")
	cvar_chattag_price = register_cvar("zm_chattag_price", "25000")
	cvar_glow_price = register_cvar("zm_glow_price", "5000")
	cvar_wplaser_price = register_cvar("zm_wplaser_price", "3500")
	cvar_pet_price = register_cvar("zm_pet_price", "50000")
	cvar_killeffects_price = register_cvar("zm_kill_effects_price", "35000")

	server_cmd("yb removebots")
	g_bCanGameStart = false

	set_task(1.0, "CanGameStart", CAN_START_TASKID)
	sync = CreateHudSyncObj()
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
public CanGameStart()
{
	if(task_exists(CAN_START_TASKID) && g_bCanGameStart)
			remove_task(CAN_START_TASKID)

	new iPlayers[MAX_PLAYERS], iNum
	get_players(iPlayers, iNum, "cei", "CT")

	if(iNum >= get_pcvar_num(cvar_min_players))
	{
		if(task_exists(CAN_START_TASKID))
			remove_task(CAN_START_TASKID)

		g_bCanGameStart = true
		client_print_color(0, print_team_default, "%s Jocul a inceput! Have fun killing enemies :D", TAG)
		PrepareGame()
	}
	else 
	{
		g_bCanGameStart = false
		set_task(1.0, "CanGameStart", CAN_START_TASKID, _, _, "b")
	}
}

public PrepareGame()
{
	// hardcode pentru boti
	server_cmd("sv_restart 1")
	server_cmd("mp_limitteams 0")
	server_cmd("mp_autoteambalance 0")
	server_cmd("mp_freezetime 0")
	server_cmd("sv_maxspeed 999")
	server_cmd("mp_forcechasecam 1")
	set_lights("d")
	server_cmd("yb_jasonmode 1")

	for(new i; i < 10; i++)
		server_cmd("yb add_t 3 2")

}
///////////////////////////////////////////////////////////////////////////////////////////////////////

public client_authorized(id)
{
	if(!g_plData[id][POINTS] || !g_plData[id][KILLS] || !g_plData[id][LEVEL] || !g_plData[id][EVOLUTION])
	{
		g_plData[id][POINTS] = 0
		g_plData[id][KILLS] = 0
		g_plData[id][LEVEL] = 0
		g_plData[id][GRAVES] = 0
		g_plData[id][EVOLUTION] = 0
	}

	if(!g_plCosmetics[id][GLOW] || !g_plCosmetics[id][TRACERS] || !g_plCosmetics[id][PET])
	{
		g_plCosmetics[id][GLOW] = 0
		g_plCosmetics[id][TRACERS] = 0
		g_plCosmetics[id][PET] = 0
		g_plCosmetics[id][KILL_EFFECTS] = 0
	}

	if(!g_plUpgrades[id][NORECOIL] || !g_plUpgrades[id][HP_AP] || !g_plUpgrades[id][SPEED] || !g_plUpgrades[id][GRAVITY] || !g_plUpgrades[id][DAMAGE] || !g_plUpgrades[id][JUMPS])
	{
		g_plUpgrades[id][NORECOIL] = 0
		g_plUpgrades[id][HP_AP] = 0
		g_plUpgrades[id][SPEED] = 0
		g_plUpgrades[id][GRAVITY] = 0
		g_plUpgrades[id][DAMAGE] = 0
		g_plUpgrades[id][JUMPS] = 0
	}

}
public client_putinserver(id)
{
	get_user_name(id, g_name[id], chx(g_name))

	ManageData(id, Load)
	iJumpNum[id] = 0
	bDoJump[id] = false
}

public client_disconnected(id)
{
	ManageData(id, Save)
	iJumpNum[id] = 0
	bDoJump[id] = false
}

public plugin_end()
{
	new iPlayers[MAX_PLAYERS], iNum
	get_players(iPlayers, iNum)

	for(new i; i < iNum; i++)
	{
		ManageData(i, Save)
	}
	nvault_close(g_nVault)
}

public plugin_precache()
{
	new path[MAX_RESOURCE_PATH_LENGTH], i
	for(i = 0; i < sizeof ZombieModels; i++)
	{
		formatex(path, chx(path), "models/player/%s/%s.mdl", ZombieModels[i], ZombieModels[i])
		precache_model(path)
	}

	for(i = 0; i < sizeof BonusDropsModels; i++)
	{
		formatex(path, chx(path), "%s", BonusDropsModels[i])
		precache_model(path)
	}

	for(i = 0; i < sizeof PetModels; i++)
	{
		formatex(path, chx(path), "%s", PetModels[i])
		precache_model(path)
	}

	for(i = 0; i < sizeof GraveModels; i++)
	{
		formatex(path, chx(path), "%s", GraveModels[i])
		precache_model(path)
	}

	for(i = 0; i < sizeof PetSounds; i++)
	{
		formatex(path, chx(path), "%s", PetSounds[i])
		precache_sound(path)
	}

	for(i = 0; i < sizeof GraveSounds; i++)
	{
		formatex(path, chx(path), "%s", GraveSounds[i])
		precache_sound(path)
	}
	
	
	precache_model("models/rpgrocket.mdl")
	g_TraceBeams = precache_model("sprites/dot.spr")
	g_msgLightning = precache_model("sprites/white.spr")

}

public ev_restartround()
{
	remove_entity_name(BonusDropClassName)
	remove_entity_name(GraveClassName)
}

///////////////////////////////////////////////////////////////////////////////////////////////////////
ManageData(id, type)
{
	new szData[MAX_FMT_LENGTH]
	formatex(szData, chx(szData), "%i#%i#%i#%i#%i#%i#%i#%i#%i#%i#%i#%i#%s#%i#%i#%i#%i", g_plData[id][EVOLUTION], g_plData[id][POINTS], g_plData[id][KILLS], g_plData[id][LEVEL], g_plData[id][GRAVES],
													g_plUpgrades[id][NORECOIL], g_plUpgrades[id][HP_AP], g_plUpgrades[id][SPEED], g_plUpgrades[id][GRAVITY], g_plUpgrades[id][DAMAGE], g_plUpgrades[id][JUMPS],
													g_plCosmetics[id][CHAT_TAG], g_PlayerTag[id], g_plCosmetics[id][GLOW], g_plCosmetics[id][TRACERS], g_plCosmetics[id][PET], g_plCosmetics[id][KILL_EFFECTS])
	switch(type)
	{
		case Save:
			nvault_set(g_nVault, g_name[id], szData)

		case Load:
		{
			nvault_get(g_nVault, g_name[id], szData, chx(szData))
			replace_all(szData, chx(szData), "#", " ")

			new iEvolution[32], iPoints[32], iKills[32], iLevel[32], iGraves[32],
				iUpgNr[32], iUpgHPAP[32], iUpgSpd[32], iUpgGrav[32], iUpgDmg[32],
				iUpgShDis[32], iCsmCT[32], szTag[32], iCsmGlow[32], iCsmTrc[32],
				iCsmPet[32], iCsmKE[32]

			parse(szData, iEvolution, 31, iPoints, 31, iKills, 31, iLevel, 31, iGraves, 31,
							iUpgNr, 31, iUpgHPAP, 31, iUpgSpd, 31, iUpgGrav, 31,
							iUpgDmg, 31, iUpgShDis, 31, iCsmCT, 31, szTag, 31, iCsmGlow, 31,
							iCsmTrc, 31, iCsmPet, 31, iCsmKE, 31)

			g_plData[id][EVOLUTION] = str_to_num(iEvolution)
			g_plData[id][POINTS] = str_to_num(iPoints)
			g_plData[id][KILLS] = str_to_num(iKills)
			g_plData[id][LEVEL] = str_to_num(iLevel)
			g_plData[id][GRAVES] = str_to_num(iGraves)
			g_plUpgrades[id][NORECOIL] = str_to_num(iUpgNr)
			g_plUpgrades[id][HP_AP] = str_to_num(iUpgHPAP)
			g_plUpgrades[id][SPEED] = str_to_num(iUpgSpd)
			g_plUpgrades[id][GRAVITY] = str_to_num(iUpgGrav)
			g_plUpgrades[id][DAMAGE] = str_to_num(iUpgDmg)
			g_plUpgrades[id][JUMPS] = str_to_num(iUpgShDis)
			g_plCosmetics[id][CHAT_TAG] = str_to_num(iCsmCT)
			g_plCosmetics[id][GLOW] = str_to_num(iCsmGlow)
			g_plCosmetics[id][TRACERS] = str_to_num(iCsmTrc)
			g_plCosmetics[id][PET] = str_to_num(iCsmPet)
			g_plCosmetics[id][KILL_EFFECTS] = str_to_num(iCsmKE)

			copy(g_PlayerTag[id], chx(g_PlayerTag), szTag)
		}
	}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
public ham_spawn(id)
{
	if(is_user_alive(id) && g_bCanGameStart)
	{
		new Float: flOrigins[3]
		ROGGetOrigin(flOrigins)
		engfunc(EngFunc_SetOrigin, id, flOrigins)

		if(!is_user_bot(id))
		{
			if(g_plData[id][LEVEL] == MAX_LEVELS)
				g_plData[id][LEVEL] = MAX_LEVELS - 1

			if(g_plCosmetics[id][PET] == 1)
				CreatePet(id)

			new Float: viata = float(100 + (5 * g_plData[id][LEVEL] * g_plUpgrades[id][HP_AP]))
			new Float: armura = float(100 + (10 * g_plData[id][LEVEL] * g_plUpgrades[id][HP_AP]))

			set_pev(id, pev_health, viata)
			set_pev(id, pev_armorvalue, armura)

			emessage_begin(MSG_ONE_UNRELIABLE, get_user_msgid("Health"), _, id)
			ewrite_byte(255)
			emessage_end()

			ev_curweapon(id)

			GiveWeapons(id)
				
			set_task(1.0, "ShowHUD", id + HUD_TASKID, _, _, "b")	
		}
		else
		{
			cs_set_user_model(id, ZombieModels[random_num(0, chx(ZombieModels))], true)
			set_pev(id, pev_health, float(ZOMBIE_HP))
		}
	}
}

///////////////////////////////////////////////////////////////////////////////////////////////////////
public ev_resethud(id)
{
	ShowHUD(id)
}

public ev_deathmessage()
{
	new iKiller = read_data(1)
	new iVictim = read_data(2)

	if(iKiller > get_maxplayers() || iKiller == iVictim)
		return

	g_plData[iKiller][POINTS] += KILL_POINTS
	g_plData[iKiller][KILLS]++

	ManageData(iKiller, Save)

	new vOrigin[3], vCoord[3], vEnd[3]
	get_user_origin(iVictim, vOrigin, 0)
	get_user_origin(iKiller, vEnd, 0)

	vOrigin[2] -= 26
	vCoord[0] = vOrigin[0] + 150
	vCoord[1] = vOrigin[1] + 150
	vCoord[2] = vOrigin[2] + 800


	if(is_user_bot(iVictim))
	{
		switch(g_plKillEffect[iKiller])
		{
			case 1: thunder(vCoord, vOrigin)
			case 2: create_explode(vOrigin)
			case 3: create_implosion(vOrigin)
		}
	}
	
	new sansa_grave = random_num(0, 50)
	if(sansa_grave > 1)
		set_task(0.1, "SpawnGrave", iVictim)

	new sansa_box = random_num(0, 10)
	if(sansa_box > 8)
		set_task(0.1, "SpawnBox", iVictim)

	set_task(0.5, "SpawnPlayer", iVictim)

	if((g_plData[iKiller][LEVEL] < MAX_LEVELS - 1) && !is_user_bot(iKiller))
	{
		while(g_plData[iKiller][KILLS] >= LevelData[g_plData[iKiller][LEVEL]][LevelReqKills])
		{
			g_plData[iKiller][LEVEL]++
			client_print_color(0, print_team_default, "%s %n a avansat la nivelul %d (%s)! A primit %d puncte bonus !", TAG, iKiller, g_plData[iKiller][LEVEL], LevelData[g_plData[iKiller][LEVEL]][LevelTag], LevelData[g_plData[iKiller][LEVEL]][LevelUpBonusPoints])
			g_plData[iKiller][POINTS] += LevelData[g_plData[iKiller][LEVEL]][LevelUpBonusPoints]
		}
	}

}
///////////////////////////////////////////////////////////////////////////////////////////////////////
public KillPet(id)
{
	if(pev_valid(pet[id]))
	{
		engfunc(EngFunc_RemoveEntity, pet[id])
		
		pet[id] = 0
	}	
	g_bHasPetSpawned[id] = false
}

public CreatePet(id)
{
	if(g_bHasPetSpawned[id])
		return 1

	pet[id] = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
	set_pev(pet[id], pev_classname, PetClassName)
		
	engfunc(EngFunc_SetModel, pet[id], g_PlayerPetModel[id])
		
	new Float:flOrigin[3]
	pev(id, pev_origin, flOrigin)			
	
	set_pev(pet[id], pev_origin, flOrigin)
	set_pev(pet[id], pev_solid, SOLID_TRIGGER)
	set_pev(pet[id], pev_movetype, MOVETYPE_FLY)
	set_pev(pet[id], pev_owner, 33)
	set_pev(pet[id], pev_nextthink, 1.0)
	set_pev(pet[id], pev_sequence, 0)
	set_pev(pet[id], pev_gaitsequence, 0)
	set_pev(pet[id], pev_framerate, 1.0)

	g_bHasPetSpawned[id] = true

	return 1
}

public FM_Think_hook(ent)
{
	for(new i = 0; i <= get_maxplayers(); i++)
	{
		if(ent == pet[i])
		{
			static Float:flOrigin[3]
			static Float:flOrigin2[3]
			static Float:flVel[3]

			pev(ent, pev_origin, flOrigin2)
			get_offset_origin_body(i, Float:{50.0, 0.0 , 0.0}, flOrigin)
			
			if(get_distance_f(flOrigin, flOrigin2) > 300.0)
				set_pev(ent, pev_origin, flOrigin)
			
			else if(get_distance_f(flOrigin, flOrigin2) > 80.0)
			{
				get_speed_vector(flOrigin2, flOrigin, 250.0, flVel)
				set_pev(ent ,pev_velocity, flVel)
				if(pev(ent, pev_sequence) != 13 || pev(ent, pev_framerate) != 13.0)
				{
					set_pev(ent, pev_sequence, 13)
					set_pev(ent, pev_gaitsequence, 13)
					set_pev(ent, pev_framerate, 13.0)
				}
			}
			
			else if(get_distance_f(flOrigin, flOrigin2) < 75.0)
			{
				if(pev(ent, pev_sequence) != 13 || pev(ent, pev_framerate) != 0.5)
				{
					set_pev(ent, pev_sequence, 13)
					set_pev(ent, pev_gaitsequence, 13)
					set_pev(ent, pev_framerate, 0.5)
				}
				set_pev(ent, pev_velocity, Float:{0.0, 0.0, 0.0})
			}
			pev(i, pev_origin, flOrigin)
			flOrigin[2] = flOrigin2[2]
			entity_set_aim(ent, flOrigin)			
			set_pev(ent, pev_nextthink, 1.0)
			break
		}
	}
}

///////////////////////////////////////////////////////////////////////////////////////////////////////
public SpawnPlayer(id)
{
	if(!pev_valid(id))
		return

	ExecuteHamB(Ham_CS_RoundRespawn, id)
}

public SpawnBox(id)
{
	if(is_user_bot(id))
	{
		new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))

		new Origin[3]
		get_user_origin(id, Origin, 0)
		set_pev(ent, pev_classname, BonusDropClassName)

		engfunc(EngFunc_SetModel, ent, BonusDropsModels[random_num(0, chx(BonusDropsModels))])

		set_pev(ent, pev_mins, Float: {-10.0, -10.0, 0.0})
		set_pev(ent, pev_maxs, Float: {10.0, 10.0, 25.0})
		set_pev(ent, pev_size, Float: {-10.0, -10.0, 0.0, 10.0, 10.0, 25.0})
		
		set_pev(ent, pev_solid, SOLID_BBOX)
		set_pev(ent, pev_movetype, MOVETYPE_TOSS)

		set_pev(ent, pev_renderfx, kRenderFxGlowShell)
		set_pev(ent, pev_rendercolor, {255.0, 255.0, 255.0})
		set_pev(ent, pev_rendermode, kRenderFxHologram)
		set_pev(ent, pev_renderamt, 255.0)

		new Float: flOrigin[3]
		IVecFVec(Origin, flOrigin)
		set_pev(ent, pev_origin, flOrigin)
	}
}

public SpawnGrave(id)
{
	if(!is_user_bot(id))
	{
		new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))

		new Origin[3]
		get_user_origin(id, Origin, 0)
		set_pev(ent, pev_classname, GraveClassName)
	
		engfunc(EngFunc_SetModel, ent, GraveModels[random_num(0, chx(GraveModels))])
	
		set_pev(ent, pev_mins, Float: {-10.0, -10.0, 0.0})
		set_pev(ent, pev_maxs, Float: {10.0, 10.0, 25.0})
		set_pev(ent, pev_size, Float: {-10.0, -10.0, 0.0, 10.0, 10.0, 25.0})
		
		set_pev(ent, pev_solid, SOLID_BBOX)
		set_pev(ent, pev_movetype, MOVETYPE_TOSS)
		set_pev(ent, pev_owner, id)

		new Float: flOrigin[3]
		IVecFVec(Origin, flOrigin)
		set_pev(ent, pev_origin, flOrigin)
	}
}

public Touch(toucher, touched)
{
	if(!is_user_alive(toucher) || !pev_valid(touched) || is_user_bot(toucher))
		return FMRES_IGNORED

	new classname[32]
	pev(touched, pev_classname, classname, chx(classname))

	if(equal(classname, BonusDropClassName))
	{
		set_pev(touched, pev_effects, EF_NODRAW)
		set_pev(touched, pev_solid, SOLID_NOT)
		give_bonus(toucher)
	}
	else if(equal(classname, GraveClassName))
	{
		if(g_plData[toucher][EVOLUTION] == 4)
		{
			set_pev(touched, pev_solid, SOLID_NOT)
			client_print_color(toucher, print_team_default, "%s Ai atins numarul maxim de evolutii ! Nu mai poti colecta cruci !", TAG)
			return FMRES_IGNORED
		}
		set_pev(touched, pev_effects, EF_NODRAW)
		set_pev(touched, pev_solid, SOLID_NOT)
		emitsound(0, CHAN_AUTO, GraveSounds[0])
		grave_bonus(toucher, pev(touched, pev_owner))
	}
	else return FMRES_IGNORED
	

	if(!remove_entity(touched))
		return FMRES_IGNORED

	return FMRES_IGNORED
}

public give_bonus(id)
{
	new random = random_num(0, 1000)
	g_plData[id][POINTS] += random
	client_print_color(id, print_team_default, "%s Ai primit %d puncte bonus !", TAG, random)
	ManageData(id, Save)
}

public grave_bonus(id, owner)
{
	client_print_color(id, print_team_default, "%s Ai atins crucea lui ^4%n^1!", TAG, owner)

	g_plData[id][GRAVES] += 1

	if(g_plData[id][GRAVES] >= 250)
	{
		if(g_plData[id][EVOLUTION] > 5)
			g_plData[id][EVOLUTION] = 5

		g_plData[id][EVOLUTION] += 1
		g_plData[id][GRAVES] = 0
		client_print_color(id, print_team_default, "%s Pentru ca ai atins 250 de cruci ai evoluat !", TAG)
	}

	ManageData(id, Save)
}

public client_kill(id)
{
	for(new null; null < 3; null++)
		console_print(id, "")

	console_print(id, "**************** [Anti Suicid] ****************")
	console_print(id, ">>> De ce vrei tu sa mori asa repede? <<<")
	if(g_plData[id][POINTS] - 500 > 0)
	{
		console_print(id, ">>> Pentru ca ai tendinte sinucigase ti-am luat 500 de puncte ! <<<")
	}
	console_print(id, ">>> Data viitoare gandeste-te de 2 ori inainte sa faci asa ceva <<<")
	console_print(id, "**************** [Anti Suicid] ****************")

	for(new null; null < 3; null++)
		console_print(id,  "")

	if(g_plData[id][POINTS] - 500 > 0)
		g_plData[id][POINTS] -= 500
}

public ev_maketracer(id)
{
	if(g_bCanGameStart && (g_plCosmetics[id][TRACERS] == 1))
	{
		new pos1[3], pos2[3]

		get_user_origin(id, pos1, 1)
		get_user_origin(id, pos2, 4)
	
		message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
		write_byte(0)
		write_coord(pos1[0])
		write_coord(pos1[1])
		write_coord(pos1[2])
		write_coord(pos2[0])
		write_coord(pos2[1])
		write_coord(pos2[2])
		write_short(g_TraceBeams)
		write_byte(1)
		write_byte(5) 
		write_byte(2)
		write_byte(1) // latime laser
		write_byte(0)
		write_byte(color[id][0])
		write_byte(color[id][1])
		write_byte(color[id][2])
		write_byte(200)
		write_byte(150)
		message_end()
	}
}

public ev_curweapon(id)
{
	if(!(BLOCKED_WEAPONS & (1 << read_data(2))))
	{
		set_pdata_int(get_pdata_cbase(id, 373), 51, g_maxammo[read_data(2)], 4)
	}

	switch(get_pcvar_num(cvar_max_speed))
	{
		case 0: return
		case 1..100:
		{
			new a
			static Float: b = 20.0

			a = 250
			if(g_plPet[id] == 1 || g_plPet[id] == 5)
				a = 400

			new Float: speed = (a + g_plUpgrades[id][SPEED] * b)

			set_user_maxspeed(id, speed)
		}	
	}

	switch(get_pcvar_num(cvar_max_gravity))
	{
		case 0: return
		case 1..100:
		{
			static Float: a = 50.0
			new Float: gravity = ((800.0 - g_plUpgrades[id][GRAVITY] * a) / 800)

			set_user_gravity(id, gravity)
		}
	}
}
public ev_damage(iVictim)
{
	if(read_data(4) || read_data(5) || read_data(6))
	{
		new id = get_user_attacker(iVictim)

		if((1 <= id <= get_maxplayers()) && is_user_connected(id))
        {
			if(is_user_connected(id))
			{
				g_plData[id][POINTS] += floatround((read_data(2) * 0.01), floatround_round)
				
				new iPos = ++g_iPlayerPos[id]

				if(iPos == sizeof(g_flCoords))
					iPos = g_iPlayerPos[id] = 0

				set_dhudmessage(random_num(0, 224), random_num(0, 224), random_num(0, 224), Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1])
				show_dhudmessage(id, "%d", read_data(2))
			}
		}
	}
}


///////////////////////////////////////////////////////////////////////////////////////////////////////
public ShowHUD(id)
{
	id -= HUD_TASKID

	if(is_user_alive(id) && g_bCanGameStart)
	{
		new Float: flSpeed, Float: flVelocity[3]
		pev(id, pev_velocity, flVelocity)
		flSpeed = vector_length(flVelocity)

		new data[15]
		if(flSpeed > 0.0)
			formatex(data, chx(data), "%3.0f", flSpeed)
		else if(!flSpeed)
			formatex(data, chx(data), "Resting...", flSpeed)
		set_hudmessage(random(255), random(255), random(255), -1.0, -0.10)
		ShowSyncHudMsg(id, sync, "[%s]^n[%s]^n[Puncte %d] | [Cruci %d]^n[Viata %d] | [Armura  %d]^n[Omoruri %d] | [Nivel %d]", Evolutions[g_plData[id][EVOLUTION]][evo_name], data, g_plData[id][POINTS], g_plData[id][GRAVES], get_user_health(id), get_user_armor(id), g_plData[id][KILLS], g_plData[id][LEVEL])
	}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
public to_open_menu(id)
{
	if(!is_user_alive(id))
		return 0

	open_menu(id)

	return 1
}

public open_menu(id)
{
	if(!is_user_alive(id))
		return 1

	new menu = menu_create("\r[Zombie Mod] \wPlayer Menu", "main_menu_handle")

	menu_additem(menu, "Arme")
	menu_additem(menu, "Reseteaza Scorul")
	menu_additem(menu, "Meniu Upgrade-uri")
	menu_additem(menu, "Afiseaza Adminii Online")
	menu_additem(menu, "Cosmetice")

	DisplayMenu(menu, id)

	return 1
}

public open_upgrades_menu(id)
{
	new menu = menu_create(fmt("\r[Zombie Mod] \wMeniu Upgrade-uri^nPunctele Tale: \r%d", g_plData[id][POINTS]), "upg_menu_handle")

	if(g_plUpgrades[id][NORECOIL] < 1)
		menu_additem(menu, fmt("Cumpara \yNoRecoil \r[%d Puncte]", get_pcvar_num(cvar_norecoil_price)), "0", 0)
	else if(g_plUpgrades[id][NORECOIL] == 1)
		menu_additem(menu, "Cumpara \yNoRecoil \r(Cumparat)", "0", 0)

	if(g_plUpgrades[id][JUMPS] < 1)
		menu_additem(menu, fmt("Cumpara \yDouble Jump \r[%d Puncte]", get_pcvar_num(cvar_jumps_price)), "1", 1)
	else if(g_plUpgrades[id][JUMPS] == 1)
		menu_additem(menu, "Cumpara \yDouble Jump \r(Cumparat)", "1", 1)

	////////////////////////////////////////////////////////////////////
	if(g_plUpgrades[id][HP_AP] < get_pcvar_num(cvar_max_hpap))
		menu_additem(menu, fmt("Cumpara \yHP/AP \r[%d Puncte](%d/%d)", get_pcvar_num(cvar_hpap_price), g_plUpgrades[id][HP_AP], get_pcvar_num(cvar_max_hpap)), "2", 0)
	else if(g_plUpgrades[id][HP_AP] == get_pcvar_num(cvar_max_hpap))
		menu_additem(menu, "Cumpara \yHP/AP \r(Maxim)", "2", 0)
	////////////////////////////////////////////////////////////////////
	if(g_plUpgrades[id][SPEED] < get_pcvar_num(cvar_max_speed))
		menu_additem(menu, fmt("Mai mult speed \r[%d Puncte](%d/%d)", get_pcvar_num(cvar_speed_price), g_plUpgrades[id][SPEED], get_pcvar_num(cvar_max_speed)), "3", 0)
	else if(g_plUpgrades[id][SPEED] == get_pcvar_num(cvar_max_speed))
		menu_additem(menu, "Mai mult speed \r(Maxim)", "3", 0)

	////////////////////////////////////////////////////////////////////
	if(g_plUpgrades[id][GRAVITY] < get_pcvar_num(cvar_max_gravity))
		menu_additem(menu, fmt("Mai putina gravitatie \r[%d Puncte](%d/%d)", get_pcvar_num(cvar_gravity_price), g_plUpgrades[id][GRAVITY], get_pcvar_num(cvar_max_gravity)), "4", 0)
	else if(g_plUpgrades[id][GRAVITY] == get_pcvar_num(cvar_max_gravity))
		menu_additem(menu, "Mai putina gravitatie \r(Maxim)", "4", 0)

	////////////////////////////////////////////////////////////////////
	if(g_plUpgrades[id][DAMAGE] < get_pcvar_num(cvar_max_damage))
		menu_additem(menu, fmt("Mareste Damage \r[%d Puncte](%d/%d)", get_pcvar_num(cvar_damage_price), g_plUpgrades[id][DAMAGE], get_pcvar_num(cvar_max_damage)), "5", 0)
	else if(g_plUpgrades[id][DAMAGE] == get_pcvar_num(cvar_max_damage))
		menu_additem(menu, "Mareste Damage \r(Maxim)", "5", 0)

	////////////////////////////////////////////////////////////////////

	DisplayMenu(menu, id)
	return 1
}

public open_cosmetics_menu(id)
{	
	new menu = menu_create(fmt("\r[Zombie Mod] \wMeniu Cosmetice^nPunctele Tale: \r%d", g_plData[id][POINTS]), "csm_menu_handle")

	menu_additem(menu, fmt("Chat Tag \r[%d Puncte]^n\wChat Tag: \y%s", get_pcvar_num(cvar_chattag_price), g_PlayerTag[id]), "0", 0)

	if(g_plCosmetics[id][GLOW] < 1)
		menu_additem(menu, fmt("Deblocheaza Player GLOW \r[%d Puncte]", get_pcvar_num(cvar_glow_price)), "1", 0)
	else if(g_plCosmetics[id][GLOW] == 1)
		menu_additem(menu, "Setari Glow", "1", 0)

	if(g_plCosmetics[id][TRACERS] < 1)
		menu_additem(menu, fmt("Deblocheaza Weapon Laser \r[%d Puncte]", get_pcvar_num(cvar_wplaser_price)), "2", 0)
	else if(g_plCosmetics[id][TRACERS] == 1)
		menu_additem(menu, "Culori Weapon Laser", "2", 0)

	if(g_plCosmetics[id][PET] < 1)
		menu_additem(menu, fmt("Deblocheaza Pet \r[%d Puncte]", get_pcvar_num(cvar_pet_price)), "3", 0)
	else if(g_plCosmetics[id][PET] == 1)
		menu_additem(menu, "Setari Pet", "3", 0)

	if(g_plCosmetics[id][KILL_EFFECTS] < 1)
		menu_additem(menu, fmt("Deblocheaza Kill Effect \r[%d Puncte]", get_pcvar_num(cvar_killeffects_price)), "4", 0)
	else if(g_plCosmetics[id][KILL_EFFECTS] == 1)
		menu_additem(menu, "Setari Kill Effect", "4", 0)

	DisplayMenu(menu, id)
	return 1
}

public open_glow_settings(id)
{
	new menu = menu_create("\r[Zombie Mod] \wSetari Glow", "glow_menu_handle")

	menu_additem(menu, "Scoate Glow", "0", 0)
	menu_additem(menu, "Glow Rosu", "1", 0)
	menu_additem(menu, "Glow Galben", "2", 0)
	menu_additem(menu, "Glow Alb", "3", 0)
	menu_additem(menu, "Glow Albastru", "4", 0)
	menu_additem(menu, "Glow Magenta", "5", 0)
	menu_additem(menu, "Glow Roz", "6", 0)
	menu_additem(menu, "Glow Random", "7", 0)

	DisplayMenu(menu, id)
	return 1
}

public open_camera(id)
{
	new menu = menu_create("\r[Zombie Mod] \wCamera", "cam_menu_handle")

	menu_additem(menu, "Vedere 3D")
	menu_additem(menu, "Vedere Normala")

	DisplayMenu(menu, id)
	return 1
}

public GiveWeapons(id)
{
	new menu = menu_create("\r[Zombie Mod] \wWeapons Menu", "wpn_menu_handle")

	for(new i; i < sizeof WeaponData; i++)
		menu_additem(menu, fmt("%s \r[LEVEL %d]", WeaponData[i][weaponname], WeaponData[i][weapon_level]), fmt("%d", i + 1), 0)

	DisplayMenu(menu, id)
	return 1
}

public open_wp_laser_settings(id)
{
	new menu = menu_create("\r[Zombie Mod] \wSetari Weapon Laser", "wp_laser_menu_handle")

	menu_additem(menu, "Laser Rosu")
	menu_additem(menu, "Laser Galben")
	menu_additem(menu, "Laser Alb")
	menu_additem(menu, "Laser Random")

	DisplayMenu(menu, id)
	return 1
}

public open_pet_settings(id)
{
	new menu = menu_create("\r[Zombie Mod] \wSetari Pet", "pet_menu_handle")

	menu_additem(menu, "Ascunde Pet")
	menu_additem(menu, "Rodrigo \r(+150 SPEED)")
	menu_additem(menu, "Floater \r(Super Jump \w(SPACE + E)\r)")
	menu_additem(menu, "Liliac")
	menu_additem(menu, "Harambe \r(1.5x Damage)")
	menu_additem(menu, "Joker Box \r(2x Damage | 150 SPEED | +1 JUMP)[Evolution Phase I]")

	DisplayMenu(menu, id)
	return 1
}

public open_kill_effects_settings(id)
{
	new menu = menu_create("\r[Zombie Mod] \wSetari Kill Effects", "kill_effects_menu_handle")

	menu_additem(menu, "Scoate Efect")
	menu_additem(menu, "Thunder Effect")
	menu_additem(menu, "Explode Effect")
	menu_additem(menu, "Implosion Effect")

	DisplayMenu(menu, id)
	return 1
}

///////////////////////////////////////////////////////////////////////////////////////////////////////
public main_menu_handle(id, MainMenu, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(MainMenu)
		return 1
	}

	switch(item)
	{
		case 0: 
		{
			GiveWeapons(id)
		}
		case 1:
		{
			for(new i; i < 2; i++)
			{
				set_user_frags(id, 0)
				cs_set_user_deaths(id, 0)
			}
			client_print_color(0, print_team_default, "%s %n reseted their score!", TAG, id)
		}
		case 2:
		{
			if(is_user_connected(id))
				open_upgrades_menu(id)
		}
		case 3:
		{
			new szData[999], len, szRankName[100], szFlags[100]
			new iPlayers[MAX_PLAYERS], iNum, alt_id

			get_players(iPlayers, iNum, "c")

			new fsize = file_size(g_ShowAdminsFile, 1)

			for(new null; null < 5; null++)
				console_print(id, "")

			client_cmd(id, "toggleconsole")
			console_print(id, "[<----======= [Zombie Mod Staff] =======---->")

			for(new line; line <= fsize - 1; line++)
			{
				read_file(g_ShowAdminsFile, line, szData, chx(szData), len)
				parse(szData, szRankName, chx(szRankName), szFlags, chx(szFlags))

				console_print(id, "[%d] %s", line + 1, szRankName)

				for(new i; i < iNum; i++)
				{
					alt_id = iPlayers[i]
					if(get_user_flags(alt_id) == read_flags(szFlags))
						console_print(id, ">>> %s", g_name[alt_id])
				}
			}
			console_print(id, "[<----======= [Zombie Mod Staff] =======---->")

			for(new null; null < 1; null++)
				console_print(id, "")
			return 1
		}
		case 4:
			open_cosmetics_menu(id)
	}
	return 1
}

public upg_menu_handle(id, menu, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(menu)
		return 1
	}

	switch(item)
	{
		case 0:
		{
			if(g_plUpgrades[id][NORECOIL] == 1)
			{
				client_print_color(id, print_team_default, "%s Ai deja ^4NoRecoil^1!", TAG)
				return 1
			}
			if(g_plData[id][POINTS] - get_pcvar_num(cvar_norecoil_price) < 0)
			{
				client_print_color(id, print_team_default, "%s Nu ai suficiente puncte pentru a cumpara ^4NoRecoil^1! ", TAG)
				return 1
			}

			g_plData[id][POINTS] -= get_pcvar_num(cvar_norecoil_price)
			g_plUpgrades[id][NORECOIL] += 1
			client_print_color(0, print_team_default, "%s ^3%n^1 si-a cumparat ^4NoRecoil^1!", TAG, id)
			ManageData(id, Save)

		}

		case 1:
		{
			if(g_plUpgrades[id][JUMPS] == 1)
			{
				client_print_color(id, print_team_default, "%s Ai deja ^4Double Jump^1!", TAG)
				return 1
			}
			if(g_plData[id][POINTS] - get_pcvar_num(cvar_jumps_price) < 0)
			{
				client_print_color(id, print_team_default, "%s Nu ai suficiente puncte pentru a cumpara ^4Double Jump^1! ", TAG)
				return 1
			}

			g_plData[id][POINTS] -= get_pcvar_num(cvar_jumps_price)
			g_plUpgrades[id][JUMPS] += 1
			client_print_color(0, print_team_default, "%s ^3%n^1 si-a cumparat ^4Double Jump^1!", TAG, id)
			ManageData(id, Save)
		}
		case 2:
		{
			if(g_plUpgrades[id][HP_AP] == get_pcvar_num(cvar_max_hpap))
			{
				client_print_color(id, print_team_default, "%s Ti-ai maxat deja ^4viata si armura^1!", TAG)
				return 1
			}
			if(g_plData[id][POINTS] - get_pcvar_num(cvar_hpap_price) < 0)
			{
				client_print_color(id, print_team_default, "%s Nu ai suficiente puncte pentru a-ti upgrada ^4viata si armura^1! ", TAG)
				return 1
			}

			g_plData[id][POINTS] -= get_pcvar_num(cvar_hpap_price)
			g_plUpgrades[id][HP_AP] += 1
			client_print_color(0, print_team_default, "%s ^3%n^1 si-a upgradat ^4viata si armura^1!", TAG, id)
			ManageData(id, Save)
		}
		case 3:
		{
			if(g_plUpgrades[id][SPEED] == get_pcvar_num(cvar_max_speed))
			{
				client_print_color(id, print_team_default, "%s Ai maxat deja ^4Viteza^1!", TAG)
				return 1
			}
			if(g_plData[id][POINTS] - get_pcvar_num(cvar_speed_price) < 0)
			{
				client_print_color(id, print_team_default, "%s Nu ai suficiente puncte pentru a cumpara ^4mai multa viteza^1! ", TAG)
				return 1
			}

			g_plData[id][POINTS] -= get_pcvar_num(cvar_speed_price)
			g_plUpgrades[id][SPEED] += 1
			ev_curweapon(id)
			client_print_color(0, print_team_default, "%s ^3%n^1 si-a upgradat ^4viteza^1!", TAG, id)
			ManageData(id, Save)
		}
		case 4:
		{
			if(g_plUpgrades[id][GRAVITY] == get_pcvar_num(cvar_max_gravity))
			{
				client_print_color(id, print_team_default, "%s Ai maxat deja ^4Gravitatia^1!", TAG)
				return 1
			}
			if(g_plData[id][POINTS] - get_pcvar_num(cvar_gravity_price) < 0)
			{
				client_print_color(id, print_team_default, "%s Nu ai suficiente puncte pentru a cumpara ^4mai putina gravitatie^1! ", TAG)
				return 1
			}

			g_plData[id][POINTS] -= get_pcvar_num(cvar_gravity_price)
			g_plUpgrades[id][GRAVITY] += 1
			ev_curweapon(id)
			client_print_color(0, print_team_default, "%s ^3%n^1 si-a scazut ^4gravitatia^1!", TAG, id)
			ManageData(id, Save)
		}
		case 5:
		{
			if(g_plUpgrades[id][DAMAGE] == get_pcvar_num(cvar_max_damage))
			{
				client_print_color(id, print_team_default, "%s Ai maxat deja ^4Damage-ul^1!", TAG)
				return 1
			}
			if(g_plData[id][POINTS] - get_pcvar_num(cvar_damage_price) < 0)
			{
				client_print_color(id, print_team_default, "%s Nu ai suficiente puncte pentru a-ti upgrada ^4damage-ul^1! ", TAG)
				return 1
			}

			g_plData[id][POINTS] -= get_pcvar_num(cvar_damage_price)
			g_plUpgrades[id][DAMAGE] += 1
			client_print_color(0, print_team_default, "%s ^3%n^1 si-a upgradat ^4damage-ul^1!", TAG, id)
			ManageData(id, Save)
		}
	}
	return 1
}

public csm_menu_handle(id, menu, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(menu)
		return 1
	}

	switch(item)
	{
		case 0:
		{
			if(g_plData[id][POINTS] - get_pcvar_num(cvar_chattag_price) < 0)
			{
				client_print_color(id, print_team_default, "%s Nu ai suficiente puncte pentru a cumpara ^4Chat Tag^1! ", TAG)
				return 1
			}

			client_print_color(0, print_team_default, "%s ^3%n^1 si-a cumparat ^4Chat Tag^1!", TAG, id)
			client_print_color(id, print_team_default, "%s Tasteaza tag-ul dorit in chat! Ai 15 secunde!", TAG)

			g_bCanSetTagChat[id] = true
			set_task(15.0, "set_tagchat", id + CHAT_TAG_TASKID)
		}

		case 1:
		{
			if(g_plCosmetics[id][GLOW] == 1)
			{
				open_glow_settings(id)
				return 1
			}
			if(g_plData[id][POINTS] - get_pcvar_num(cvar_glow_price) < 0)
			{
				client_print_color(id, print_team_default, "%s Nu ai suficiente puncte pentru a cumpara ^4Player Glow^1! ", TAG)
				return 1
			}

			g_plData[id][POINTS] -= get_pcvar_num(cvar_glow_price)
			g_plCosmetics[id][GLOW] = 1
			client_print_color(0, print_team_default, "%s ^3%n^1 si-a cumparat ^4Player Glow^1!", TAG, id)
			ManageData(id, Save)
		}

		case 2:
		{
			if(g_plCosmetics[id][TRACERS] == 1)
			{
				open_wp_laser_settings(id)
				return 1
			}

			if(g_plData[id][POINTS] - get_pcvar_num(cvar_wplaser_price) < 0)
			{
				client_print_color(id, print_team_default, "%s Nu ai suficiente puncte pentru a cumpara ^4Weapon Laser^1! ", TAG)
				return 1
			}

			g_plData[id][POINTS] -= get_pcvar_num(cvar_wplaser_price)
			g_plCosmetics[id][TRACERS] = 1
			color[id][0] = 255
			color[id][1] = 255
			color[id][2] = 0
			client_print_color(0, print_team_default, "%s ^3%n^1 si-a cumparat ^4Weapon Laser^1!", TAG, id)	
			ManageData(id, Save)
		}

		case 3:
		{
			if(g_plCosmetics[id][PET] == 1)
			{
				open_pet_settings(id)
				return 1
			}

			if(g_plData[id][POINTS] - get_pcvar_num(cvar_pet_price) < 0)
			{
				client_print_color(id, print_team_default, "%s Nu ai suficiente puncte pentru a cumpara ^4Pet^1! ", TAG)
				return 1
			}

			g_plData[id][POINTS] -= get_pcvar_num(cvar_pet_price)
			g_plCosmetics[id][PET] = 1
			client_print_color(0, print_team_default, "%s ^3%n^1 si-a cumparat ^4Pet^1!", TAG, id)
			ManageData(id, Save)
		}

		case 4:
		{
			if(g_plCosmetics[id][KILL_EFFECTS] == 1)
			{
				open_kill_effects_settings(id)
				return 1
			}

			if(g_plData[id][POINTS] - get_pcvar_num(cvar_killeffects_price) < 0)
			{
				client_print_color(id, print_team_default, "%s Nu ai suficiente puncte pentru a cumpara ^4Kill Effects^1! ", TAG)
				return 1
			}

			g_plData[id][POINTS] -= get_pcvar_num(cvar_killeffects_price)
			g_plCosmetics[id][KILL_EFFECTS] = 1
			client_print_color(0, print_team_default, "%s ^3%n^1 si-a cumparat ^4Kill Effects^1!", TAG, id)
			ManageData(id, Save)
		}
	}
	return 1
}

public glow_menu_handle(id, menu, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(menu)
		return 1
	}

	switch(item)
	{
		case 0:
		{
			g_bRandomGlowSet[id] = false
			set_user_rendering(id)
			open_glow_settings(id)
		}

		case 1:
		{
			g_bRandomGlowSet[id] = false
			set_user_rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 5)
			open_glow_settings(id)
		}
		case 2:
		{
			g_bRandomGlowSet[id] = false
			set_user_rendering(id, kRenderFxGlowShell, 255, 255, 0, kRenderNormal, 5) 
			open_glow_settings(id)
		}
		case 3:
		{
			g_bRandomGlowSet[id] = false
			set_user_rendering(id, kRenderFxGlowShell, 255, 255, 255, kRenderNormal, 5) 
			open_glow_settings(id)
		}
		case 4:
		{
			g_bRandomGlowSet[id] = false
			set_user_rendering(id, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, 5)
			open_glow_settings(id) 
		}
		case 5:
		{
			g_bRandomGlowSet[id] = false
			set_user_rendering(id, kRenderFxGlowShell, 255, 0, 255, kRenderNormal, 5)
			open_glow_settings(id) 
		}
		case 6:
		{
			g_bRandomGlowSet[id] = false
			set_user_rendering(id, kRenderFxGlowShell, 240, 128, 128, kRenderNormal, 5)
			open_glow_settings(id) 
		}
		case 7:
		{
			g_bRandomGlowSet[id] = true
			set_task(0.1, "random_things", id + RANDOM_THINGS_TASKID, _, _, "b")
			open_glow_settings(id) 
		}
	}
	return 1
}
public cam_menu_handle(id, menu, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(menu)
		return 1
	}

	switch(item)
	{
		case 0: set_view(id, CAMERA_3RDPERSON)
		case 1: set_view(id, CAMERA_NONE)	
	}

	return 1
}

public wpn_menu_handle(id, menu, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(menu)
		return 1
	}
	static a = 0
	if(g_plData[id][LEVEL] < WeaponData[item][weapon_level])
	{
		if(a == 0)
		{
			a = 1
			client_print_color(id, print_team_default, "%s Nu ai nivelul necesar pentru aceasta arma !", TAG)
			GiveWeapons(id)
			return 1
		}	
		else 
		{
			a = 0
			return 1
		}
	}
	strip_user_weapons(id)
	give_item(id, "weapon_knife")

	give_item(id, WeaponData[item][weapon_data])
	ev_curweapon(id)
	

	return 1
}


public wp_laser_menu_handle(id, menu, item) // rosu galben alb random
{
	if(item == MENU_EXIT)
	{
		menu_destroy(menu)
		return 1
	}

	switch(item)
	{
		case 0:
		{
			g_bRandommenuSet[id] = false
			color[id][0] = 255
			color[id][1] = 0 
			color[id][2] = 0
		}
		case 1:
		{
			g_bRandommenuSet[id] = false
			color[id][0] = 255
			color[id][1] = 255
			color[id][2] = 0
		}
		case 2:
		{
			g_bRandommenuSet[id] = false
			color[id][0] = 255
			color[id][1] = 255 
			color[id][2] = 255
		}
		case 3:
		{
			g_bRandommenuSet[id] = true
			set_task(0.1, "random_things", id + RANDOM_THINGS_TASKID, _, _, "b")
		}
	}

	return 1
}

public pet_menu_handle(id, menu, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(menu)
		return 1
	}

	switch(item)
	{
		case 0:
		{
			if(!g_bHasPetSpawned[id])
			{
				client_print_color(id, print_team_default, "%s Nu ai niciun PET spawnat !", TAG)
				return 1
			}
			KillPet(id)
			arrayset(g_plPet[id], 0, sizeof(g_plPet))
			client_print_color(id, print_team_default, "%s Ti-ai ascuns PET-ul !", TAG)
		}
		case 1:
		{
			copy(g_PlayerPetModel[id], chx(g_PlayerPetModel), PetModels[0])
			KillPet(id)
			CreatePet(id)
			playsound(id, PetSounds[4])
			arrayset(g_plPet[id], 0, sizeof(g_plPet))
			g_plPet[id] = 1
			ev_curweapon(id)
			client_print_color(id, print_team_default, "%s L-ai spawnat pe ^3Rodrigo^1 !", TAG)
		}
		case 2:
		{
			copy(g_PlayerPetModel[id], chx(g_PlayerPetModel), PetModels[1])
			KillPet(id)
			CreatePet(id)
			playsound(id, PetSounds[3])
			arrayset(g_plPet[id], 0, sizeof(g_plPet))
			g_plPet[id] = 2
			ev_curweapon(id)
			client_print_color(id, print_team_default, "%s L-ai spawnat pe ^3Floater^1 !", TAG)
		}
		case 3:
		{
			copy(g_PlayerPetModel[id], chx(g_PlayerPetModel), PetModels[2])
			KillPet(id)
			CreatePet(id)
			playsound(id, PetSounds[2])
			arrayset(g_plPet[id], 0, sizeof(g_plPet))
			g_plPet[id] = 3
			ev_curweapon(id)
			client_print_color(id, print_team_default, "%s L-ai spawnat pe ^3Liliac^1 !", TAG)
		}
		case 4:
		{
			copy(g_PlayerPetModel[id], chx(g_PlayerPetModel), PetModels[3])
			KillPet(id)
			CreatePet(id)
			playsound(id, PetSounds[1])
			arrayset(g_plPet[id], 0, sizeof(g_plPet))
			g_plPet[id] = 4
			ev_curweapon(id)
			client_print_color(id, print_team_default, "%s L-ai spawnat pe ^3Harambe^1 !", TAG)
		}
		case 5:
		{
			if(g_plData[id][EVOLUTION] < 1)
			{
				client_print_color(id, print_team_default, "%s Pentru a il spawna pe ^3Joker^1 ai nevoie de ^3Evolution Phase I ^1!", TAG)
				return 1
			}
			copy(g_PlayerPetModel[id], chx(g_PlayerPetModel), PetModels[4])
			KillPet(id)
			CreatePet(id)
			playsound(id, PetSounds[0])
			arrayset(g_plPet[id], 0, sizeof(g_plPet))
			g_plPet[id] = 5
			ev_curweapon(id)
			client_print_color(id, print_team_default, "%s L-ai spawnat pe ^3Joker^1 !", TAG)
		}
	}
	return 1
}

public kill_effects_menu_handle(id, menu, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(menu)
		return 1
	}

	switch(item)
	{
		case 0: 
		{
			g_plKillEffect[id] = 0
			client_print_color(id, print_team_default, "%s Ti-ai scos Kill Effect-ul !", TAG)
		}
		case 1:
		{
			g_plKillEffect[id] = 1
			client_print_color(id, print_team_default, "%s Ti-ai setat Kill Effect-ul pe ^4Thunder^1 !", TAG)
		}
		case 2:
		{
			g_plKillEffect[id] = 2
			client_print_color(id, print_team_default, "%s Ti-ai setat Kill Effect-ul pe ^4Explode^1 !", TAG)
		}
		case 3:
		{
			g_plKillEffect[id] = 3
			client_print_color(id, print_team_default, "%s Ti-ai setat Kill Effect-ul pe ^4Implosion^1 !", TAG)
		}
	}
	return 1
}


DisplayMenu(const menu, const id)
{
	menu_setprop(menu, MPROP_NUMBER_COLOR, "\r")
	menu_setprop(menu, MPROP_BACKNAME, "\rInapoi")
	menu_setprop(menu, MPROP_NEXTNAME, "\rInainte")
	menu_setprop(menu, MPROP_EXITNAME, "\rIesire")

	menu_display(id, menu, 0)
}

///////////////////////////////////////////////////////////////////////////////////////////////////////
public set_tagchat(id)
{
	id -= CHAT_TAG_TASKID
	g_bCanSetTagChat[id] = false
}

public random_things(id)
{
	id -= RANDOM_THINGS_TASKID

	if(g_bRandomGlowSet[id])
	{
		new rgb[3]

		rgb[0] = random_num(50, 255)
		rgb[1] = random_num(50, 255)
		rgb[2] = random_num(50, 255)
		set_user_rendering(id, kRenderFxGlowShell, rgb[0], rgb[1], rgb[2], kRenderNormal, 5)
	}

	if(g_bRandommenuSet[id] && (g_plCosmetics[id][TRACERS] == 1))
	{
		color[id][0] = random(254)
		color[id][1] = random(254)
		color[id][2] = random(254)
	}
	
}

@goto_hamsupercede(ent, id) 
{
	if(is_user_alive(id) && !(get_pdata_cbase(ent, 39, 4) > 0))
		return HAM_SUPERCEDE

	return HAM_IGNORED
}

@goto_return_handled() return 1
///////////////////////////////////////////////////////////////////////////////////////////////////////
public hook_say(id)
{
	new szArgs[192]
	read_args(szArgs, chx(szArgs))
	remove_quotes(szArgs)

	if(!szArgs[0])
		return 1

	if(g_bCanSetTagChat[id] == true)
	{
		if(strlen(szArgs) > 10 || (contain(szArgs, " ") != -1) || !szArgs[0])
		{
			client_print_color(id, print_team_default, "%s Tag-ul poate avea maxim 10 caractere sau spatii libere !", TAG)
			g_bCanSetTagChat[id] = false
			return 1
		}
		else
		{
			new buff[15]
			formatex(buff, chx(buff), "%s", szArgs)

			client_print_color(id, print_team_default, "%s Tag-ul tau este ^x03%s ^x01!", TAG, szArgs)
			g_plData[id][POINTS] -= get_pcvar_num(cvar_chattag_price)
			g_bCanSetTagChat[id] = false
			g_plCosmetics[id][CHAT_TAG] += 1

			copy(g_PlayerTag[id], chx(g_PlayerTag), buff)
			ManageData(id, Save)

			return 1
		}
	}

	new szMessage[192]
	if(g_plCosmetics[id][CHAT_TAG] > 0)
		formatex(szMessage, chx(szMessage), "^4[%s][LEVEL :: %d] ^3%s ^1: %s", g_PlayerTag[id], g_plData[id][LEVEL], g_name[id], szArgs)
	else 
		formatex(szMessage, chx(szMessage), "^4[LEVEL :: %d] ^3%s ^1: %s", g_plData[id][LEVEL], g_name[id], szArgs)

	new iPlayers[MAX_PLAYERS], iNum, idx
	get_players(iPlayers, iNum)


	for(new i; i < iNum; i++)
	{
		idx = iPlayers[i]
		client_print_color(idx, print_team_default, szMessage)
	}

	return PLUGIN_HANDLED_MAIN
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
public fwd_weapon_primaryattack_pre(entity)
{
	new id = pev(entity, pev_owner)

	if(g_plUpgrades[id][NORECOIL] == 1)
	{
		pev(id, pev_punchangle, g_flPushAngle[id])
		return HAM_IGNORED
	}
	return HAM_IGNORED
}

public fwd_weapon_primaryattack_post(entity)
{
	new id = pev(entity, pev_owner)

	if(g_plUpgrades[id][NORECOIL] == 1)
	{
		new Float: flPush[3]
		pev(id, pev_punchangle, flPush)
		xs_vec_sub(flPush, g_flPushAngle[id], flPush)
		xs_vec_mul_scalar(flPush, 0.0, flPush)
		xs_vec_add(flPush, g_flPushAngle[id], flPush)
		set_pev(id, pev_punchangle, flPush)
		return HAM_IGNORED
	}
	return HAM_IGNORED
}

public fwd_takedamage(iVictim, iInflictor, iAttacker, Float: flDamage)
{	
	if(1 <= iAttacker <= get_maxplayers() && g_plUpgrades[iAttacker][DAMAGE] != 0)
	{
		if(g_plPet[iAttacker] == 4)
			SetHamParamFloat(4, flDamage * float(g_plUpgrades[iAttacker][DAMAGE]) * 3.5)
		else if(g_plPet[iAttacker] == 5)
			SetHamParamFloat(4, flDamage * float(g_plUpgrades[iAttacker][DAMAGE]) * 4.0)
		else
			SetHamParamFloat(4, flDamage * float(g_plUpgrades[iAttacker][DAMAGE]) * 2)	
	}
}

public client_PreThink(id)
{
	if(!is_user_alive(id))
		return 0

	new new_button = get_user_button(id)
	new old_button = get_user_oldbutton(id)

	if((new_button & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(old_button & IN_JUMP))
	{
		new jumps = 0
		if(g_plUpgrades[id][JUMPS] == 1 || g_plPet[id] == 5) jumps = 1
		if(g_plUpgrades[id][JUMPS] == 1 && g_plPet[id] == 5) jumps = 2

		if(iJumpNum[id] < jumps)
		{
			bDoJump[id] = true
			iJumpNum[id]++
			return 0
		}
	}

	if((new_button & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
	{
		iJumpNum[id] = 0
		return 0
	}
	

	if((new_button & IN_USE) && !(get_entity_flags(id) & FL_ONGROUND) && (g_plPet[id] == 2))
		thrust_player(id)

	return 0
}

public thrust_player(id)
{
	new Float: flVel[3], Float: flAng[3], Float: fFwd[3], iVel[3]
	entity_get_vector(id, EV_VEC_velocity, flVel)
	entity_get_vector(id, EV_VEC_angles, flAng)
	engfunc(EngFunc_MakeVectors, flAng)
	get_global_vector(GL_v_forward, fFwd)
	
	flVel[0] += fFwd[0] * 5
	flVel[1] += fFwd[1] * 5
	
	FVecIVec(flVel, iVel)
	new a = iVel[0] * iVel[0]
	new b = iVel[1] * iVel[1]
	
	if(sqroot(a + b) < 800)
		entity_set_vector(id, EV_VEC_velocity, flVel)

}

public client_PostThink(id)
{
	if(!is_user_alive(id))
		return 0

	if(g_plUpgrades[id][JUMPS] == 1 || g_plPet[id] == 5)
	{
		if(bDoJump[id] == true)
		{
			new Float: flVel[3]
			entity_get_vector(id, EV_VEC_velocity, flVel)
			flVel[2] = random_float(265.0, 285.0)
			entity_set_vector(id, EV_VEC_velocity, flVel)
			bDoJump[id] = false
			return 0
		}
	}
	
	return 0
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
public message_show_menu(msgid, dest, id) 
{
	if(!should_autojoin(id))
		return PLUGIN_CONTINUE

	static team_select[] = "#Team_Select"
	static menu_text_code[sizeof team_select]

	get_msg_arg_string(4, menu_text_code, chx(menu_text_code))

	if(!equal(menu_text_code, team_select))
		return PLUGIN_CONTINUE

	set_force_team_join_task(id, msgid)

	return 1
}

public message_vgui_menu(msgid, dest, id) 
{
	if(get_msg_arg_int(1) != 2 || !should_autojoin(id))
		return 0

	set_force_team_join_task(id, msgid)

	return 1
}

bool:should_autojoin(id)	return (!cs_get_user_team(id) && !task_exists(id) && !is_user_bot(id))

set_force_team_join_task(id, menu_msgid) 
{
	static param_menu_msgid[2]
	param_menu_msgid[0] = menu_msgid
	set_task(0.1, "task_force_team_join", id, param_menu_msgid, sizeof param_menu_msgid)
}

public task_force_team_join(menu_msgid[], id) 
{
	if(get_user_team(id))
		return

	force_team_join(id, menu_msgid[0], "2", "5")
}

stock force_team_join(id, menu_msgid, /* const */ team[] = "5", /* const */ class[] = "0") 
{
	static jointeam[] = "jointeam"
	if(class[0] == '0') 
	{
		engclient_cmd(id, jointeam, team)
		return
	}

	static msg_block, joinclass[] = "joinclass"
	msg_block = get_msg_block(menu_msgid)
	set_msg_block(menu_msgid, BLOCK_SET)
	engclient_cmd(id, jointeam, team)
	engclient_cmd(id, joinclass, class)
	set_msg_block(menu_msgid, msg_block)
}


///////////////////////////////////////////////////////////////////////////////////////////////////////
thunder(vec1[3], vec2[3])
{
	message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
	write_byte(0); 
	write_coord(vec1[0])
	write_coord(vec1[1])
	write_coord(vec1[2])
	write_coord(vec2[0])
	write_coord(vec2[1])
	write_coord(vec2[2]) 
	write_short(g_msgLightning)
	write_byte(1)
	write_byte(5)
	write_byte(2)
	write_byte(20)
	write_byte(30)
	write_byte(200) 
	write_byte(200)
	write_byte(200)
	write_byte(200)
	write_byte(200)
	message_end()

	message_begin(MSG_PVS, SVC_TEMPENTITY, vec2) 
	write_byte(TE_SPARKS)
	write_coord(vec2[0]) 
	write_coord(vec2[1]) 
	write_coord(vec2[2]) 
	message_end()
}

create_explode(vec1[3])
{
	message_begin(MSG_BROADCAST, SVC_TEMPENTITY, vec1)
	write_byte(TE_BEAMCYLINDER)
	write_coord(vec1[0]);
	write_coord(vec1[1]);
	write_coord(vec1[2] + 16)
	write_coord(vec1[0])
	write_coord(vec1[1]); 
	write_coord(vec1[2] + 1936) 
	write_short(g_msgExplode)
	write_byte(0)
	write_byte(0)
	write_byte(2) 
	write_byte(16)
	write_byte(0)
	write_byte(188)
	write_byte(220)
	write_byte(255) 
	write_byte(255) 
	write_byte(0)
	message_end()

	message_begin(MSG_BROADCAST, SVC_TEMPENTITY) 
	write_byte(TE_EXPLOSION2) 
	write_coord(vec1[0])
	write_coord(vec1[1]) 
	write_coord(vec1[2]) 
	write_byte(185) 
	write_byte(10) 
	message_end()
}

create_implosion(vec[3])
{
	message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
	write_byte(TE_IMPLOSION)
	write_coord(vec[0])
	write_coord(vec[1])
	write_coord(vec[2])
	write_byte(100)
	write_byte(50)
	write_byte(10)
	message_end()

	message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
	write_byte(TE_TELEPORT)
	write_coord(vec[0])
	write_coord(vec[1])
	write_coord(vec[2])
	message_end()

	message_begin(MSG_BROADCAST, SVC_TEMPENTITY) 
	write_byte(TE_DLIGHT)
	write_coord(vec[0])
	write_coord(vec[1])
	write_coord(vec[2])
	write_byte(10)
	write_byte(265)
	write_byte(165)
	write_byte(0)
	write_byte(10)
	write_byte(10)
	message_end()
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
stock Float: is_user_outside(id) // pentru mai tarziu
{
	new Float: vOrigin[3], Float: fDist

	pev(id, pev_origin, vOrigin)
	fDist = vOrigin[2]

	while(engfunc(EngFunc_PointContents, vOrigin) == CONTENTS_EMPTY)
        vOrigin[2] += 5.0
	if(engfunc(EngFunc_PointContents, vOrigin) == CONTENTS_SKY)
        return (vOrigin[2] - fDist)
	return 0.0
}


stock get_offset_origin_body(ent,const Float:offset[3],Float:origin[3])
{
	if(!pev_valid(ent))
		return 0;
	
	new Float:angle[3]
	pev(ent,pev_angles,angle)
	
	pev(ent,pev_origin,origin)
	
	origin[0] += floatcos(angle[1],degrees) * offset[0]
	origin[1] += floatsin(angle[1],degrees) * offset[0]
	
	origin[1] += floatcos(angle[1],degrees) * offset[1]
	origin[0] += floatsin(angle[1],degrees) * offset[1]
	
	return 1;
}

stock get_speed_vector(const Float:origin1[3],const Float:origin2[3],Float:speed, Float:new_velocity[3])
{
	new_velocity[0] = origin2[0] - origin1[0]
	new_velocity[1] = origin2[1] - origin1[1]
	new_velocity[2] = origin2[2] - origin1[2]
	new Float:num = floatsqroot(speed*speed / (new_velocity[0]*new_velocity[0] + new_velocity[1]*new_velocity[1] + new_velocity[2]*new_velocity[2]))
	new_velocity[0] *= num
	new_velocity[1] *= num
	new_velocity[2] *= num
	
	return 1
}

stock entity_set_aim(ent,const Float:origin2[3],bone=0)
{
	if(!pev_valid(ent))
		return 0
	
	static Float:origin[3]
	origin[0] = origin2[0]
	origin[1] = origin2[1]
	origin[2] = origin2[2]
	
	static Float:ent_origin[3], Float:angles[3]
	
	if(bone)
		engfunc(EngFunc_GetBonePosition, ent, bone, ent_origin, angles)
	else
		pev(ent, pev_origin, ent_origin)
	
	origin[0] -= ent_origin[0]
	origin[1] -= ent_origin[1]
	origin[2] -= ent_origin[2]
	
	static Float:v_length
	v_length = vector_length(origin)
	
	static Float:aim_vector[3]
	aim_vector[0] = origin[0] / v_length
	aim_vector[1] = origin[1] / v_length
	aim_vector[2] = origin[2] / v_length
	
	static Float:new_angles[3]
	vector_to_angle(aim_vector, new_angles)
	
	new_angles[0] *= -1
	
	if(new_angles[1] > 180.0) new_angles[1] -= 360
	if(new_angles[1] <- 180.0) new_angles[1] += 360
	if(new_angles[1] == 180.0 || new_angles[1] == -180.0) new_angles[1] =- 179.999999
	
	set_pev(ent, pev_angles, new_angles)
	set_pev(ent, pev_fixangle, 1)
	
	return 1
}


stock emitsound(id, channel, const sound[]) emit_sound(id, channel, sound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
stock playsound(id, const sound[])
{
	if(equal(sound[strlen(sound) -4 ], ".mp3")) client_cmd(id, "mp3 play ^"sound/%s^"", sound)
	else client_cmd(id, "spk ^"%s^"", sound)
}
stock stopsound(id) client_cmd(id, "mp3 stop; stopsound")
Link resurse: https://www46.zippyshare.com/v/PsatS2TJ/file.html
Last edited by N3v3rM1nd on 29 Jan 2023, 19:46, edited 2 times in total.
Sigilat.ro
User avatar
N3v3rM1nd
Membru, skill +2
Membru, skill +2
Posts: 794
Joined: 06 Oct 2018, 14:41
Detinator Steam: Da
SteamID: /id/kidd0x/
Fond eXtream: 0
Location: Constangeles
Discord: kidd0x#1886
Has thanked: 135 times
Been thanked: 73 times

24 Jan 2023, 22:41

-rezervat-
User avatar
CyBer[N]eTicK
Membru, skill +1
Membru, skill +1
Posts: 137
Joined: 29 May 2020, 05:35
Detinator Steam: Da
SteamID: CyBerNrcs
Fond eXtream: 0
Location: Iași
Discord: CyBer[N]eTicK#1206
Has thanked: 20 times
Been thanked: 17 times
Contact:

24 Jan 2023, 23:22

Drăguț kidd! Mulțumim.
Image
Filiq_
Utilizator neserios
Utilizator neserios
Posts: 814
Joined: 02 Nov 2014, 18:21
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Reputatie: Fost Scripter eXtreamCS
Utilizator neserios
Fond eXtream: 0
Location: Constanta
Has thanked: 30 times
Been thanked: 23 times

25 Jan 2023, 17:17

Code: Select all

/**
 * 0 : nefolosit
 * 1 : points
 * 2 : kills
 * 3 : level
 * 4 : Graves
 **/
new g_plData[MAX_PLAYERS + 1][5]

->

/**
 * 0 : nefolosit
 * 1 : points
 * 2 : kills
 * 3 : level
 * 4 : Graves
 **/
enum plData 
{
    none,
    points,
    kills,
    level,
    Graves
}
new g_plData[MAX_PLAYERS + 1][plData]

pentru accesat: g_plData[id][ce vrei]
g_plData[id][points] = x
print: g_plData[id][points]

Code: Select all

new bool: bDoJump[MAX_PLAYERS + 1] = false
->
new bool: bDoJump[MAX_PLAYERS + 1] = {false, ...}
daca nu ma insel, incearca, ca sa poti sa l setezi default false

Code: Select all

 
 client_print_color(0, print_team_default, "%s Pentru a incepe jocul este nevoie de minim 1 jucator !", TAG)
 
nu il v-a vedea nimeni

in plugin_precache poti pune new i; inloc sa il creezei la fiecare variabila, si inloc de new i poti pune i = 0 in for
https://discord.gg/VABVdhXMrK ZM CSO server in working..
User avatar
N3v3rM1nd
Membru, skill +2
Membru, skill +2
Posts: 794
Joined: 06 Oct 2018, 14:41
Detinator Steam: Da
SteamID: /id/kidd0x/
Fond eXtream: 0
Location: Constangeles
Discord: kidd0x#1886
Has thanked: 135 times
Been thanked: 73 times

25 Jan 2023, 20:13

Filiq_ wrote:
25 Jan 2023, 17:17

Code: Select all

/**
 * 0 : nefolosit
 * 1 : points
 * 2 : kills
 * 3 : level
 * 4 : Graves
 **/
new g_plData[MAX_PLAYERS + 1][5]

->

/**
 * 0 : nefolosit
 * 1 : points
 * 2 : kills
 * 3 : level
 * 4 : Graves
 **/
enum plData 
{
    none,
    points,
    kills,
    level,
    Graves
}
new g_plData[MAX_PLAYERS + 1][plData]

pentru accesat: g_plData[id][ce vrei]
g_plData[id][points] = x
print: g_plData[id][points]

Code: Select all

new bool: bDoJump[MAX_PLAYERS + 1] = false
->
new bool: bDoJump[MAX_PLAYERS + 1] = {false, ...}
daca nu ma insel, incearca, ca sa poti sa l setezi default false

Code: Select all

 
 client_print_color(0, print_team_default, "%s Pentru a incepe jocul este nevoie de minim 1 jucator !", TAG)
 
nu il v-a vedea nimeni

in plugin_precache poti pune new i; inloc sa il creezei la fiecare variabila, si inloc de new i poti pune i = 0 in for
In urmatorul update o sa mai "clarific" si curat anumite bucati de cod :), iar in legatura cu bool-ul, valoarea lui default este false in din cate stiu, deci nu cred ca are rost
User avatar
AboveAll :)
Membru, skill 0
Membru, skill 0
Posts: 97
Joined: 16 Dec 2014, 11:29
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: Uwc3x.Killers.Ro
SteamID: AboveAll14
Fond eXtream: 0
Location: Barlad
Contact:

26 Jan 2023, 19:20

Resursele dau eroare la descarcat pe Chrome, spune ca fisierul poate fi periculos. Am reusit sa il descarc de pe Browserul normal. Dar.. nu merge..nu stiu ce fac gresit , bag pluginul toate alea dar nu se intampla nimic..
Abcs.LaLeagane.Ro / 89.40.104.77:27015 - Uwc3x - Level Mod 50 Lvl !
User avatar
N3v3rM1nd
Membru, skill +2
Membru, skill +2
Posts: 794
Joined: 06 Oct 2018, 14:41
Detinator Steam: Da
SteamID: /id/kidd0x/
Fond eXtream: 0
Location: Constangeles
Discord: kidd0x#1886
Has thanked: 135 times
Been thanked: 73 times

26 Jan 2023, 23:30

AboveAll :) wrote:
26 Jan 2023, 19:20
Resursele dau eroare la descarcat pe Chrome, spune ca fisierul poate fi periculos. Am reusit sa il descarc de pe Browserul normal. Dar.. nu merge..nu stiu ce fac gresit , bag pluginul toate alea dar nu se intampla nimic..
Iti trebuie ReHLDS, o sa fac modific topciul la urmatorul update
Post Reply

Return to “Moduri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest