Cerere plugin givexp

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori

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
Ki||eR
Membru, skill 0
Membru, skill 0
Posts: 76
Joined: 22 May 2013, 09:51
Detinator Steam: Nu
CS Status: Ce-i ala status ?
Detinator server CS: Furien2.*** Reclama ***.Ro
Has thanked: 7 times
Been thanked: 1 time
Contact:

06 Jul 2014, 21:31

Descriere plugin cerut: As dori sa imi adaugati intr-un plugin o comanda de dat xp
Alte informatii:-
| Afiseaza codul
*================================================================================

	-------------------------------------------
	-*- [ZP] Server Addon: LevelUp System XP 3.2b || Update-*-
	-------------------------------------------

	~~~~~~~~~~~~~~~
	- Description -
	~~~~~~~~~~~~~~~
	Level System

	~~~~~~~~~~~~~~~
	- Changelog -
	~~~~~~~~~~~~~~~
	v. 1.0 - Plugin Released. Testing...
	v. 1.1 - Fixed Save Level.
	v. 1.2 - Added New cvars, fixed codes + Added plugin code Player Name
	v. 1.3 - Update version: added new cvars + system bonuses
	v. 1.4 - New modes for nemesis level & survivor level, added cvars
	v. 1.5 - Testing...
	v. 1.6 - Added cvars, Plugin Released.
	v. 1.7 - Added Multilangual, Update plugin
	v. 1.8 - v. 1.9 - Fixed Level Up bugs
	v. 2.0 - Added new cvars + XP Level Extended: Real Level System.
	v. 2.1 - Fixed bugs.
	--
	v. 2.8 - It is globally altered on a new kind of the version of this plugin
	v. 2.9 - Added New cvars. Ful fixed.
	v. 3.0 - XP Mode Updated in EXP to level.
	v. 3.1 - Fixed Bug Shutting Down Server.
	v. 3.2 - Added Give Level & give exp.
	v. 3.2b - Fixed bug bonusme, Run Time Error fixed. Fix bug One level. 
================================================================================*/

#include <amxmodx>
#include <amxmisc>
#include <nvault>
#include <fakemeta_util>
#include <hamsandwich>
#include <zombieplague>

#define PLUGIN "[ZP] Server Addon: LevelUp System XP 3.2"
#define VERSION "3.2 beta"
#define AUTHOR "Re.Act!ve"
#define ACCES ADMIN_CVAR
#pragma tabsize 0
#define is_valid_player(%1) (1 <= %1 <= 32)
new SayText
new g_level[33], g_level_data, g_frags_level, g_ScreenFade, g_level_del[33], g_level_bonus, g_ammo, g_level_zombie, g_level_type
new g_human_red, g_human_green, g_human_blue, g_zombie_red, g_zombie_green, g_zombie_blue
new g_level_max, g_give_ammo, g_give_ammopacks, g_level_num, g_level_info, g_player_name, g_levels[33], g_h_damage
new g_h_health, g_h_speed, g_z_damage, h_health[33], h_speed[33], level_exp[33]
new g_level_exp[33], g_exp_data, g_Players, g_hud_color, red, green, blue, nameid[33]
new Float:h_damage[33], Float:z_damage[33]
new bool:g_bonus[33], g_trime[33]
new sound_level_up[] = { "misc/zp_level_up.wav"}
new sound_health[] = { "items/medshot4.wav" }

// Zombie Classes MUST be registered on plugin_precache
public plugin_precache()
{
        precache_sound( sound_level_up )
        precache_sound( sound_health )
}

public plugin_init()
{
	g_level_type = 		register_cvar("zp_level_type", "0")		// 0 - По нику, 1 - по IP, 2- по SteamID
	g_frags_level = 		register_cvar("zp_level_frags", "20")		// Сколько добавится экспы для получения след. уровня
	g_level_max  = 		register_cvar("zp_level_max", "70")		// Максимальный левел
	g_give_ammo = 		register_cvar("zp_level_give_ammo", "1")	// Давать аммо паки при каждом полученном левле?
	g_give_ammopacks = register_cvar("zp_level_ammo", "10")	// Сколько давать аммопаков? (если выше установлено 1)

	g_h_damage = 		register_cvar("zp_level_h_damage", "1")	// Увеличивать с каждым уровнем урон на Х у людей
	g_h_health = 		register_cvar("zp_level_h_health", "10")	// Люди получают за каждый левел дополнительные Х хп
	g_h_speed = 		register_cvar("zp_level_h_speed", "1.0") 	// На сколько увел. скорость людей с каждым уровнем?
	g_z_damage = 		register_cvar("zp_level_z_damage", "3")	// Увеличивать с каждым уровнем урон на Х у зомби

	g_level_info = 		register_cvar("zp_level_info", "1")		// Показывать инфу о игроке, когда вводят в чат info <nick>
	g_player_name = 	register_cvar("zp_player_name", "1")		// Показывать инфу, при наведении курсором на игрока?
	g_level_bonus = 	register_cvar("zp_level_bonus_on", "1") // Можно ли будет снимать мегабонус?
	g_level_num = 		register_cvar("zp_level_number", "5")	// Каждые Х левлов будет возможность снять  мегабонус (если выше 1)
	g_ammo = 		register_cvar("zp_level_bonus", "100")		// Сколько аммо паков этот мегабонус?
	g_level_zombie = 	register_cvar("zp_level_zombie", "1")		// Смогут ли зомби срубить левел? (Если 0 - только чел.)

	// Настройте цветовую гамму для HUD сообщения о левле
	g_hud_color = 		register_cvar("zp_level_hud_type", "1")		// 1 - Цвета для команд, 0 - Рандомный цвет (1 раз).
	g_human_red =		register_cvar("zp_level_h_red", "0") 		// Красный цвет для людей HUD Level
	g_human_green =	register_cvar("zp_level_h_green", "0") 		// Зеленый цвет для людей HUD Level
	g_human_blue =	register_cvar("zp_level_h_blue", "255") 	// Синий цвет для людей HUD Level
	g_zombie_red =		register_cvar("zp_level_z_red", "255") 		// Красный цвет для зомби HUD Level
	g_zombie_green =	register_cvar("zp_level_z_green", "50") 	// Зеленый цвет для зомби HUD Level
	g_zombie_blue =	register_cvar("zp_level_z_blue", "0") 		// Синий цвет для зомби HUD Level
	

	g_level_data = nvault_open("Leveling_Save")
	g_exp_data = nvault_open("Exp_Save")
	register_clcmd("say","say_info");
	register_clcmd("say_team","say_info");
	register_clcmd("zp_levelexp","expa_give", ADMIN_CVAR, "use to give Exp")
	register_clcmd("zp_level_is","level_give", ADMIN_CVAR, "use to give Level")
	SayText = get_user_msgid("SayText")
	g_Players = get_maxplayers();
	register_event("HLTV", "Round_Start", "a", "1=0", "2=0")
	register_event("DeathMsg", "Frags_Manager", "a", "1>0") 	
	// RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
	register_dictionary("zp_level_system_xp.txt")
	register_event("StatusValue","show_status","be","1=2","2!0")
       	register_event("StatusValue","hide_status","be","1=1","2=0")
	g_ScreenFade = get_user_msgid( "ScreenFade" )
	register_plugin(PLUGIN, VERSION, AUTHOR)
}

public Round_Start()
{
	for(new id=1;id<=g_Players;id++)
	{
		if( is_valid_player(id) && !is_user_bot(id) )
		{
			g_levels[id] = g_levels[id] = get_pcvar_num(g_level_num);
			set_task(3.0, "Level", id)
		}
	}
}

public Level(id)
{
	g_trime[id] = false;
	new n = 1;
	while( n < g_level[id] )
	{
		h_health[id] = n * get_pcvar_num(g_h_health);
		h_speed[id] = n * get_pcvar_num(g_h_speed);
		h_damage[id] = n * get_pcvar_float(g_h_damage);
		z_damage[id] = n * get_pcvar_float(g_z_damage);
		n = n + 1
	}
	fm_set_user_health( id, get_user_health(id) + h_health[id] )
	set_pev(id, pev_maxspeed, fm_get_user_maxspeed(id) + h_speed[id] )
	emit_sound(id, CHAN_STREAM, sound_health, 1.0, ATTN_NORM, 0, PITCH_HIGH )

	if( g_level[id] < get_pcvar_num(g_level_num) )
	g_levels[id] = get_pcvar_num(g_level_num);
	else
	{
		if(g_level[id] != g_levels[id])
		{
			new x = 1;
			while( g_level[id] > ( x * get_pcvar_num(g_level_num)) )
			{
				x = x + 1;
				g_levels[id] = x * get_pcvar_num(g_level_num);
			}
		}
	}
}

public expa_give(id, level, cid)
{
	if (!cmd_access(id, level, cid, 2))
	{				
		console_print(id, "У вас нет доступа к команде")
		return PLUGIN_HANDLED
	}
	new target[32]
	new count[32]	
	
	read_argv(1,target,31)
	read_argv(2,count,31)
	new target_id, name[32], nameid[32]
	target_id = find_player("bl", target)
	get_user_name(target_id, name, sizeof name - 1) 
	get_user_name(id, nameid, sizeof nameid - 1)
	if(!target_id) 
	{
		console_print(id, "Can't find that player")
		return PLUGIN_HANDLED
	}
	if(read_argc() != 3)
	return PLUGIN_HANDLED	

	if(str_to_num(count) < (g_level_exp[target_id] - level_exp[target_id]) )
	{
		if(str_to_num(count) == 0)
		console_print(id, "Exp Player %s in %i / %i", name, level_exp[target_id], g_level_exp[target_id])
		else
		{
			console_print(id, "Player %s gives for %i exp, Her Maximum %i", name, str_to_num(count), g_level_exp[target_id])
			level_exp[target_id] = level_exp[target_id] + str_to_num(count);
		}
		
	}
	else
	{
		console_print(id, "Maximum Exp in player %i", g_level_exp[target_id])
	}
	return PLUGIN_HANDLED
}

public level_give(id, level, cid)
{
	if (!cmd_access(id, level, cid, 2))
	{				
		console_print(id, "У вас нет доступа к команде")
		return PLUGIN_HANDLED
	}
	new target[32]
	new count[32]	
	
	read_argv(1,target,31)
	read_argv(2,count,31)
	new target_id, name[32], level_id
	level_id = str_to_num(count);
	target_id = find_player("bl", target)
	get_user_name(target_id, name, sizeof name - 1) 
	if(!target_id) 
	{
		console_print(id, "Can't find that player")
		return PLUGIN_HANDLED
	}
	if(read_argc() != 3)
	return PLUGIN_HANDLED	

	if( ((g_level[target_id] + level_id) <=get_pcvar_num(g_level_max)) && (level_id != 0) && ((g_level[target_id] + level_id) > 0 ) )
	{
		if(level_id > 0)
		{
			g_level[target_id] = g_level[target_id] + level_id;
			level_exp[target_id] = 0;
			message_begin(MSG_ONE_UNRELIABLE, g_ScreenFade, _, target_id)
		       	write_short(1<<12) // duration
		        write_short(1) // hold time
			write_short(0x0000) // fade type
			write_byte(1) // red
			write_byte(200) // green
			write_byte(0) // blue
			write_byte(205) // alpha
			message_end()
			emit_sound(target_id, CHAN_STREAM, sound_level_up, 1.0, ATTN_NORM, 0, PITCH_HIGH )
		}
		else
		{
			g_level[target_id] = g_level[target_id] + level_id;
			level_exp[target_id] = 0;
			message_begin(MSG_ONE_UNRELIABLE, g_ScreenFade, _, target_id)
		       	write_short(1<<12) // duration
		        write_short(1) // hold time
			write_short(0x0000) // fade type
			write_byte(200) // red
			write_byte(40) // green
			write_byte(0) // blue
			write_byte(205) // alpha
			message_end()
		}
			console_print(id, "Player %s gives add %i level", name, level_id)
	}
	else
		console_print(id, "Operation Invalid")
	return PLUGIN_HANDLED
}

public client_putinserver(id)
{
	if( !is_user_bot(id) && is_valid_player(id) )
	{
		Level_Load(id)
		g_level_exp[id] = get_pcvar_num(g_frags_level);
		new name[32]
		g_trime[id] = false;
		g_bonus[id] = true;
		nameid[id] = get_user_name(id, name, sizeof name - 1)
		g_trime[id] = false;
		new n = 1;
		while( n != g_level[id] )
		{
			h_health[id] = n * get_pcvar_num(g_h_health);
			h_speed[id] = n * get_pcvar_num(g_h_speed);
			h_damage[id] = n * get_pcvar_float(g_h_damage);
			z_damage[id] = n * get_pcvar_float(g_z_damage);
			n = n + 1;
		}
		new Float:speed[32];
		speed[id] = fm_get_user_maxspeed(id) + h_speed[id];
		fm_set_user_health( id, get_user_health(id) + h_health[id] )
		set_pev(id, pev_maxspeed, speed[id] )
		emit_sound(id, CHAN_STREAM, sound_health, 1.0, ATTN_NORM, 0, PITCH_HIGH )
		if( g_level[id] == 0) g_level[id] = 1;
		if( level_exp[id] == g_level[id] ) level_exp[id] = 0;
	
		if(g_level[id] < get_pcvar_num(g_level_num))
		g_levels[id] = get_pcvar_num(g_level_num);
		else
		{
			if(g_level[id] != g_levels[id])
			{
				new x = 1;
				while( g_level[id] > ( x * get_pcvar_num(g_level_num)) )
				{
					x = x + 1;
					g_levels[id] = x * get_pcvar_num(g_level_num);
				}
			}
		}
	
		new y = 0;
		while( g_level[id] > y )
		{
			y = y + 1;
			g_level_exp[id] = y * get_pcvar_num(g_frags_level);
		}
		red = random_num(10, 200)
		green = random_num(10, 200)
		blue = random_num(10, 200)
	}
}

public client_disconnect(id)
{
	if(get_pcvar_num(g_level_type) == 0 )
	{
		new name[32], player_nick[32]
		player_nick[id] = get_user_name(id, name, sizeof name - 1)
		if(player_nick[id] == nameid[id])
		Level_Save(id)
	}
	else
		Level_Save(id)	
	
	g_trime[id] = false;
}

public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_bits)
{
	if ( !zp_get_user_zombie(attacker) && is_user_alive(attacker) && !is_user_bot(attacker) ) 
		SetHamParamFloat(4, damage + h_damage[attacker])
	else
	{
		if( !is_user_bot(attacker) && is_valid_player(attacker) )
		SetHamParamFloat(4, damage + z_damage[attacker])
	}
}

public hide_status(id)
{
    	set_hudmessage(0,0,0,0.0,0.0,0, 0.0, 0.01, 0.0, 0.0, 4)
    	show_hudmessage(id,"")
}

public show_status(id)
{
    	new name[32],pid = read_data(2)
    	get_user_name(pid,name,31)
   	if (!zp_get_user_zombie(pid) && !zp_get_user_zombie(id) && (get_pcvar_num(g_player_name) == 1) )
	{
       		set_hudmessage(0,0,255,-1.0,0.60,1, 0.01, 3.0, 0.01, 0.01, 4)
       		show_hudmessage(id,"%L", LANG_PLAYER, "PLAYER_NAME_H", name, g_level[pid], 								get_user_health(pid),get_user_armor(pid),zp_get_user_ammo_packs(pid))
	}
 	if(zp_get_user_zombie(id) && zp_get_user_zombie(pid) && (get_pcvar_num(g_player_name) == 1) )
	{
        set_hudmessage(255,0,0,-1.0,0.60,1, 0.01, 3.0, 0.01, 0.01, 4)
        show_hudmessage(id,"%L", LANG_PLAYER, "PLAYER_NAME_Z", name, g_level[pid], get_user_health(pid), zp_get_user_ammo_packs(pid))
	}
}

public say_info(id)
{
	new text[70], arg1[32], target[32], count[32]
	read_args(text, sizeof(text)-1);
	remove_quotes(text);
	arg1[0] = '^0';
	target[0] = '^0';
	count[0] = '^0';
	parse(text, arg1, sizeof(arg1)-1, target, sizeof(target)-1, count, sizeof(count)-1);
	if ( equali(arg1, "info", 4) )
	{
		info_player(id, target);
	}
	if ( equali(arg1, "bonusme", 7) && (get_pcvar_num(g_level_info) == 1))
	{
		bonus_player(id);
	}
	if ( equali(arg1, "levelexp", 7) && (get_pcvar_num(g_level_info) == 1))
	{
		expa_player(id);
	}
	return PLUGIN_CONTINUE;
}

public zp_user_infected_pre(id, infector)
{
	if( is_user_alive(infector) && (level_exp[infector] < (g_level_exp[infector] - 1)) && zp_get_user_zombie(infector))
	{
		level_exp[infector] = level_exp[infector] + 1;
	}
	else
	{
		new y, aname[32];
		get_user_name(infector, aname, sizeof aname - 1)
		if( ( level_exp[infector] >= (g_level_exp[infector] - 1) ) && (g_level[infector] <= get_pcvar_num(g_level_max)) && 			is_user_alive(infector) && zp_get_user_zombie(infector) && is_valid_player(infector) && get_pcvar_num(g_level_zombie))
		{
			g_bonus[infector] = true;
			g_level[infector] = g_level[infector] + 1;
			level_exp[infector] = 0;
			while( g_level[infector] != y )
			{
				y = y + 1;
				g_level_exp[infector] = y * get_pcvar_num(g_frags_level);
			}
			message_begin(MSG_ONE_UNRELIABLE, g_ScreenFade, _, infector)
		       	write_short(1<<12) // duration
		        write_short(1) // hold time
			write_short(0x0000) // fade type
			write_byte(1) // red
			write_byte(200) // green
			write_byte(0) // blue
			write_byte(205) // alpha
			message_end()
			emit_sound(infector, CHAN_STREAM, sound_level_up, 1.0, ATTN_NORM, 0, PITCH_HIGH )
			set_hudmessage(0, 200, 0, 0.65, 0.5, 0, 0.0, 3.0, 2.0, 1.0, -1)
			show_hudmessage(0, "%L", LANG_PLAYER, "LEVEL_UP", aname, g_level[infector])
			if(get_pcvar_num(g_give_ammo) == 1)
			{
			ChatColor(infector, "!g[LEVEL] !y %L", LANG_PLAYER, "BONUS_LEVEL", get_pcvar_num(g_give_ammopacks) )
			zp_set_user_ammo_packs(infector, zp_get_user_ammo_packs(infector) + get_pcvar_num(g_give_ammopacks) )
			}
			Level_Save(infector);
		}
	}
}

public info_player(id, target[])
{
	new target_2;
	target_2 = find_player("bl", target)
	static name[32], nameid[32];
	get_user_name(target_2, name, sizeof name - 1)
	get_user_name(id, nameid, sizeof nameid - 1)
	if(!target_2)
	{
		ChatColor(id, "!g[ZP] !y%L", LANG_PLAYER, "LEVEL_INFO_NONAME")
		return PLUGIN_HANDLED
	}

	if(zp_get_user_zombie(id))
	{
		if(id != target_2)
		{
			ChatColor(id, "!g[INFO]!t %L", LANG_PLAYER, "LEVEL_INFOZM", name, g_level[target_2], z_damage[target_2], zp_get_user_ammo_packs(target_2) )
			ChatColor(target_2, "!g[INFO]!t%L ", LANG_PLAYER, "LEVEL_INFO_YOU", nameid)
		}
		else
		{
			ChatColor(id, "!g[INFOME]!t%L", LANG_PLAYER, "LEVEL_INFOME_ZM", z_damage[target_2] )
		}
	}
	else
	{
		if(id != target_2)
		{
			ChatColor(id, "!g[INFO]!t %L", LANG_PLAYER, "LEVEL_INFO", name, g_level[target_2], h_damage[target_2], 							h_speed[target_2], h_health[target_2], zp_get_user_ammo_packs(target_2) )
			ChatColor(target_2, "!g[INFO]!t%L ", LANG_PLAYER, "LEVEL_INFO_YOU", nameid)
		}
		else
		{
			ChatColor(id, "!g[INFOME]!t%L", LANG_PLAYER, "LEVEL_INFOME", h_damage[target_2], h_speed[target_2], 							h_health[target_2] )
		}
	}
	return PLUGIN_HANDLED
}

public bonus_player(id)
{
	if( (g_level[id] >= g_levels[id]) && g_bonus[id] && (get_pcvar_num(g_level_bonus) == 1) )
	{
		new x = 1;
		while( g_level[id] >= ( x * get_pcvar_num(g_level_num)) )
		{
			x = x + 1;
			g_levels[id] = x * get_pcvar_num(g_level_num);
		}
		g_level_del[id] = g_level[id];
		g_bonus[id] = false;
		ChatColor(id, "!g[BONUS] !y%L", LANG_PLAYER, "LEVEL_MEGABONUS", g_level[id], get_pcvar_num(g_ammo) )
		zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + get_pcvar_num(g_ammo) )
	}
	else
	{
		if(g_level[id] < g_levels[id])
		{
			new x = 1;
			while( g_level[id] >= ( x * get_pcvar_num(g_level_num)) )
			{
				x = x + 1;
				g_levels[id] = x * get_pcvar_num(g_level_num);
			}
			ChatColor(id, "!g[BONUS] !y%L", LANG_PLAYER, "LEVEL_NOMEGABONUS", g_levels[id], get_pcvar_num(g_ammo) )
		}
	}
	return PLUGIN_HANDLED
}

public expa_player(id)
{
	ChatColor(id, "!g[EXPA] !y%L", LANG_PLAYER, "LEVEL_EXP", level_exp[id], g_level_exp[id])
	return PLUGIN_HANDLED
}

public level_status(id)
{
	if( is_user_alive(id) )
	{
		switch( get_pcvar_num(g_hud_color) ) 
	        { 
	            	case 0: 
	            	{ 
				set_hudmessage(red, green, blue, 0.02, 0.87, 0, 0.0, 1.1, 2.0, 1.0, -1)
				show_hudmessage(id,"%L", LANG_PLAYER, "LEVEL_STATUS", g_level[id], level_exp[id])
			}
	            	case 1: 
			{			
				if( !zp_get_user_zombie(id) )
				{
					set_hudmessage(get_pcvar_num(g_human_red), get_pcvar_num(g_human_green), 									get_pcvar_num(g_human_blue), 0.02, 0.87, 0, 0.0, 1.1, 2.0, 1.0, -1)
					show_hudmessage(id,"%L", LANG_PLAYER, "LEVEL_STATUS", g_level[id], level_exp[id])
				}
				else
				{
					set_hudmessage(get_pcvar_num(g_zombie_red), get_pcvar_num(g_zombie_green), 								get_pcvar_num(g_zombie_blue), 0.02, 0.87, 0, 0.0, 1.1, 2.0, 1.0, -1)
					show_hudmessage(id,"%L", LANG_PLAYER, "LEVEL_STATUS", g_level[id], level_exp[id])
				}
			}
		}
	}
}

public Level_Save(id)
{
	new key[64], data[256], data_exp[256], key_exp[64]
	switch( get_pcvar_num(g_level_type) ) 
        { 
            	case 0: 
            	{ 
			new name[33]
			get_user_name(id,name,32)
			format(key, 63, "%s-/", name)
			format(key_exp, 63, "%s-/", name)
		}
		case 1:
		{
			new player_ip[33]
			get_user_ip(id,player_ip,32)
			format(key, 63, "%s-/", player_ip)
			format(key_exp, 63, "%s-/", player_ip)
		}
		case 2:
		{
			new steam_ID[33]
			get_user_authid(id,steam_ID,32)
			format(key, 63, "%s-/", steam_ID)
			format(key_exp, 63, "%s-/", steam_ID)
		}
	}

	//format(key, 63, "%s-/", name)
	format(data, 255, "%i#", g_level[id])

	//format(key_exp, 63, "%s-/", name)
	format(data_exp, 255, "%i#", level_exp[id])

	nvault_set(g_level_data, key, data)
	nvault_set(g_exp_data, key_exp, data_exp)
	return PLUGIN_CONTINUE;
}

public Level_Load(id)
{
	new key[64], data[256], data_exp[256], key_exp[64]
	switch( get_pcvar_num(g_level_type) ) 
        { 
            	case 0: 
            	{ 
			new name[33]
			get_user_name(id,name,32)
			format(key, 63, "%s-/", name)
			format(key_exp, 63, "%s-/", name)
		}
		case 1:
		{
			new player_ip[33]
			get_user_ip(id,player_ip,32)
			format(key, 63, "%s-/", player_ip)
			format(key_exp, 63, "%s-/", player_ip)
		}
		case 2:
		{
			new steam_ID[33]
			get_user_authid(id,steam_ID,32)
			format(key, 63, "%s-/", steam_ID)
			format(key_exp, 63, "%s-/", steam_ID)
		}
	}

	//format(key, 63, "%s-/", name)
	format(data, 255, "%i#", g_level[id])

	//format(key_exp, 63, "%s-/", name)
	format(data_exp, 255, "%i#", level_exp[id])

	nvault_get(g_level_data, key, data, 255)
	nvault_get(g_exp_data, key_exp, data_exp, 255)
	replace_all(data, 255, "#", " ")
	replace_all(data_exp, 255, "#", " ")

	new givelevel[32], give_exp[32]
	parse(data, givelevel, 31)
	parse(data_exp, give_exp, 31)
	g_level[id] = str_to_num(givelevel)
	level_exp[id] = str_to_num(give_exp)

	set_task(1.0, "level_status", id, _, _, "b")
	return PLUGIN_CONTINUE;
}

public Frags_Manager()
{
	new aname[32], attacker; attacker = read_data(1)
	new y; y = 1;
	get_user_name(attacker, aname, sizeof aname - 1)
	if( ( level_exp[attacker] >= (g_level_exp[attacker] - 1) ) && (g_level[attacker] <= get_pcvar_num(g_level_max)) && is_user_alive(attacker) && !is_user_bot(attacker) )
	{
		g_bonus[attacker] = true;
		g_level[attacker] = g_level[attacker] + 1;
		level_exp[attacker] = 0;
		while( g_level[attacker] != y )
		{
			y = y + 1;
			g_level_exp[attacker] = y * get_pcvar_num(g_frags_level);
		}
		message_begin(MSG_ONE_UNRELIABLE, g_ScreenFade, _, attacker)
	       	write_short(1<<12) // duration
	        write_short(1) // hold time
		write_short(0x0000) // fade type
		write_byte(1) // red
		write_byte(200) // green
		write_byte(0) // blue
		write_byte(205) // alpha
		message_end()
		emit_sound(attacker, CHAN_STREAM, sound_level_up, 1.0, ATTN_NORM, 0, PITCH_HIGH )
		set_hudmessage(0, 200, 0, 0.65, 0.5, 0, 0.0, 3.0, 2.0, 1.0, -1)
		show_hudmessage(0, "%L", LANG_PLAYER, "LEVEL_UP", aname, g_level[attacker])
		if(get_pcvar_num(g_give_ammo) == 1)
		{
			ChatColor(attacker, "!g[LEVEL] !y %L", LANG_PLAYER, "BONUS_LEVEL", get_pcvar_num(g_give_ammopacks) )
			zp_set_user_ammo_packs(attacker, zp_get_user_ammo_packs(attacker) + get_pcvar_num(g_give_ammopacks) )
		}
		Level_Save(attacker);
	}
	else
	{
		if(is_user_alive(attacker))
		{
			if(g_level[attacker] == get_pcvar_num(g_level_max))
			ChatColor(attacker, "!g[LEVEL]!y %L", LANG_PLAYER, "LEVEL_MAX", g_level[attacker] )
			level_exp[attacker] = level_exp[attacker] + 1;
			Level_Save(attacker);
		}
	}
}

public zp_round_ended(winteam)
{
	for(new id=1;id<=g_Players;id++)
	g_trime[id] = true;
}

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

	replace_all(msg, 190, "!g", "^4") // Green Color
	replace_all(msg, 190, "!y", "^1") // Default Color
	replace_all(msg, 190, "!t", "^3") // Team Color

	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, SayText, _, players)
				write_byte(players);
				write_string(msg);
				message_end();
			}
		}
	}
}
Image
Image
eXtreamSHOP
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2440
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 36 times
Been thanked: 372 times
Contact:

06 Jul 2014, 22:11

Pai le ai deja ;))

Code: Select all

register_clcmd("zp_levelexp","expa_give", ADMIN_CVAR, "use to give Exp")
register_clcmd("zp_level_is","level_give", ADMIN_CVAR, "use to give Level")
Nu fac nimic contra cost! Faceți cerere bine detaliată aici, pe forum. Nu-mi mai dați add pe Steam doar pentru a mă avea în lista de prieteni.
Am cont și activez doar aici! Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz.
În cazul în care utilizați ceva din addonsurile postate de mine aici, e bine să fiți la curent cu modificările aduse unor plugine, aici.
Ki||eR
Membru, skill 0
Membru, skill 0
Posts: 76
Joined: 22 May 2013, 09:51
Detinator Steam: Nu
CS Status: Ce-i ala status ?
Detinator server CS: Furien2.*** Reclama ***.Ro
Has thanked: 7 times
Been thanked: 1 time
Contact:

06 Jul 2014, 22:20

Sunt degeaba ca nu merg.
Image
Image
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests