Cerere Plugin Furien XP + Shop

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
[RNG]EAGame
Membru, skill 0
Membru, skill 0
Posts: 30
Joined: 28 Sep 2013, 20:21
Detinator Steam: Nu
CS Status: RNG-Servers.Com
Detinator server CS: cs.rng-servers.com
Location: Cotnari - Iasi - Romania
Has thanked: 6 times
Contact:

22 Dec 2013, 16:25

Salut. Se poate sa gasesc gratis un plugin cu system de XP si sa aibe si shop? Adica de la shop sa pot cumpara XP ?
Rapidserver
User avatar
DaNNe.
Fost moderator
Fost moderator
Posts: 2808
Joined: 08 Nov 2013, 20:43
Detinator Steam: Da
CS Status: Activitate scăzută
SteamID: /id/FurienMaster
Reputatie: Nick anterior: DnD. Gold, Emrys
0.5/3
Fost moderator ajutator
Fost Membru Club eXtreamCS (doua luni)
Has thanked: 230 times
Been thanked: 128 times
Contact:

22 Dec 2013, 18:00

[RNG]EAGame wrote:Salut. Se poate sa gasesc gratis un plugin cu system de XP si sa aibe si shop? Adica de la shop sa pot cumpara XP ?
Posteaza sursa de la XP-ul tau si shopul si iti adaugam noi XP :D
Contact: Activitate scazuta.
User avatar
Jorj
eXtream Mod
eXtream Mod
Posts: 3500
Joined: 13 Aug 2013, 17:10
Detinator Steam: Da
Detinator server CS: Furien.LsZ.Ro
SteamID: clic_lsz
Reputatie: eXtream Mod
Fost Membru Club eXtreamCS (patru luni)
Nume anterior: Clic
Location: Piatra Neamt
Been thanked: 20 times
Contact:

22 Dec 2013, 18:07

Daca se poate sa-l faci public ca si eu am nevoie :D
Last edited by Jorj on 22 Dec 2013, 19:27, edited 1 time in total.
Intermediez tranzactii cand am chef si timp ! :)

Image
[RNG]EAGame
Membru, skill 0
Membru, skill 0
Posts: 30
Joined: 28 Sep 2013, 20:21
Detinator Steam: Nu
CS Status: RNG-Servers.Com
Detinator server CS: cs.rng-servers.com
Location: Cotnari - Iasi - Romania
Has thanked: 6 times
Contact:

22 Dec 2013, 18:47

@Clic , stiu si eu acel plugin. Dar nu imi place deloc si are si cateva buguri.

Asta este plugin-ul care il am eu, dar nu are shop.
.SMA | Afiseaza codul
[code]
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <csx>
#include <fakemeta>
#include <fun>
#include <hamsandwich>
#include <nvault>

#define TASK_REGEN	134926
#define ID_REGEN	(taskid - TASK_REGEN)
#define EFFECT_LENGTH 3

const KEYSMENU = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0
const FR_KEYSMENU = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0
const A_FR_KEYSMENU = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0

// Definitia la salvarea pe nvault
new salvare_date;

// Nivele si XP
new XP[33];

new hp_level_f[33], ap_level_f[33], speed_lvl_f[33], gravity_lvl_f[33], damage_lvl_f[33], regenerare_lvl_f[33];
	
new hp_level_a_f[33], ap_level_a_f[33], speed_lvl_a_f[33], gravity_lvl_a_f[33], damage_lvl_a_f[33], regenerare_lvl_a_f[33];
	
// Functiile puterilor (regenerare si respawn)
new maximhp[33];

public plugin_init()
{
	register_plugin("XP & POWERS", "1.1b", "cyby")
	
	register_concmd("amx_givexp", "givexp_cmd", ADMIN_KICK, "<nume> <xp>")
	
	// Comenzi ale jucatorilor
	register_clcmd("chooseteam", "show_game")
	register_clcmd("jointeam", "show_game")
	
	// Eventuri si procese ale jucatorilor
	// Moarte
	register_event("DeathMsg", "ucidere", "a")
	// Prethink(executa mereu)
	register_forward(FM_PlayerPreThink, "player_prethink")
	// Spawn Event
	RegisterHam(Ham_Spawn, "player", "spawn_player_post", 1)
	// Damage
	RegisterHam(Ham_TakeDamage, "player", "damage_player")
	// Regenerare (separat)
	RegisterHam(Ham_TakeDamage, "player", "take_damage")
	
	// Event castigare
	register_event("SendAudio", "Win_Furien", "a", "2=%!MRAD_terwin")
	register_event("SendAudio", "Win_Anti_Furien", "a", "2=%!MRAD_ctwin")
	
	// Preluare date NVAULT
	salvare_date = nvault_open("FURIEN_LVL");
	
	register_menu("Game Menu", KEYSMENU, "menu_game")
	register_menu("Furien Menu", FR_KEYSMENU, "menu_furien")
	register_menu("AntiF Menu", A_FR_KEYSMENU, "menu_afurien")
}

public client_putinserver(id)
{
	preluaredate(id)
}

public client_disconnect(id)
{
	salvaredate(id)
	XP[id] = 0
	hp_level_f[id] = 0
	ap_level_f[id] = 0
	speed_lvl_f[id] = 0
	gravity_lvl_f[id] = 0
	damage_lvl_f[id] = 0
	regenerare_lvl_f[id] = 0
	hp_level_a_f[id] = 0
	ap_level_a_f[id] = 0
	speed_lvl_a_f[id] = 0
	gravity_lvl_a_f[id] = 0
	damage_lvl_a_f[id] = 0
	regenerare_lvl_a_f[id] = 0
}

public salvaredate(id) 
{ 
	new nume[32] 
	get_user_name(id,nume,31) 
	new vaultnume[32],vaultdate[256] 

	format(vaultnume,31,"%s", nume) 
	format(vaultdate,255,"%i#%i#%i#%i#%i#%i#%i#%i#%i#%i#%i#%i#%i#", XP[id], hp_level_f[id], ap_level_f[id], speed_lvl_f[id], gravity_lvl_f[id], damage_lvl_f[id], regenerare_lvl_f[id], hp_level_a_f[id], ap_level_a_f[id], speed_lvl_a_f[id], gravity_lvl_a_f[id], damage_lvl_a_f[id], regenerare_lvl_a_f[id])

	nvault_set(salvare_date,vaultnume,vaultdate) 
	return PLUGIN_CONTINUE 
}

public preluaredate(id) 
{ 
	new nume[32] 
	get_user_name(id,nume,31) 
	new vaultnume[32],vaultdate[256] 

	format(vaultnume,31,"%s", nume) 
	format(vaultdate,255,"%i#%i#%i#%i#%i#%i#%i#%i#%i#%i#%i#%i#%i#", XP[id], hp_level_f[id], ap_level_f[id], speed_lvl_f[id], gravity_lvl_f[id], damage_lvl_f[id], regenerare_lvl_f[id], hp_level_a_f[id], ap_level_a_f[id], speed_lvl_a_f[id], gravity_lvl_a_f[id], damage_lvl_a_f[id], regenerare_lvl_a_f[id]) 

	nvault_get(salvare_date,vaultnume,vaultdate,255) 
	replace_all(vaultdate, 255, "#", " ") 
	new playerxp[32], hp_n_f[32], ap_n_f[32], speed_n_f[32], grav_n_f[32], dmg_n_f[32], regen_n_f[32], hp_n_a_f[32], ap_n_a_f[32], speed_n_a_f[32], grav_n_a_f[32], dmg_n_a_f[32], regen_n_a_f[32]
	parse(vaultdate, playerxp, 31, hp_n_f, 31, ap_n_f, 31, speed_n_f, 31, grav_n_f, 31, dmg_n_f, 31, regen_n_f, 31, hp_n_a_f, 31, ap_n_a_f, 31, speed_n_a_f, 31, grav_n_a_f, 31, dmg_n_a_f, 31, regen_n_a_f, 31) 
	XP[id] = str_to_num(playerxp) 
	hp_level_f[id] = str_to_num(hp_n_f)
	ap_level_f[id] = str_to_num(ap_n_f) 
	speed_lvl_f[id] = str_to_num(speed_n_f)
	gravity_lvl_f[id] = str_to_num(grav_n_f) 
	damage_lvl_f[id] = str_to_num(dmg_n_f)
	regenerare_lvl_f[id] = str_to_num(regen_n_f)
	hp_level_a_f[id] = str_to_num(hp_n_a_f)
	ap_level_a_f[id] = str_to_num(ap_n_a_f) 
	speed_lvl_a_f[id] = str_to_num(speed_n_a_f)
	gravity_lvl_a_f[id] = str_to_num(grav_n_a_f) 
	damage_lvl_a_f[id] = str_to_num(dmg_n_a_f)
	regenerare_lvl_a_f[id] = str_to_num(regen_n_a_f)
	return PLUGIN_CONTINUE 
}

public givexp_cmd(id,level,cid)
{
	if(!cmd_access(id, level, cid, 2))
	{
		return PLUGIN_HANDLED;
	}
	
	new arg[32], name[32];
	read_argv(1, arg, 31)
	get_user_name(id, name, 31)
	
	new jucator = cmd_target(id, arg, 31)
	
	if(!jucator)
	{
		return PLUGIN_HANDLED
	}
	
	if(!is_user_connected(jucator))
	{
		return PLUGIN_HANDLED
	}
	
	new cant[4], name2[32];
	
	get_user_name(jucator, name2, 31)
	read_argv(2, cant, 3)
	
	new XP_plus = str_to_num(cant)
	
	XP[jucator] += XP_plus
	mesaj_color(0, ".v[Furien].g Adminul.e %s.g a dat.e %d.g XP lui.e %s.g.", name, XP_plus, name2)
	return PLUGIN_HANDLED;
}
	
public ucidere()
{
	new atacator, victim;
	atacator = read_data(1)
	victim = read_data(2)
	
	if(!is_user_connected(atacator) || !is_user_connected(victim))
	{
		return 
	}
	
	if(atacator == victim)
	{
		return;
	}
	
	XP[atacator] += 10;
	set_hudmessage(200, 100, 50, -1.0, -1.0, 0, 6.0, 2.5)
	show_hudmessage(atacator, "+10 XP")
}

public bomb_planted(id)
{
	XP[id] +=15
	mesaj_color(id, ".v[Furien].g Ai primit.e 15 XP.g pentru plantarea bombei.")
}

public bomb_defused(id)
{
	XP[id] +=15
	mesaj_color(id, ".v[Furien].g Ai primit.e 15 XP.g pentru dezamorsarea bombei.")
}	

public player_prethink(id)
{
	if(!is_user_alive(id))
	{
		return PLUGIN_HANDLED;
	}

	if(cs_get_user_team(id) == CS_TEAM_T)
	{
		set_pev(id, pev_maxspeed, 500.0 + speed_lvl_f[id] * 25.0)
		
		if(gravity_lvl_f[id] == 1)
		{
			set_pev(id, pev_gravity, 400.0/800.0)
		}
		else if(gravity_lvl_f[id] == 2)
		{
			set_pev(id, pev_gravity, 375.0/800.0)
		}
		else if(gravity_lvl_f[id] == 3)
		{
			set_pev(id, pev_gravity, 350.0/800.0)
		}
		else if(gravity_lvl_f[id] == 4)
		{
			set_pev(id, pev_gravity, 325.0/800.0)
		}
		else if(gravity_lvl_f[id] == 5)
		{
			set_pev(id, pev_gravity, 300.0/800.0)
		}
		else if(gravity_lvl_f[id] == 6)
		{
			set_pev(id, pev_gravity, 275.0/800.0)
		}
		else if(gravity_lvl_f[id] == 7)
		{
			set_pev(id, pev_gravity, 250.0/800.0)
		}
	}
	if(cs_get_user_team(id) == CS_TEAM_CT)
	{
		set_pev(id, pev_maxspeed, 250.0 + speed_lvl_a_f[id] * 25.0)
		
		if(gravity_lvl_a_f[id] == 1)
		{
			set_pev(id, pev_gravity, 750.0/800.0)
		}
		else if(gravity_lvl_a_f[id] == 2)
		{
			set_pev(id, pev_gravity, 700.0/800.0)
		}
		else if(gravity_lvl_a_f[id] == 3)
		{
			set_pev(id, pev_gravity, 650.0/800.0)
		}
		else if(gravity_lvl_a_f[id] == 4)
		{
			set_pev(id, pev_gravity, 600.0/800.0)
		}
		else if(gravity_lvl_a_f[id] == 5)
		{
			set_pev(id, pev_gravity, 550.0/800.0)
		}
		else if(gravity_lvl_a_f[id] == 6)
		{
			set_pev(id, pev_gravity, 500.0/800.0)
		}
		else if(gravity_lvl_a_f[id] == 7)
		{
			set_pev(id, pev_gravity, 450.0/800.0)
		}
	}
	return PLUGIN_CONTINUE
}

public spawn_player_post(id)
{
	if(!is_user_alive(id))
	{
		return PLUGIN_HANDLED;
	}
	
	if(cs_get_user_team(id) == CS_TEAM_T)
	{
		set_user_health(id, 100 + hp_level_f[id] * 25)
		
		set_pev(id, pev_armorvalue, ap_level_f[id] * 25.0)
	}
	
	if(cs_get_user_team(id) == CS_TEAM_CT)
	{
		set_user_health(id, 100 + hp_level_a_f[id] * 25)
		
		set_pev(id, pev_armorvalue, ap_level_a_f[id] * 25.0)
	}
	maximhp[id] = get_user_health(id)
	return PLUGIN_CONTINUE
}

public damage_player(victim, inflictor, attacker, Float:damage, damage_type)
{
	if(cs_get_user_team(attacker) == CS_TEAM_CT)
	{
		damage += damage_lvl_a_f[attacker] * 10
	}
	
	if(cs_get_user_team(attacker) == CS_TEAM_T)
	{
		if(get_user_weapon(attacker) == CSW_KNIFE)
		{
			damage += damage_lvl_a_f[attacker] * 10
		}
	}
	SetHamParamFloat(4, damage);
}

public take_damage(victim, inflictor, attacker, Float:damage, damage_type)
{
	if(cs_get_user_team(victim) == CS_TEAM_CT)
	{
		set_task(1.0, "regen_hp_a_f", victim+TASK_REGEN)
	}
	
	if(cs_get_user_team(victim) == CS_TEAM_T)
	{
		if(get_user_weapon(victim) == CSW_KNIFE)
		{
			remove_task(victim+TASK_REGEN)
			set_task(1.0, "regen_hp_f", victim+TASK_REGEN)
		}
	}
}

public Win_Furien()
{
	new players[32], num, player;
	get_players(players, num, "", "TERRORIST")

	for(new i = 0; i < num; i++)
	{   
		player = players

		if(!is_user_alive(player))
		{
			return PLUGIN_HANDLED
		}
		XP[player] += 10
		msg_screen_fade(player, EFFECT_LENGTH, 175, 0, 0, 115);
		mesaj_color(player, ".v[Furien].g Ai castigat bonus.e 10 XP.g pentru castigarea rundei.")
	}

	return PLUGIN_CONTINUE
}

public Win_Anti_Furien()
{
	new players[32], num, player;
	get_players(players, num, "", "CT")

	for(new i = 0; i < num; i++)
	{   
		player = players

		if(!is_user_alive(player))
		{
			return PLUGIN_HANDLED
		}
		XP[player] += 10
		msg_screen_fade(player, EFFECT_LENGTH, 175, 0, 0, 115);
		mesaj_color(player, ".v[Furien].g Ai castigat bonus.e 10 XP.g pentru castigarea rundei.")
	}

	return PLUGIN_CONTINUE
}

public regen_hp_a_f(taskid)
{
	if(is_user_connected(ID_REGEN) && is_user_alive(ID_REGEN))
	{
		if(maximhp[ID_REGEN] != -1)
		{
			new curenthp; 
			curenthp = get_user_health(ID_REGEN)
			
			if(curenthp < maximhp[ID_REGEN])
			{
				if(curenthp > maximhp[ID_REGEN])
				{
					set_user_health(ID_REGEN, maximhp[ID_REGEN])
				}
				set_user_health(ID_REGEN, get_user_health(ID_REGEN) + regenerare_lvl_a_f[ID_REGEN] * 5)
				set_task(5.0, "regen_hp_a_f", ID_REGEN+TASK_REGEN)
			}
		}
	}
}

public regen_hp_f(taskid)
{
	if(is_user_connected(ID_REGEN) && is_user_alive(ID_REGEN))
	{
		if(maximhp[ID_REGEN] != -1)
		{
			new curenthp = get_user_health(ID_REGEN)
			if(curenthp < maximhp[ID_REGEN])
			{
				if(curenthp > maximhp[ID_REGEN])
				{
					set_user_health(ID_REGEN, maximhp[ID_REGEN])
				}
				set_user_health(ID_REGEN, get_user_health(ID_REGEN) + regenerare_lvl_f[ID_REGEN] * 5)
				set_task(5.0, "regen_hp_f", ID_REGEN+TASK_REGEN)
			}
		}
	}
}

public show_game(id)
{
	if(is_user_alive(id))
	{
		show_menu_game(id)
		return PLUGIN_HANDLED
	}
	return PLUGIN_CONTINUE
}

show_menu_game(id)
{
	static menu[250], len
	len = 0
	
	len += formatex(menu[len], charsmax(menu) - len, "\yFurien\r [XP:%d]^n^n", XP[id])
	len += formatex(menu[len], charsmax(menu) - len, "\y1.\w Furien XP Buying^n")
	len += formatex(menu[len], charsmax(menu) - len, "\y2.\w Anti-Furien XP Buying^n")
	show_menu(id, KEYSMENU, menu, -1, "Game Menu")
}

public menu_game(id, key)
{
	switch (key)
	{
		case 0:
		{
			furiens_ability(id)
		}
		case 1:
		{
			anti_furiens_ability(id)
		}
	}
}

furiens_ability(id)
{
	if(is_user_alive(id))
	{
		new xp_need_hp, xp_need_ap, xp_need_speed, xp_need_gravity, xp_need_damage, xp_need_regen;
		xp_need_hp = hp_level_f[id] * 99
		xp_need_ap = ap_level_f[id] * 99
		xp_need_speed = speed_lvl_f[id] * 111
		xp_need_gravity = gravity_lvl_f[id] * 100
		xp_need_damage = damage_lvl_f[id] * 122
		xp_need_regen = regenerare_lvl_f[id] * 144
		static menu[250], len
		len = 0
		
		len += formatex(menu[len], charsmax(menu) - len, "\yAbilitati Furien\r [XP:%d]^n^n", XP[id])
		if(hp_level_f[id] < 7)
		{
			len += formatex(menu[len], charsmax(menu) - len, "\y1.\w HP + 25\r [LV.%d/XP UP:%d]^n", hp_level_f[id], xp_need_hp)
		}
		else
		{
			len += formatex(menu[len], charsmax(menu) - len, "\d1.\d HP + 25\d [LV.%d MAX]^n", hp_level_f[id])
		}
		if(ap_level_f[id] < 7)
		{
			len += formatex(menu[len], charsmax(menu) - len, "\y2.\w AP + 25\r [LV.%d/XP UP:%d]^n", ap_level_f[id], xp_need_ap)
		}
		else
		{
			len += formatex(menu[len], charsmax(menu) - len, "\d2. AP + 25 [LV.%d MAX]^n", ap_level_f[id])
		}
		if(speed_lvl_f[id] < 7)
		{
			len += formatex(menu[len], charsmax(menu) - len, "\y3.\w SPEED +25\r [LV.%d/XP UP:%d]^n", speed_lvl_f[id], xp_need_speed)
		}
		else
		{
			len += formatex(menu[len], charsmax(menu) - len, "\d3. SPEED +25 [LV.%d MAX]^n", speed_lvl_f[id])
		}
		if(gravity_lvl_f[id] < 7)
		{
			len += formatex(menu[len], charsmax(menu) - len, "\y4.\w GRAVITY -25\r [LV.%d/XP UP:%d]^n", gravity_lvl_f[id], xp_need_gravity)
		}
		else
		{
			len += formatex(menu[len], charsmax(menu) - len, "\d4. GRAVITY -25 [LV.%d MAX]^n", gravity_lvl_f[id])
		}
		if(damage_lvl_f[id] < 7)
		{
			len += formatex(menu[len], charsmax(menu) - len, "\y5.\w DAMAGE +10\r [LV.%d/XP UP:%d]^n", damage_lvl_f[id], xp_need_damage)
		}
		else
		{
			len += formatex(menu[len], charsmax(menu) - len, "\d5. DAMAGE +10 [LV.%d MAX]^n", damage_lvl_f[id])
		}
		if(regenerare_lvl_f[id] < 7)
		{
			len += formatex(menu[len], charsmax(menu) - len, "\y6.\w REGEN +5 HP\r [LV.%d/XP UP:%d]", regenerare_lvl_f[id], xp_need_regen)
		}
		else
		{
			len += formatex(menu[len], charsmax(menu) - len, "\d6. REGEN +5 HP [LV.%d MAX]", regenerare_lvl_f[id])
		}
		show_menu(id, FR_KEYSMENU, menu, -1, "Furien Menu")
		return PLUGIN_HANDLED;
	}
	return PLUGIN_HANDLED;
}

public menu_furien(id, key)
{
	new xp_need_hp, xp_need_ap, xp_need_speed, xp_need_gravity, xp_need_damage, xp_need_regen;
	xp_need_hp = hp_level_f[id] * 99
	xp_need_ap = ap_level_f[id] * 99
	xp_need_speed = speed_lvl_f[id] * 111
	xp_need_gravity = gravity_lvl_f[id] * 100
	xp_need_damage = damage_lvl_f[id] * 122
	xp_need_regen = regenerare_lvl_f[id] * 144
	switch(key)
	{
		case 0:
		{
			if(hp_level_f[id] < 7)
			{
				if(XP[id] >= xp_need_hp)
				{
					XP[id] -= xp_need_hp
					hp_level_f[id] += 1
					mesaj_color(id, ".v[Furien].g Ai avansat la nivelul.e %d.g la HP pentru.e Furieni.g.", hp_level_f[id])
					salvaredate(id)
				}
				else
				{
					mesaj_color(id, ".v[Furien].g Nu ai destul XP. XP necesar.e %d.g.", xp_need_hp - XP[id])
				}
			}
			
			if(hp_level_f[id] >= 7)
			{
				hp_level_f[id] = 7
				mesaj_color(id, ".v[Furien].g Ai nivelul maxim la.e HP.g.")
			}
		}
		case 1:
		{
			if(ap_level_f[id] < 7)
			{
				if(XP[id] >= xp_need_ap)
				{
					XP[id] -= xp_need_ap
					ap_level_f[id] += 1
					mesaj_color(id, ".v[Furien].g Ai avansat la nivelul.e %d.g la AP pentru.e Furieni.g.", ap_level_f[id])
					salvaredate(id)
				}
				else
				{
					mesaj_color(id, ".v[Furien].g Nu ai destul XP. XP necesar.e %d.g.", xp_need_ap - XP[id])
				}
			}
			
			if(ap_level_f[id] >= 7)
			{
				ap_level_f[id] = 7
				mesaj_color(id, ".v[Furien].g Ai nivelul maxim.")
			}
		}
		case 2:
		{
			if(speed_lvl_f[id] < 7)
			{
				if(XP[id] >= xp_need_speed)
				{
					XP[id] -= xp_need_speed
					speed_lvl_f[id] += 1
					mesaj_color(id, ".v[Furien].g Ai avansat la nivelul.e %d.g la SPEED pentru.e Furieni.g.", speed_lvl_f[id])
					salvaredate(id)
				}
				else
				{
					mesaj_color(id, ".v[Furien].g Nu ai destul XP. XP necesar.e %d.g.", xp_need_speed - XP[id])
				}
			}
			
			if(speed_lvl_f[id] >= 7)
			{
				speed_lvl_f[id] = 7
				mesaj_color(id, ".v[Furien].g Ai nivelul maxim.")
			}
		}
		case 3:
		{
			if(gravity_lvl_f[id] < 7)
			{
				if(XP[id] >= xp_need_gravity)
				{
					XP[id] -= xp_need_gravity
					gravity_lvl_f[id] += 1
					mesaj_color(id, ".v[Furien].g Ai avansat la nivelul.e %d.g la GRAVITY pentru.e Furieni.g.", gravity_lvl_f[id])
					salvaredate(id)
				}
				else
				{
					mesaj_color(id, ".v[Furien].g Nu ai destul XP. XP necesar.e %d.g.", xp_need_gravity - XP[id])
				}
			}
			
			if(gravity_lvl_f[id] >= 7)
			{
				gravity_lvl_f[id] = 7
				mesaj_color(id, ".v[Furien].g Ai nivelul maxim.")
			}
		}
		case 4:
		{
			if(damage_lvl_f[id] < 7)
			{
				if(XP[id] >= xp_need_damage)
				{
					XP[id] -= xp_need_damage
					damage_lvl_f[id] += 1
					mesaj_color(id, ".v[Furien].g Ai avansat la nivelul.e %d.g la DAMAGE pentru.e Furieni.g.", damage_lvl_f[id])
					salvaredate(id)
				}
				else
				{
					mesaj_color(id, ".v[Furien].g Nu ai destul XP. XP necesar.e %d.g.", xp_need_damage - XP[id])
				}
			}
			
			if(damage_lvl_f[id] >= 7)
			{
				damage_lvl_f[id] = 7
				mesaj_color(id, ".v[Furien].g Ai nivelul maxim.")
			}
		}
		case 5:
		{
			if(regenerare_lvl_f[id] < 7)
			{
				if(XP[id] >= xp_need_regen)
				{
					XP[id] -= xp_need_regen
					regenerare_lvl_f[id] += 1
					mesaj_color(id, ".v[Furien].g Ai avansat la nivelul.e %d.g la REGEN pentru.e Furieni.g.", regenerare_lvl_f[id])
					salvaredate(id)
				}
				else
				{
					mesaj_color(id, ".v[Furien].g Nu ai destul XP. XP necesar.e %d.g.", xp_need_regen - XP[id])
				}
			}
			
			if(regenerare_lvl_f[id] >= 7)
			{
				regenerare_lvl_f[id] = 7
				mesaj_color(id, ".v[Furien].g Ai nivelul maxim.")
			}
		}
	}
	return PLUGIN_HANDLED
}

anti_furiens_ability(id)
{
	if(is_user_alive(id))
	{
		new xp_need_hp, xp_need_ap, xp_need_speed, xp_need_gravity, xp_need_damage, xp_need_regen;
		xp_need_hp = hp_level_a_f[id] * 99
		xp_need_ap = ap_level_a_f[id] * 99
		xp_need_speed = speed_lvl_a_f[id] * 111
		xp_need_gravity = gravity_lvl_a_f[id] * 100
		xp_need_damage = damage_lvl_a_f[id] * 122
		xp_need_regen = regenerare_lvl_a_f[id] * 144
		static menu[250], len
		len = 0
		
		len += formatex(menu[len], charsmax(menu) - len, "\yAbilitati AntiFurien\r [XP:%d]^n^n", XP[id])
		if(hp_level_a_f[id] < 7)
		{
			len += formatex(menu[len], charsmax(menu) - len, "\y1.\w HP + 25\r [LV.%d/XP UP:%d]^n", hp_level_a_f[id], xp_need_hp)
		}
		else
		{
			len += formatex(menu[len], charsmax(menu) - len, "\d1. HP + 25 [LV.%d MAX]^n", hp_level_a_f[id])
		}
		if(ap_level_a_f[id] < 7)
		{
			len += formatex(menu[len], charsmax(menu) - len, "\y2.\w AP + 25\r [LV.%d/XP UP:%d]^n", ap_level_a_f[id], xp_need_ap)
		}
		else
		{
			len += formatex(menu[len], charsmax(menu) - len, "\d2. AP + 25 [LV.%d MAX]^n", ap_level_a_f[id])
		}
		if(speed_lvl_a_f[id] < 7)
		{
			len += formatex(menu[len], charsmax(menu) - len, "\y3.\w SPEED +25\r [LV.%d/XP UP:%d]^n", speed_lvl_a_f[id], xp_need_speed)
		}
		else
		{
			len += formatex(menu[len], charsmax(menu) - len, "\d3. SPEED +25 [LV.%d MAX]^n", speed_lvl_a_f[id])
		}
		if(gravity_lvl_a_f[id] < 7)
		{
			len += formatex(menu[len], charsmax(menu) - len, "\y4.\w GRAVITY -25\r [LV.%d/XP UP:%d]^n", gravity_lvl_a_f[id], xp_need_gravity)
		}
		else
		{
			len += formatex(menu[len], charsmax(menu) - len, "\d4. GRAVITY -25 [LV.%d MAX]^n", gravity_lvl_a_f[id])
		}
		if(damage_lvl_a_f[id] < 7)
		{
			len += formatex(menu[len], charsmax(menu) - len, "\y5.\w DAMAGE +10\r [LV.%d/XP UP:%d]^n", damage_lvl_a_f[id], xp_need_damage)
		}
		else
		{
			len += formatex(menu[len], charsmax(menu) - len, "\d5. DAMAGE +10 [LV.%d MAX]^n", damage_lvl_a_f[id])
		}
		if(regenerare_lvl_a_f[id] < 7)
		{
			len += formatex(menu[len], charsmax(menu) - len, "\y6.\w REGEN +5 HP\r [LV.%d/XP UP:%d]", regenerare_lvl_a_f[id], xp_need_regen)
		}
		else
		{
			len += formatex(menu[len], charsmax(menu) - len, "\d6. REGEN +5 HP [LV.%d MAX]", regenerare_lvl_a_f[id])
		}
		show_menu(id, A_FR_KEYSMENU, menu, -1, "AntiF Menu")
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}

public menu_afurien(id, key)
{
	new xp_need_hp, xp_need_ap, xp_need_speed, xp_need_gravity, xp_need_damage, xp_need_regen;
	xp_need_hp = hp_level_a_f[id] * 99
	xp_need_ap = ap_level_a_f[id] * 99
	xp_need_speed = speed_lvl_a_f[id] * 111
	xp_need_gravity = gravity_lvl_a_f[id] * 100
	xp_need_damage = damage_lvl_a_f[id] * 122
	xp_need_regen = regenerare_lvl_a_f[id] * 144
	switch (key)
	{
		case 0:
		{
			if(hp_level_a_f[id] < 7)
			{
				if(XP[id] >= xp_need_hp)
				{
					XP[id] -= xp_need_hp
					hp_level_a_f[id] += 1
					mesaj_color(id, ".v[Furien].g Ai avansat la nivelul.e %d.g la HP pentru.e Anti-Furieni.g.", hp_level_a_f[id])
					salvaredate(id)
				}
				else
				{
					mesaj_color(id, ".v[Furien].g Nu ai destul XP. XP necesar.e %d.g.", xp_need_hp - XP[id])
				}
			}
			
			if(hp_level_a_f[id] >= 7)
			{
				hp_level_a_f[id] = 7
				mesaj_color(id, ".v[Furien].g Ai nivelul maxim la.e HP.g.")
			}
		}
		case 1:
		{
			if(ap_level_a_f[id] < 7)
			{
				if(XP[id] >= xp_need_ap)
				{
					XP[id] -= xp_need_ap
					ap_level_a_f[id] += 1
					mesaj_color(id, ".v[Furien].g Ai avansat la nivelul.e %d.g la AP pentru.e Anti-Furieni.g.", ap_level_a_f[id])
					salvaredate(id)
				}
				else
				{
					mesaj_color(id, ".v[Furien].g Nu ai destul XP. XP necesar.e %d.g.", xp_need_ap - XP[id])
				}
			}
			
			if(ap_level_a_f[id] >= 7)
			{
				ap_level_a_f[id] = 7
				mesaj_color(id, ".v[Furien].g Ai nivelul maxim.")
			}
		}
		case 2:
		{
			if(speed_lvl_a_f[id] < 7)
			{
				if(XP[id] >= xp_need_speed)
				{
					XP[id] -= xp_need_speed
					speed_lvl_a_f[id] += 1
					mesaj_color(id, ".v[Furien].g Ai avansat la nivelul.e %d.g la SPEED pentru.e Anti-Furieni.g.", speed_lvl_a_f[id])
					salvaredate(id)
				}
				else
				{
					mesaj_color(id, ".v[Furien].g Nu ai destul XP. XP necesar.e %d.g.", xp_need_speed - XP[id])
				}
			}
			
			if(speed_lvl_a_f[id] >= 7)
			{
				speed_lvl_a_f[id] = 7
				mesaj_color(id, ".v[Furien].g Ai nivelul maxim.")
			}
		}
		case 3:
		{
			if(gravity_lvl_a_f[id] < 7)
			{
				if(XP[id] >= xp_need_gravity)
				{
					XP[id] -= xp_need_gravity
					gravity_lvl_a_f[id] += 1
					mesaj_color(id, ".v[Furien].g Ai avansat la nivelul.e %d.g la GRAVITY pentru.e Anti-Furieni.g.", gravity_lvl_a_f[id])
					salvaredate(id)
				}
				else
				{
					mesaj_color(id, ".v[Furien].g Nu ai destul XP. XP necesar.e %d.g.", xp_need_gravity - XP[id])
				}
			}
			
			if(gravity_lvl_a_f[id] >= 7)
			{
				gravity_lvl_a_f[id] = 7
				mesaj_color(id, ".v[Furien].g Ai nivelul maxim.")
			}
		}
		case 4:
		{
			if(damage_lvl_a_f[id] < 7)
			{
				if(XP[id] >= xp_need_damage)
				{
					XP[id] -= xp_need_damage
					damage_lvl_a_f[id] += 1
					mesaj_color(id, ".v[Furien].g Ai avansat la nivelul.e %d.g la DAMAGE pentru.e Anti-Furieni.g.", damage_lvl_a_f[id])
					salvaredate(id)
				}
				else
				{
					mesaj_color(id, ".v[Furien].g Nu ai destul XP. XP necesar.e %d.g.", xp_need_damage - XP[id])
				}
			}
			
			if(damage_lvl_a_f[id] >= 7)
			{
				damage_lvl_a_f[id] = 7
				mesaj_color(id, ".v[Furien].g Ai nivelul maxim.")
			}
		}
		case 5:
		{
			if(regenerare_lvl_a_f[id] < 7)
			{
				if(XP[id] >= xp_need_regen)
				{
					XP[id] -= xp_need_regen
					regenerare_lvl_a_f[id] += 1
					mesaj_color(id, ".v[Furien].g Ai avansat la nivelul.e %d.g la REGEN pentru.e Anti-Furieni.g.", regenerare_lvl_a_f[id])
					salvaredate(id)
				}
				else
				{
					mesaj_color(id, ".v[Furien].g Nu ai destul XP. XP necesar.e %d.g.", xp_need_regen - XP[id])
				}
			}
			
			if(regenerare_lvl_a_f[id] >= 7)
			{
				regenerare_lvl_a_f[id] = 7
				mesaj_color(id, ".v[Furien].g Ai nivelul maxim.")
			}
		}
	}
	return PLUGIN_HANDLED;
}

stock mesaj_color(const id, const input[], any:...)
{
	new count = 1, players[32]
	static msg[191]
	vformat(msg, 190, input, 3)

	replace_all(msg, 190, ".v", "^4")
	replace_all(msg, 190, ".g", "^1")
	replace_all(msg, 190, ".e", "^3")

	if (id) players[0] = id; else get_players(players, count, "ch")
	{
		for (new i = 0; i < count; i++)
		{
			if (is_user_connected(players))
			{
				message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players)
				write_byte(players);
				write_string(msg);
				message_end();
			}
		}
	}
}

stock msg_screen_fade(id, holdtime, r, g, b, a)
{
   message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), { 0, 0, 0 }, id)
   write_short(seconds_to_units(holdtime))
   write_short(seconds_to_units(holdtime))
   write_short(0)
   write_byte(r)
   write_byte(g)
   write_byte(b)
   write_byte(a)
   message_end()
}

stock seconds_to_units(time)
{
   return ((1 << 12) * (time))
}
[/code]
User avatar
DaNNe.
Fost moderator
Fost moderator
Posts: 2808
Joined: 08 Nov 2013, 20:43
Detinator Steam: Da
CS Status: Activitate scăzută
SteamID: /id/FurienMaster
Reputatie: Nick anterior: DnD. Gold, Emrys
0.5/3
Fost moderator ajutator
Fost Membru Club eXtreamCS (doua luni)
Has thanked: 230 times
Been thanked: 128 times
Contact:

22 Dec 2013, 19:08

[RNG]EAGame wrote:@Clic , stiu si eu acel plugin. Dar nu imi place deloc si are si cateva buguri.

Asta este plugin-ul care il am eu, dar nu are shop.
.SMA | Afiseaza codul
[code]
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <csx>
#include <fakemeta>
#include <fun>
#include <hamsandwich>
#include <nvault>

#define TASK_REGEN	134926
#define ID_REGEN	(taskid - TASK_REGEN)
#define EFFECT_LENGTH 3

const KEYSMENU = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0
const FR_KEYSMENU = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0
const A_FR_KEYSMENU = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0

// Definitia la salvarea pe nvault
new salvare_date;

// Nivele si XP
new XP[33];

new hp_level_f[33], ap_level_f[33], speed_lvl_f[33], gravity_lvl_f[33], damage_lvl_f[33], regenerare_lvl_f[33];
	
new hp_level_a_f[33], ap_level_a_f[33], speed_lvl_a_f[33], gravity_lvl_a_f[33], damage_lvl_a_f[33], regenerare_lvl_a_f[33];
	
// Functiile puterilor (regenerare si respawn)
new maximhp[33];

public plugin_init()
{
	register_plugin("XP & POWERS", "1.1b", "cyby")
	
	register_concmd("amx_givexp", "givexp_cmd", ADMIN_KICK, "<nume> <xp>")
	
	// Comenzi ale jucatorilor
	register_clcmd("chooseteam", "show_game")
	register_clcmd("jointeam", "show_game")
	
	// Eventuri si procese ale jucatorilor
	// Moarte
	register_event("DeathMsg", "ucidere", "a")
	// Prethink(executa mereu)
	register_forward(FM_PlayerPreThink, "player_prethink")
	// Spawn Event
	RegisterHam(Ham_Spawn, "player", "spawn_player_post", 1)
	// Damage
	RegisterHam(Ham_TakeDamage, "player", "damage_player")
	// Regenerare (separat)
	RegisterHam(Ham_TakeDamage, "player", "take_damage")
	
	// Event castigare
	register_event("SendAudio", "Win_Furien", "a", "2=%!MRAD_terwin")
	register_event("SendAudio", "Win_Anti_Furien", "a", "2=%!MRAD_ctwin")
	
	// Preluare date NVAULT
	salvare_date = nvault_open("FURIEN_LVL");
	
	register_menu("Game Menu", KEYSMENU, "menu_game")
	register_menu("Furien Menu", FR_KEYSMENU, "menu_furien")
	register_menu("AntiF Menu", A_FR_KEYSMENU, "menu_afurien")
}

public client_putinserver(id)
{
	preluaredate(id)
}

public client_disconnect(id)
{
	salvaredate(id)
	XP[id] = 0
	hp_level_f[id] = 0
	ap_level_f[id] = 0
	speed_lvl_f[id] = 0
	gravity_lvl_f[id] = 0
	damage_lvl_f[id] = 0
	regenerare_lvl_f[id] = 0
	hp_level_a_f[id] = 0
	ap_level_a_f[id] = 0
	speed_lvl_a_f[id] = 0
	gravity_lvl_a_f[id] = 0
	damage_lvl_a_f[id] = 0
	regenerare_lvl_a_f[id] = 0
}

public salvaredate(id) 
{ 
	new nume[32] 
	get_user_name(id,nume,31) 
	new vaultnume[32],vaultdate[256] 

	format(vaultnume,31,"%s", nume) 
	format(vaultdate,255,"%i#%i#%i#%i#%i#%i#%i#%i#%i#%i#%i#%i#%i#", XP[id], hp_level_f[id], ap_level_f[id], speed_lvl_f[id], gravity_lvl_f[id], damage_lvl_f[id], regenerare_lvl_f[id], hp_level_a_f[id], ap_level_a_f[id], speed_lvl_a_f[id], gravity_lvl_a_f[id], damage_lvl_a_f[id], regenerare_lvl_a_f[id])

	nvault_set(salvare_date,vaultnume,vaultdate) 
	return PLUGIN_CONTINUE 
}

public preluaredate(id) 
{ 
	new nume[32] 
	get_user_name(id,nume,31) 
	new vaultnume[32],vaultdate[256] 

	format(vaultnume,31,"%s", nume) 
	format(vaultdate,255,"%i#%i#%i#%i#%i#%i#%i#%i#%i#%i#%i#%i#%i#", XP[id], hp_level_f[id], ap_level_f[id], speed_lvl_f[id], gravity_lvl_f[id], damage_lvl_f[id], regenerare_lvl_f[id], hp_level_a_f[id], ap_level_a_f[id], speed_lvl_a_f[id], gravity_lvl_a_f[id], damage_lvl_a_f[id], regenerare_lvl_a_f[id]) 

	nvault_get(salvare_date,vaultnume,vaultdate,255) 
	replace_all(vaultdate, 255, "#", " ") 
	new playerxp[32], hp_n_f[32], ap_n_f[32], speed_n_f[32], grav_n_f[32], dmg_n_f[32], regen_n_f[32], hp_n_a_f[32], ap_n_a_f[32], speed_n_a_f[32], grav_n_a_f[32], dmg_n_a_f[32], regen_n_a_f[32]
	parse(vaultdate, playerxp, 31, hp_n_f, 31, ap_n_f, 31, speed_n_f, 31, grav_n_f, 31, dmg_n_f, 31, regen_n_f, 31, hp_n_a_f, 31, ap_n_a_f, 31, speed_n_a_f, 31, grav_n_a_f, 31, dmg_n_a_f, 31, regen_n_a_f, 31) 
	XP[id] = str_to_num(playerxp) 
	hp_level_f[id] = str_to_num(hp_n_f)
	ap_level_f[id] = str_to_num(ap_n_f) 
	speed_lvl_f[id] = str_to_num(speed_n_f)
	gravity_lvl_f[id] = str_to_num(grav_n_f) 
	damage_lvl_f[id] = str_to_num(dmg_n_f)
	regenerare_lvl_f[id] = str_to_num(regen_n_f)
	hp_level_a_f[id] = str_to_num(hp_n_a_f)
	ap_level_a_f[id] = str_to_num(ap_n_a_f) 
	speed_lvl_a_f[id] = str_to_num(speed_n_a_f)
	gravity_lvl_a_f[id] = str_to_num(grav_n_a_f) 
	damage_lvl_a_f[id] = str_to_num(dmg_n_a_f)
	regenerare_lvl_a_f[id] = str_to_num(regen_n_a_f)
	return PLUGIN_CONTINUE 
}

public givexp_cmd(id,level,cid)
{
	if(!cmd_access(id, level, cid, 2))
	{
		return PLUGIN_HANDLED;
	}
	
	new arg[32], name[32];
	read_argv(1, arg, 31)
	get_user_name(id, name, 31)
	
	new jucator = cmd_target(id, arg, 31)
	
	if(!jucator)
	{
		return PLUGIN_HANDLED
	}
	
	if(!is_user_connected(jucator))
	{
		return PLUGIN_HANDLED
	}
	
	new cant[4], name2[32];
	
	get_user_name(jucator, name2, 31)
	read_argv(2, cant, 3)
	
	new XP_plus = str_to_num(cant)
	
	XP[jucator] += XP_plus
	mesaj_color(0, ".v[Furien].g Adminul.e %s.g a dat.e %d.g XP lui.e %s.g.", name, XP_plus, name2)
	return PLUGIN_HANDLED;
}
	
public ucidere()
{
	new atacator, victim;
	atacator = read_data(1)
	victim = read_data(2)
	
	if(!is_user_connected(atacator) || !is_user_connected(victim))
	{
		return 
	}
	
	if(atacator == victim)
	{
		return;
	}
	
	XP[atacator] += 10;
	set_hudmessage(200, 100, 50, -1.0, -1.0, 0, 6.0, 2.5)
	show_hudmessage(atacator, "+10 XP")
}

public bomb_planted(id)
{
	XP[id] +=15
	mesaj_color(id, ".v[Furien].g Ai primit.e 15 XP.g pentru plantarea bombei.")
}

public bomb_defused(id)
{
	XP[id] +=15
	mesaj_color(id, ".v[Furien].g Ai primit.e 15 XP.g pentru dezamorsarea bombei.")
}	

public player_prethink(id)
{
	if(!is_user_alive(id))
	{
		return PLUGIN_HANDLED;
	}

	if(cs_get_user_team(id) == CS_TEAM_T)
	{
		set_pev(id, pev_maxspeed, 500.0 + speed_lvl_f[id] * 25.0)
		
		if(gravity_lvl_f[id] == 1)
		{
			set_pev(id, pev_gravity, 400.0/800.0)
		}
		else if(gravity_lvl_f[id] == 2)
		{
			set_pev(id, pev_gravity, 375.0/800.0)
		}
		else if(gravity_lvl_f[id] == 3)
		{
			set_pev(id, pev_gravity, 350.0/800.0)
		}
		else if(gravity_lvl_f[id] == 4)
		{
			set_pev(id, pev_gravity, 325.0/800.0)
		}
		else if(gravity_lvl_f[id] == 5)
		{
			set_pev(id, pev_gravity, 300.0/800.0)
		}
		else if(gravity_lvl_f[id] == 6)
		{
			set_pev(id, pev_gravity, 275.0/800.0)
		}
		else if(gravity_lvl_f[id] == 7)
		{
			set_pev(id, pev_gravity, 250.0/800.0)
		}
	}
	if(cs_get_user_team(id) == CS_TEAM_CT)
	{
		set_pev(id, pev_maxspeed, 250.0 + speed_lvl_a_f[id] * 25.0)
		
		if(gravity_lvl_a_f[id] == 1)
		{
			set_pev(id, pev_gravity, 750.0/800.0)
		}
		else if(gravity_lvl_a_f[id] == 2)
		{
			set_pev(id, pev_gravity, 700.0/800.0)
		}
		else if(gravity_lvl_a_f[id] == 3)
		{
			set_pev(id, pev_gravity, 650.0/800.0)
		}
		else if(gravity_lvl_a_f[id] == 4)
		{
			set_pev(id, pev_gravity, 600.0/800.0)
		}
		else if(gravity_lvl_a_f[id] == 5)
		{
			set_pev(id, pev_gravity, 550.0/800.0)
		}
		else if(gravity_lvl_a_f[id] == 6)
		{
			set_pev(id, pev_gravity, 500.0/800.0)
		}
		else if(gravity_lvl_a_f[id] == 7)
		{
			set_pev(id, pev_gravity, 450.0/800.0)
		}
	}
	return PLUGIN_CONTINUE
}

public spawn_player_post(id)
{
	if(!is_user_alive(id))
	{
		return PLUGIN_HANDLED;
	}
	
	if(cs_get_user_team(id) == CS_TEAM_T)
	{
		set_user_health(id, 100 + hp_level_f[id] * 25)
		
		set_pev(id, pev_armorvalue, ap_level_f[id] * 25.0)
	}
	
	if(cs_get_user_team(id) == CS_TEAM_CT)
	{
		set_user_health(id, 100 + hp_level_a_f[id] * 25)
		
		set_pev(id, pev_armorvalue, ap_level_a_f[id] * 25.0)
	}
	maximhp[id] = get_user_health(id)
	return PLUGIN_CONTINUE
}

public damage_player(victim, inflictor, attacker, Float:damage, damage_type)
{
	if(cs_get_user_team(attacker) == CS_TEAM_CT)
	{
		damage += damage_lvl_a_f[attacker] * 10
	}
	
	if(cs_get_user_team(attacker) == CS_TEAM_T)
	{
		if(get_user_weapon(attacker) == CSW_KNIFE)
		{
			damage += damage_lvl_a_f[attacker] * 10
		}
	}
	SetHamParamFloat(4, damage);
}

public take_damage(victim, inflictor, attacker, Float:damage, damage_type)
{
	if(cs_get_user_team(victim) == CS_TEAM_CT)
	{
		set_task(1.0, "regen_hp_a_f", victim+TASK_REGEN)
	}
	
	if(cs_get_user_team(victim) == CS_TEAM_T)
	{
		if(get_user_weapon(victim) == CSW_KNIFE)
		{
			remove_task(victim+TASK_REGEN)
			set_task(1.0, "regen_hp_f", victim+TASK_REGEN)
		}
	}
}

public Win_Furien()
{
	new players[32], num, player;
	get_players(players, num, "", "TERRORIST")

	for(new i = 0; i < num; i++)
	{   
		player = players

		if(!is_user_alive(player))
		{
			return PLUGIN_HANDLED
		}
		XP[player] += 10
		msg_screen_fade(player, EFFECT_LENGTH, 175, 0, 0, 115);
		mesaj_color(player, ".v[Furien].g Ai castigat bonus.e 10 XP.g pentru castigarea rundei.")
	}

	return PLUGIN_CONTINUE
}

public Win_Anti_Furien()
{
	new players[32], num, player;
	get_players(players, num, "", "CT")

	for(new i = 0; i < num; i++)
	{   
		player = players

		if(!is_user_alive(player))
		{
			return PLUGIN_HANDLED
		}
		XP[player] += 10
		msg_screen_fade(player, EFFECT_LENGTH, 175, 0, 0, 115);
		mesaj_color(player, ".v[Furien].g Ai castigat bonus.e 10 XP.g pentru castigarea rundei.")
	}

	return PLUGIN_CONTINUE
}

public regen_hp_a_f(taskid)
{
	if(is_user_connected(ID_REGEN) && is_user_alive(ID_REGEN))
	{
		if(maximhp[ID_REGEN] != -1)
		{
			new curenthp; 
			curenthp = get_user_health(ID_REGEN)
			
			if(curenthp < maximhp[ID_REGEN])
			{
				if(curenthp > maximhp[ID_REGEN])
				{
					set_user_health(ID_REGEN, maximhp[ID_REGEN])
				}
				set_user_health(ID_REGEN, get_user_health(ID_REGEN) + regenerare_lvl_a_f[ID_REGEN] * 5)
				set_task(5.0, "regen_hp_a_f", ID_REGEN+TASK_REGEN)
			}
		}
	}
}

public regen_hp_f(taskid)
{
	if(is_user_connected(ID_REGEN) && is_user_alive(ID_REGEN))
	{
		if(maximhp[ID_REGEN] != -1)
		{
			new curenthp = get_user_health(ID_REGEN)
			if(curenthp < maximhp[ID_REGEN])
			{
				if(curenthp > maximhp[ID_REGEN])
				{
					set_user_health(ID_REGEN, maximhp[ID_REGEN])
				}
				set_user_health(ID_REGEN, get_user_health(ID_REGEN) + regenerare_lvl_f[ID_REGEN] * 5)
				set_task(5.0, "regen_hp_f", ID_REGEN+TASK_REGEN)
			}
		}
	}
}

public show_game(id)
{
	if(is_user_alive(id))
	{
		show_menu_game(id)
		return PLUGIN_HANDLED
	}
	return PLUGIN_CONTINUE
}

show_menu_game(id)
{
	static menu[250], len
	len = 0
	
	len += formatex(menu[len], charsmax(menu) - len, "\yFurien\r [XP:%d]^n^n", XP[id])
	len += formatex(menu[len], charsmax(menu) - len, "\y1.\w Furien XP Buying^n")
	len += formatex(menu[len], charsmax(menu) - len, "\y2.\w Anti-Furien XP Buying^n")
	show_menu(id, KEYSMENU, menu, -1, "Game Menu")
}

public menu_game(id, key)
{
	switch (key)
	{
		case 0:
		{
			furiens_ability(id)
		}
		case 1:
		{
			anti_furiens_ability(id)
		}
	}
}

furiens_ability(id)
{
	if(is_user_alive(id))
	{
		new xp_need_hp, xp_need_ap, xp_need_speed, xp_need_gravity, xp_need_damage, xp_need_regen;
		xp_need_hp = hp_level_f[id] * 99
		xp_need_ap = ap_level_f[id] * 99
		xp_need_speed = speed_lvl_f[id] * 111
		xp_need_gravity = gravity_lvl_f[id] * 100
		xp_need_damage = damage_lvl_f[id] * 122
		xp_need_regen = regenerare_lvl_f[id] * 144
		static menu[250], len
		len = 0
		
		len += formatex(menu[len], charsmax(menu) - len, "\yAbilitati Furien\r [XP:%d]^n^n", XP[id])
		if(hp_level_f[id] < 7)
		{
			len += formatex(menu[len], charsmax(menu) - len, "\y1.\w HP + 25\r [LV.%d/XP UP:%d]^n", hp_level_f[id], xp_need_hp)
		}
		else
		{
			len += formatex(menu[len], charsmax(menu) - len, "\d1.\d HP + 25\d [LV.%d MAX]^n", hp_level_f[id])
		}
		if(ap_level_f[id] < 7)
		{
			len += formatex(menu[len], charsmax(menu) - len, "\y2.\w AP + 25\r [LV.%d/XP UP:%d]^n", ap_level_f[id], xp_need_ap)
		}
		else
		{
			len += formatex(menu[len], charsmax(menu) - len, "\d2. AP + 25 [LV.%d MAX]^n", ap_level_f[id])
		}
		if(speed_lvl_f[id] < 7)
		{
			len += formatex(menu[len], charsmax(menu) - len, "\y3.\w SPEED +25\r [LV.%d/XP UP:%d]^n", speed_lvl_f[id], xp_need_speed)
		}
		else
		{
			len += formatex(menu[len], charsmax(menu) - len, "\d3. SPEED +25 [LV.%d MAX]^n", speed_lvl_f[id])
		}
		if(gravity_lvl_f[id] < 7)
		{
			len += formatex(menu[len], charsmax(menu) - len, "\y4.\w GRAVITY -25\r [LV.%d/XP UP:%d]^n", gravity_lvl_f[id], xp_need_gravity)
		}
		else
		{
			len += formatex(menu[len], charsmax(menu) - len, "\d4. GRAVITY -25 [LV.%d MAX]^n", gravity_lvl_f[id])
		}
		if(damage_lvl_f[id] < 7)
		{
			len += formatex(menu[len], charsmax(menu) - len, "\y5.\w DAMAGE +10\r [LV.%d/XP UP:%d]^n", damage_lvl_f[id], xp_need_damage)
		}
		else
		{
			len += formatex(menu[len], charsmax(menu) - len, "\d5. DAMAGE +10 [LV.%d MAX]^n", damage_lvl_f[id])
		}
		if(regenerare_lvl_f[id] < 7)
		{
			len += formatex(menu[len], charsmax(menu) - len, "\y6.\w REGEN +5 HP\r [LV.%d/XP UP:%d]", regenerare_lvl_f[id], xp_need_regen)
		}
		else
		{
			len += formatex(menu[len], charsmax(menu) - len, "\d6. REGEN +5 HP [LV.%d MAX]", regenerare_lvl_f[id])
		}
		show_menu(id, FR_KEYSMENU, menu, -1, "Furien Menu")
		return PLUGIN_HANDLED;
	}
	return PLUGIN_HANDLED;
}

public menu_furien(id, key)
{
	new xp_need_hp, xp_need_ap, xp_need_speed, xp_need_gravity, xp_need_damage, xp_need_regen;
	xp_need_hp = hp_level_f[id] * 99
	xp_need_ap = ap_level_f[id] * 99
	xp_need_speed = speed_lvl_f[id] * 111
	xp_need_gravity = gravity_lvl_f[id] * 100
	xp_need_damage = damage_lvl_f[id] * 122
	xp_need_regen = regenerare_lvl_f[id] * 144
	switch(key)
	{
		case 0:
		{
			if(hp_level_f[id] < 7)
			{
				if(XP[id] >= xp_need_hp)
				{
					XP[id] -= xp_need_hp
					hp_level_f[id] += 1
					mesaj_color(id, ".v[Furien].g Ai avansat la nivelul.e %d.g la HP pentru.e Furieni.g.", hp_level_f[id])
					salvaredate(id)
				}
				else
				{
					mesaj_color(id, ".v[Furien].g Nu ai destul XP. XP necesar.e %d.g.", xp_need_hp - XP[id])
				}
			}
			
			if(hp_level_f[id] >= 7)
			{
				hp_level_f[id] = 7
				mesaj_color(id, ".v[Furien].g Ai nivelul maxim la.e HP.g.")
			}
		}
		case 1:
		{
			if(ap_level_f[id] < 7)
			{
				if(XP[id] >= xp_need_ap)
				{
					XP[id] -= xp_need_ap
					ap_level_f[id] += 1
					mesaj_color(id, ".v[Furien].g Ai avansat la nivelul.e %d.g la AP pentru.e Furieni.g.", ap_level_f[id])
					salvaredate(id)
				}
				else
				{
					mesaj_color(id, ".v[Furien].g Nu ai destul XP. XP necesar.e %d.g.", xp_need_ap - XP[id])
				}
			}
			
			if(ap_level_f[id] >= 7)
			{
				ap_level_f[id] = 7
				mesaj_color(id, ".v[Furien].g Ai nivelul maxim.")
			}
		}
		case 2:
		{
			if(speed_lvl_f[id] < 7)
			{
				if(XP[id] >= xp_need_speed)
				{
					XP[id] -= xp_need_speed
					speed_lvl_f[id] += 1
					mesaj_color(id, ".v[Furien].g Ai avansat la nivelul.e %d.g la SPEED pentru.e Furieni.g.", speed_lvl_f[id])
					salvaredate(id)
				}
				else
				{
					mesaj_color(id, ".v[Furien].g Nu ai destul XP. XP necesar.e %d.g.", xp_need_speed - XP[id])
				}
			}
			
			if(speed_lvl_f[id] >= 7)
			{
				speed_lvl_f[id] = 7
				mesaj_color(id, ".v[Furien].g Ai nivelul maxim.")
			}
		}
		case 3:
		{
			if(gravity_lvl_f[id] < 7)
			{
				if(XP[id] >= xp_need_gravity)
				{
					XP[id] -= xp_need_gravity
					gravity_lvl_f[id] += 1
					mesaj_color(id, ".v[Furien].g Ai avansat la nivelul.e %d.g la GRAVITY pentru.e Furieni.g.", gravity_lvl_f[id])
					salvaredate(id)
				}
				else
				{
					mesaj_color(id, ".v[Furien].g Nu ai destul XP. XP necesar.e %d.g.", xp_need_gravity - XP[id])
				}
			}
			
			if(gravity_lvl_f[id] >= 7)
			{
				gravity_lvl_f[id] = 7
				mesaj_color(id, ".v[Furien].g Ai nivelul maxim.")
			}
		}
		case 4:
		{
			if(damage_lvl_f[id] < 7)
			{
				if(XP[id] >= xp_need_damage)
				{
					XP[id] -= xp_need_damage
					damage_lvl_f[id] += 1
					mesaj_color(id, ".v[Furien].g Ai avansat la nivelul.e %d.g la DAMAGE pentru.e Furieni.g.", damage_lvl_f[id])
					salvaredate(id)
				}
				else
				{
					mesaj_color(id, ".v[Furien].g Nu ai destul XP. XP necesar.e %d.g.", xp_need_damage - XP[id])
				}
			}
			
			if(damage_lvl_f[id] >= 7)
			{
				damage_lvl_f[id] = 7
				mesaj_color(id, ".v[Furien].g Ai nivelul maxim.")
			}
		}
		case 5:
		{
			if(regenerare_lvl_f[id] < 7)
			{
				if(XP[id] >= xp_need_regen)
				{
					XP[id] -= xp_need_regen
					regenerare_lvl_f[id] += 1
					mesaj_color(id, ".v[Furien].g Ai avansat la nivelul.e %d.g la REGEN pentru.e Furieni.g.", regenerare_lvl_f[id])
					salvaredate(id)
				}
				else
				{
					mesaj_color(id, ".v[Furien].g Nu ai destul XP. XP necesar.e %d.g.", xp_need_regen - XP[id])
				}
			}
			
			if(regenerare_lvl_f[id] >= 7)
			{
				regenerare_lvl_f[id] = 7
				mesaj_color(id, ".v[Furien].g Ai nivelul maxim.")
			}
		}
	}
	return PLUGIN_HANDLED
}

anti_furiens_ability(id)
{
	if(is_user_alive(id))
	{
		new xp_need_hp, xp_need_ap, xp_need_speed, xp_need_gravity, xp_need_damage, xp_need_regen;
		xp_need_hp = hp_level_a_f[id] * 99
		xp_need_ap = ap_level_a_f[id] * 99
		xp_need_speed = speed_lvl_a_f[id] * 111
		xp_need_gravity = gravity_lvl_a_f[id] * 100
		xp_need_damage = damage_lvl_a_f[id] * 122
		xp_need_regen = regenerare_lvl_a_f[id] * 144
		static menu[250], len
		len = 0
		
		len += formatex(menu[len], charsmax(menu) - len, "\yAbilitati AntiFurien\r [XP:%d]^n^n", XP[id])
		if(hp_level_a_f[id] < 7)
		{
			len += formatex(menu[len], charsmax(menu) - len, "\y1.\w HP + 25\r [LV.%d/XP UP:%d]^n", hp_level_a_f[id], xp_need_hp)
		}
		else
		{
			len += formatex(menu[len], charsmax(menu) - len, "\d1. HP + 25 [LV.%d MAX]^n", hp_level_a_f[id])
		}
		if(ap_level_a_f[id] < 7)
		{
			len += formatex(menu[len], charsmax(menu) - len, "\y2.\w AP + 25\r [LV.%d/XP UP:%d]^n", ap_level_a_f[id], xp_need_ap)
		}
		else
		{
			len += formatex(menu[len], charsmax(menu) - len, "\d2. AP + 25 [LV.%d MAX]^n", ap_level_a_f[id])
		}
		if(speed_lvl_a_f[id] < 7)
		{
			len += formatex(menu[len], charsmax(menu) - len, "\y3.\w SPEED +25\r [LV.%d/XP UP:%d]^n", speed_lvl_a_f[id], xp_need_speed)
		}
		else
		{
			len += formatex(menu[len], charsmax(menu) - len, "\d3. SPEED +25 [LV.%d MAX]^n", speed_lvl_a_f[id])
		}
		if(gravity_lvl_a_f[id] < 7)
		{
			len += formatex(menu[len], charsmax(menu) - len, "\y4.\w GRAVITY -25\r [LV.%d/XP UP:%d]^n", gravity_lvl_a_f[id], xp_need_gravity)
		}
		else
		{
			len += formatex(menu[len], charsmax(menu) - len, "\d4. GRAVITY -25 [LV.%d MAX]^n", gravity_lvl_a_f[id])
		}
		if(damage_lvl_a_f[id] < 7)
		{
			len += formatex(menu[len], charsmax(menu) - len, "\y5.\w DAMAGE +10\r [LV.%d/XP UP:%d]^n", damage_lvl_a_f[id], xp_need_damage)
		}
		else
		{
			len += formatex(menu[len], charsmax(menu) - len, "\d5. DAMAGE +10 [LV.%d MAX]^n", damage_lvl_a_f[id])
		}
		if(regenerare_lvl_a_f[id] < 7)
		{
			len += formatex(menu[len], charsmax(menu) - len, "\y6.\w REGEN +5 HP\r [LV.%d/XP UP:%d]", regenerare_lvl_a_f[id], xp_need_regen)
		}
		else
		{
			len += formatex(menu[len], charsmax(menu) - len, "\d6. REGEN +5 HP [LV.%d MAX]", regenerare_lvl_a_f[id])
		}
		show_menu(id, A_FR_KEYSMENU, menu, -1, "AntiF Menu")
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}

public menu_afurien(id, key)
{
	new xp_need_hp, xp_need_ap, xp_need_speed, xp_need_gravity, xp_need_damage, xp_need_regen;
	xp_need_hp = hp_level_a_f[id] * 99
	xp_need_ap = ap_level_a_f[id] * 99
	xp_need_speed = speed_lvl_a_f[id] * 111
	xp_need_gravity = gravity_lvl_a_f[id] * 100
	xp_need_damage = damage_lvl_a_f[id] * 122
	xp_need_regen = regenerare_lvl_a_f[id] * 144
	switch (key)
	{
		case 0:
		{
			if(hp_level_a_f[id] < 7)
			{
				if(XP[id] >= xp_need_hp)
				{
					XP[id] -= xp_need_hp
					hp_level_a_f[id] += 1
					mesaj_color(id, ".v[Furien].g Ai avansat la nivelul.e %d.g la HP pentru.e Anti-Furieni.g.", hp_level_a_f[id])
					salvaredate(id)
				}
				else
				{
					mesaj_color(id, ".v[Furien].g Nu ai destul XP. XP necesar.e %d.g.", xp_need_hp - XP[id])
				}
			}
			
			if(hp_level_a_f[id] >= 7)
			{
				hp_level_a_f[id] = 7
				mesaj_color(id, ".v[Furien].g Ai nivelul maxim la.e HP.g.")
			}
		}
		case 1:
		{
			if(ap_level_a_f[id] < 7)
			{
				if(XP[id] >= xp_need_ap)
				{
					XP[id] -= xp_need_ap
					ap_level_a_f[id] += 1
					mesaj_color(id, ".v[Furien].g Ai avansat la nivelul.e %d.g la AP pentru.e Anti-Furieni.g.", ap_level_a_f[id])
					salvaredate(id)
				}
				else
				{
					mesaj_color(id, ".v[Furien].g Nu ai destul XP. XP necesar.e %d.g.", xp_need_ap - XP[id])
				}
			}
			
			if(ap_level_a_f[id] >= 7)
			{
				ap_level_a_f[id] = 7
				mesaj_color(id, ".v[Furien].g Ai nivelul maxim.")
			}
		}
		case 2:
		{
			if(speed_lvl_a_f[id] < 7)
			{
				if(XP[id] >= xp_need_speed)
				{
					XP[id] -= xp_need_speed
					speed_lvl_a_f[id] += 1
					mesaj_color(id, ".v[Furien].g Ai avansat la nivelul.e %d.g la SPEED pentru.e Anti-Furieni.g.", speed_lvl_a_f[id])
					salvaredate(id)
				}
				else
				{
					mesaj_color(id, ".v[Furien].g Nu ai destul XP. XP necesar.e %d.g.", xp_need_speed - XP[id])
				}
			}
			
			if(speed_lvl_a_f[id] >= 7)
			{
				speed_lvl_a_f[id] = 7
				mesaj_color(id, ".v[Furien].g Ai nivelul maxim.")
			}
		}
		case 3:
		{
			if(gravity_lvl_a_f[id] < 7)
			{
				if(XP[id] >= xp_need_gravity)
				{
					XP[id] -= xp_need_gravity
					gravity_lvl_a_f[id] += 1
					mesaj_color(id, ".v[Furien].g Ai avansat la nivelul.e %d.g la GRAVITY pentru.e Anti-Furieni.g.", gravity_lvl_a_f[id])
					salvaredate(id)
				}
				else
				{
					mesaj_color(id, ".v[Furien].g Nu ai destul XP. XP necesar.e %d.g.", xp_need_gravity - XP[id])
				}
			}
			
			if(gravity_lvl_a_f[id] >= 7)
			{
				gravity_lvl_a_f[id] = 7
				mesaj_color(id, ".v[Furien].g Ai nivelul maxim.")
			}
		}
		case 4:
		{
			if(damage_lvl_a_f[id] < 7)
			{
				if(XP[id] >= xp_need_damage)
				{
					XP[id] -= xp_need_damage
					damage_lvl_a_f[id] += 1
					mesaj_color(id, ".v[Furien].g Ai avansat la nivelul.e %d.g la DAMAGE pentru.e Anti-Furieni.g.", damage_lvl_a_f[id])
					salvaredate(id)
				}
				else
				{
					mesaj_color(id, ".v[Furien].g Nu ai destul XP. XP necesar.e %d.g.", xp_need_damage - XP[id])
				}
			}
			
			if(damage_lvl_a_f[id] >= 7)
			{
				damage_lvl_a_f[id] = 7
				mesaj_color(id, ".v[Furien].g Ai nivelul maxim.")
			}
		}
		case 5:
		{
			if(regenerare_lvl_a_f[id] < 7)
			{
				if(XP[id] >= xp_need_regen)
				{
					XP[id] -= xp_need_regen
					regenerare_lvl_a_f[id] += 1
					mesaj_color(id, ".v[Furien].g Ai avansat la nivelul.e %d.g la REGEN pentru.e Anti-Furieni.g.", regenerare_lvl_a_f[id])
					salvaredate(id)
				}
				else
				{
					mesaj_color(id, ".v[Furien].g Nu ai destul XP. XP necesar.e %d.g.", xp_need_regen - XP[id])
				}
			}
			
			if(regenerare_lvl_a_f[id] >= 7)
			{
				regenerare_lvl_a_f[id] = 7
				mesaj_color(id, ".v[Furien].g Ai nivelul maxim.")
			}
		}
	}
	return PLUGIN_HANDLED;
}

stock mesaj_color(const id, const input[], any:...)
{
	new count = 1, players[32]
	static msg[191]
	vformat(msg, 190, input, 3)

	replace_all(msg, 190, ".v", "^4")
	replace_all(msg, 190, ".g", "^1")
	replace_all(msg, 190, ".e", "^3")

	if (id) players[0] = id; else get_players(players, count, "ch")
	{
		for (new i = 0; i < count; i++)
		{
			if (is_user_connected(players))
			{
				message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players)
				write_byte(players);
				write_string(msg);
				message_end();
			}
		}
	}
}

stock msg_screen_fade(id, holdtime, r, g, b, a)
{
   message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), { 0, 0, 0 }, id)
   write_short(seconds_to_units(holdtime))
   write_short(seconds_to_units(holdtime))
   write_short(0)
   write_byte(r)
   write_byte(g)
   write_byte(b)
   write_byte(a)
   message_end()
}

stock seconds_to_units(time)
{
   return ((1 << 12) * (time))
}
[/code]

Dar tu ai shop pe server ?
Contact: Activitate scazuta.
User avatar
Jorj
eXtream Mod
eXtream Mod
Posts: 3500
Joined: 13 Aug 2013, 17:10
Detinator Steam: Da
Detinator server CS: Furien.LsZ.Ro
SteamID: clic_lsz
Reputatie: eXtream Mod
Fost Membru Club eXtreamCS (patru luni)
Nume anterior: Clic
Location: Piatra Neamt
Been thanked: 20 times
Contact:

22 Dec 2013, 19:28

La fel il am si eu :)
Intermediez tranzactii cand am chef si timp ! :)

Image
[RNG]EAGame
Membru, skill 0
Membru, skill 0
Posts: 30
Joined: 28 Sep 2013, 20:21
Detinator Steam: Nu
CS Status: RNG-Servers.Com
Detinator server CS: cs.rng-servers.com
Location: Cotnari - Iasi - Romania
Has thanked: 6 times
Contact:

22 Dec 2013, 20:37

Nu am
User avatar
DaNNe.
Fost moderator
Fost moderator
Posts: 2808
Joined: 08 Nov 2013, 20:43
Detinator Steam: Da
CS Status: Activitate scăzută
SteamID: /id/FurienMaster
Reputatie: Nick anterior: DnD. Gold, Emrys
0.5/3
Fost moderator ajutator
Fost Membru Club eXtreamCS (doua luni)
Has thanked: 230 times
Been thanked: 128 times
Contact:

22 Dec 2013, 21:09

Pai datine un plugin de shop ca sa va putem adauga XP. Oricum eu acum trebuie sa ies, asa ca doar maine va mai pot ajuta.
Contact: Activitate scazuta.
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 17 guests