[Cerere] Plugin XP Respawn CSDM:

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 .
User avatar
LittleBrawler
Membru, skill 0
Membru, skill 0
Posts: 35
Joined: 26 Jun 2014, 17:32
Detinator Steam: Nu
CS Status: Connect FurienZ.Mevid.Ro
Detinator server CS: FurienZ.Mevid.Ro
SteamID: miezu_sam
Fond eXtream: 0
Location: Bucuresti - Craiova
Has thanked: 2 times
Been thanked: 2 times
Contact:

12 Jul 2014, 12:59

UP!!!
Image
Image
RoyalServer 2
User avatar
LittleBrawler
Membru, skill 0
Membru, skill 0
Posts: 35
Joined: 26 Jun 2014, 17:32
Detinator Steam: Nu
CS Status: Connect FurienZ.Mevid.Ro
Detinator server CS: FurienZ.Mevid.Ro
SteamID: miezu_sam
Fond eXtream: 0
Location: Bucuresti - Craiova
Has thanked: 2 times
Been thanked: 2 times
Contact:

15 Jul 2014, 15:45

UP!!!!!!!
Image
Image
User avatar
WISHEXEC
Membru, skill +4
Membru, skill +4
Posts: 1683
Joined: 12 Nov 2011, 19:37
Detinator Steam: Da
CS Status: AmxModX
Detinator server CS: DAEVA.RO
Reputatie: Fost Moderator ajutator
Nume anterior : ONEMDX
Location: România
Has thanked: 84 times
Been thanked: 85 times
Contact:

15 Jul 2014, 16:44

UP pentru tine , o sa se faca coada si aici sa te ajute
Cosmin
Fost moderator
Fost moderator
Posts: 9362
Joined: 06 Jul 2013, 22:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 547 times

15 Jul 2014, 18:03

ONEMDX wrote:UP pentru tine , o sa se faca coada si aici sa te ajute
I-am trimis eu pm cu un plugin facut de mine dar lui nu ii merge ori si cum,mie imi merge perfect dar la el nu ii merge bine,probabil de la host..
User avatar
cyby
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 1777
Joined: 16 Jul 2011, 21:46
Detinator Steam: Da
Detinator server CS: Da
Reputatie: Scripter eXtreamCS
Fost Moderator ajutator
Has thanked: 146 times
Been thanked: 396 times

15 Jul 2014, 18:53

Nu e ceea ce ai vrut dar iti poate fi tie sau altora benefic, e un script vechi de-al meu si frumos. Trebuie instalate ambele, nu necesita resurse. E un sistem de puncte care iti poti cumpara puteri permanente sau pentru o runda[inca nu sunt pentru o runda] si ele sunt afisate in HUD.
Puterile sunt:
NoRecoil [50%]
HP MAX 1000 [cand faci un kill primesti pana la 1000 daca ai acest item permanent, daca nu pana la 250]
Double jump
Refill ammo on kill [primesti toate gloantele pe kill]
Speed 280 [viteza]
Invizbilitate la cutit
Damage +10
Toate astea sunt permanente
| Afiseaza codul
#include <amxmodx>
#include <fun>
#include <nvault>

#define MAX_HP 250
#define MAX_AP 250
#define HP_KILL 10
#define HP_HS_KILL 20
#define AP_KILL 5
#define AP_HS_KILL 10
#define HS_POINTS 4
#define KILL_POINTS 2

native cyby_get_pw_hp(id)

new save_data, event_sync;
new points[33], kills[33];
new bool:event_double, g_msg_saytext;

public plugin_init()
{
	register_plugin("HP + POINTS", "1.0", "cyby")
	
	register_event("DeathMsg", "moarte", "a")
	event_sync = CreateHudSyncObj()
	check_time()
	set_task(1.0, "check_time", _, _, _, "b")
	g_msg_saytext = get_user_msgid("SayText")
}

public plugin_cfg()
{
	save_data = nvault_open("puncte")
	
	if(save_data == INVALID_HANDLE)
        set_fail_state("Eroare la deschiderea bazei de date.")
}

public plugin_end()
	nvault_close(save_data)
	
public check_time()
{
	static o;
	time(o, _, _)
	if(o >= 00 || o <= 08)
		event_double = true
	else
		event_double = false
}

public client_putinserver(id)
{
	points[id] = 0
	kills[id] = 0
	set_task(0.1, "get_data", id)
	set_task(1.0, "hud_show", id, _, _, "b")
}

public client_disconnect(id)
	remove_task(id)

public moarte()
{
	new attacker, victim, hs;
	attacker = read_data(1)
	victim = read_data(2)
	hs = read_data(3)
	
	if(victim == attacker || !is_user_connected(victim) || !is_user_connected(attacker) || get_user_team(attacker) == get_user_team(victim))
		return
	
	new name[32];
	get_user_name(victim, name, charsmax(name) - 1)
	if(hs)
	{
		if(cyby_get_pw_hp(attacker))
		{
			if(get_user_health(attacker) + HP_HS_KILL <= 1000)
				set_user_health(attacker, get_user_health(attacker) + HP_HS_KILL)
			else
				set_user_health(attacker, 1000)
				
			if(get_user_armor(attacker) + AP_HS_KILL <= MAX_AP)
				set_user_armor(attacker, get_user_armor(attacker) + AP_HS_KILL)
			else
				set_user_armor(attacker, MAX_AP)
		}
		else
		{
			if(get_user_health(attacker) + HP_HS_KILL <= MAX_HP)
				set_user_health(attacker, get_user_health(attacker) + HP_HS_KILL)
			else
				set_user_health(attacker, MAX_HP)
				
			if(get_user_armor(attacker) + AP_HS_KILL <= MAX_AP)
				set_user_armor(attacker, get_user_armor(attacker) + AP_HS_KILL)
			else
				set_user_armor(attacker, MAX_AP)
		}
		if(event_double)
			points[attacker] += HS_POINTS * 2
		else
			points[attacker] += HS_POINTS
		set_data(attacker)
		return
	}
	if(cyby_get_pw_hp(attacker))
	{
		if(get_user_health(attacker) + HP_KILL <= 1000)
			set_user_health(attacker, get_user_health(attacker) + HP_KILL)
		else
			set_user_health(attacker, 1000)
			
		if(get_user_armor(attacker) + AP_KILL <= MAX_AP)
			set_user_armor(attacker, get_user_armor(attacker) + AP_KILL)
		else
			set_user_armor(attacker, MAX_AP)
	}
	else
	{
		if(get_user_health(attacker) + HP_KILL <= MAX_HP)
			set_user_health(attacker, get_user_health(attacker) + HP_KILL)
		else
			set_user_health(attacker, MAX_HP)
			
		if(get_user_armor(attacker) + AP_KILL <= MAX_AP)
			set_user_armor(attacker, get_user_armor(attacker) + AP_KILL)
		else
			set_user_armor(attacker, MAX_AP)
	}
	if(event_double)
		points[attacker] += KILL_POINTS * 2
	else
		points[attacker] += KILL_POINTS
		
	kills[attacker]++
	if(kills[attacker] > 499)
	{
		kills[attacker] = 0
		points[attacker] += 250
		new Players[32], name[32];
		new playerCount, i, player
		get_players(Players, playerCount, "c")
		for(i = 0; i < playerCount; i++)
		{
			player = Players
			kills[player] = 0
		}
		get_user_name(attacker, name, charsmax(name) - 1)
		color(0, ".vWell done!.e %s.v killed 500 and won 250 points.g.", name)
		color(0, ".vRestart round in 3 seconds.")
		set_task(3.0, "restart_server")
	}
	set_data(attacker)
}

public restart_server()
	server_cmd("sv_restart 1")

public hud_show(id)
{
	if(!is_user_connected(id))
		return
	
	set_hudmessage(0, 100, 200, 0.0, 0.17, 1, 1.1, 1.0)
	if(is_user_alive(id))
	{
		static mesaj[32];
		if(event_double)
			formatex(mesaj, charsmax(mesaj) - 1, "EVENT: Double points")
		ShowSyncHudMsg(id, event_sync, "Points: %i^n%s", points[id], mesaj)
	}
}

public set_data(id)
{
	new name[32];
	get_user_name(id, name, charsmax(name) - 1)

	new cheiasalvarii[64], datelesalvarii[256]
	format(cheiasalvarii, 63, "%s_POINTS", name)
	format(datelesalvarii ,255, "%i#", points[id])
	nvault_set(save_data, cheiasalvarii, datelesalvarii)
}

public get_data(id)
{
	new name[32];
	get_user_name(id, name, charsmax(name) - 1)
	new cheiasalvarii[64], datelesalvarii[256];
	format(cheiasalvarii, 63, "%s_POINTS", name)
	format(datelesalvarii, 255, "%i#", points[id])
	nvault_get(save_data, cheiasalvarii, datelesalvarii, 255)
	replace_all(datelesalvarii, 255, "#", " ")
	new puncte[32];
	parse(datelesalvarii, puncte, 31)
	points[id] = str_to_num(puncte)
}

public plugin_natives()
{
	register_native("get_points", "native_get_points", 1)
	register_native("set_points", "native_set_points", 1)
}

public native_get_points(id)
	return points[id];

public native_set_points(id, value)
	points[id] = value

stock 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, g_msg_saytext, _, players)
				write_byte(players)
				write_string(msg)
				message_end()
			}
		}
	}
}

| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <csdm>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <nvault>
#include <xs>

native get_points(id)
native set_points(id, value)

new g_iMaxPlayers
#define IsPlayer(%0) (1 <= %0 <= g_iMaxPlayers)

#define TASTESHOP (1<<0)|(1<<1)
new const TAG[] = "[Respawn Skills]";
new const owner_name[] = "nume detinator";

// Puteri
new g_permanent_1[33], g_permanent_2[33], g_permanent_3[33], g_permanent_4[33], g_permanent_5[33], g_permanent_6[33], g_permanent_7[33], g_status_sync;

// Spatele puterilor
// No Recoil
new const NONWPN_BITSUM = ((1<<2)|(1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW_C4))
new Float:pl_clpushangle[33][3], pl_wpnnames[32];

// Refill ammo on kill
new const g_weapons[] =
{
	CSW_P228,
	CSW_SCOUT,
	CSW_XM1014,
	CSW_MAC10,
	CSW_AUG,
	CSW_ELITE,
	CSW_FIVESEVEN,
	CSW_UMP45,
	CSW_SG550,
	CSW_GALI,
	CSW_GALIL,
	CSW_FAMAS,
	CSW_USP,
	CSW_GLOCK18,
	CSW_AWP,
	CSW_MP5NAVY,
	CSW_M249,
	CSW_M3,
	CSW_M4A1,
	CSW_TMP,
	CSW_G3SG1,
	CSW_DEAGLE,
	CSW_SG552,
	CSW_AK47,
	CSW_P90
}

new const g_max_clip[] =
{
	13,
	10,
	7,
	30,
	30,
	30,
	20,
	25,
	30,
	35,
	35,
	25,
	12,
	20,
	10,
	30,
	100,
	8,
	30,
	30,
	20,
	7,
	30,
	30,
	50
}

new const g_other_weapons[] =
{
	CSW_KNIFE,
	CSW_HEGRENADE,
	CSW_C4
}

// Multi Jump
new jumpnum[33] = 0
new bool:dojump[33] = false

// nVault
new save_data, g_msg_saytext;

public plugin_init()
{
	register_plugin("Buy Powers", "1.0", "cyby")
	
	register_clcmd("chooseteam", "buy_menu")
	
	new iWpn;
	for(iWpn = 1; iWpn <= CSW_P90; iWpn++)
	{
		if(!(NONWPN_BITSUM & (1 << iWpn)) && get_weaponname(iWpn, pl_wpnnames, charsmax(pl_wpnnames)))
		{
			RegisterHam(Ham_Weapon_PrimaryAttack, pl_wpnnames, "primary_attack")
			RegisterHam(Ham_Weapon_PrimaryAttack, pl_wpnnames, "primary_attack_post",1) 
		}
	}
	RegisterHam(Ham_TakeDamage, "player", "take_damage")
	register_event("CurWeapon", "events_lot", "be", "1=1")
	register_clcmd("give_points", "give_points")
	
	g_status_sync = CreateHudSyncObj()
	g_iMaxPlayers = get_maxplayers()
	g_msg_saytext = get_user_msgid("SayText")
}

public plugin_cfg()
{
	save_data = nvault_open("puteri")
	
	if(save_data == INVALID_HANDLE)
        set_fail_state("Eroare la deschiderea bazei de date.")
}

public plugin_end()
	nvault_close(save_data)

public buy_menu(id) 
{
	if(is_user_alive(id))
	{
		new menu = menu_create("\yPermanent Powers\w" , "butoane_shop")
		menu_additem(menu, "Permanent", "")
		menu_additem(menu, "Items", "")
		menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
		menu_display(id, menu, 0)
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE
}

public give_points(id)
{
	new arg[32], name[32];
	read_argv(1, arg, 31)
	get_user_name(id, name, charsmax(name) - 1)
	if(!equali(name, owner_name))
		return PLUGIN_HANDLED
	new jucator = cmd_target(id, arg, 31)
	
	if(!jucator)
		return PLUGIN_HANDLED
	
	if(!is_user_connected(jucator))
		return PLUGIN_HANDLED
	
	new cant[7], name2[32];
	
	get_user_name(jucator, name2, 31)
	read_argv(2, cant, 6)
	
	new XP_plus = str_to_num(cant)

	set_points(jucator, get_points(jucator) + XP_plus)
	color(0, ".v%s.g Owner.e %s.g give.e %d.g points to.e %s.g.", TAG, name, XP_plus, name2)
	return PLUGIN_HANDLED;
}

public butoane_shop(id, menu, key) 
{
	if(!is_user_alive(id))
		return PLUGIN_HANDLED;
	
	switch(key) 
	{
		case 0: show_permanent(id)
		case 1: show_extra(id)
	}
	return PLUGIN_CONTINUE;
}

public show_permanent(id) 
{
	if(!is_user_alive(id))
		return PLUGIN_HANDLED;

	new menu = menu_create("\yPermanent Powers\w" , "permanent_handle")
	menu_additem(menu, "NoRecoil--\y 16000 Points\w", "1", 0)
	menu_additem(menu, "HP Max 1000\y 14000 Points\w", "2", 0)
	menu_additem(menu, "Double Jump\y 20000 Points\w", "3", 0)
	menu_additem(menu, "Refill Ammo on Kill\y 24000 Points\w", "4", 0)
	menu_additem(menu, "MoveSpeed 280\y 15000 Points\w", "5", 0)
	menu_additem(menu, "Invisibility on Knife\y 22000 Points\w", "6", 0)
	menu_additem(menu, "Damage +10\y 28000 Points\w", "7", 0)
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
	menu_display(id, menu, 0)
	return PLUGIN_CONTINUE; 
}

public permanent_handle(id, menu, item)
{
	if(!is_user_alive(id))
		return PLUGIN_HANDLED;
	
	switch(item)
	{
		case 0:
		{
			if(g_permanent_1[id])
			{
				color(id, ".v%s.g Already have.e NoRecoil--.g.", TAG)
				return PLUGIN_HANDLED;
			}
			
			if(get_points(id) < 8000)
			{
				color(id, ".v%s.g You do not have enough points. You need another:.e %d.g points.", TAG, 8000 - get_points(id))
				return PLUGIN_HANDLED;
			}
			
			set_points(id, get_points(id) - 8000)
			g_permanent_1[id] = 1
			color(id, ".v%s.g You bought.e NoRecoil--.g permanently, remaining points:.e %d.g.", TAG, get_points(id))
			set_data(id)
		}
		case 1:
		{
			if(g_permanent_2[id])
			{
				color(id, ".v%s.g Already have.e HP Max 1000.g.", TAG)
				return PLUGIN_HANDLED;
			}
			
			if(get_points(id) < 7000)
			{
				color(id, ".v%s.g You do not have enough points. You need another:.e %d.g points.", TAG, 7000 - get_points(id))
				return PLUGIN_HANDLED;
			}
			
			set_points(id, get_points(id) - 7000)
			g_permanent_2[id] = 1
			color(id, ".v%s.g You bought.e Hp Max 1000.g permanently, remaining points:.e %d.g.", TAG, get_points(id))
			set_data(id)
		}
		case 2:
		{
			if(g_permanent_3[id])
			{
				color(id, ".v%s.g Already have.e Double Jump.g.", TAG)
				return PLUGIN_HANDLED;
			}
			
			if(get_points(id) < 10000)
			{
				color(id, ".v%s.g You do not have enough points. You need another:.e %d.g points.", TAG, 10000 - get_points(id))
				return PLUGIN_HANDLED;
			}
			
			set_points(id, get_points(id) - 10000)
			g_permanent_3[id] = 1
			color(id, ".v%s.g You bought.e Double Jump.g permanently, remaining points:.e %d.g.", TAG, get_points(id))
			set_data(id)
		}
		case 3:
		{
			if(g_permanent_4[id])
			{
				color(id, ".v%s.g Already have.e Refill Ammo on Kill.g.", TAG)
				return PLUGIN_HANDLED;
			}
			
			if(get_points(id) < 12000)
			{
				color(id, ".v%s.g You do not have enough points. You need another:.e %d.g points.", TAG, 12000 - get_points(id))
				return PLUGIN_HANDLED;
			}
			
			set_points(id, get_points(id) - 12000)
			g_permanent_4[id] = 1
			color(id, ".v%s.g You bought.e Refill Ammo on Kill.g permanently, remaining points:.e %d.g.", TAG, get_points(id))
			set_data(id)
		}
		case 4:
		{
			if(g_permanent_5[id])
			{
				color(id, ".v%s.g Already have.e MoveSpeed 280.g.", TAG)
				return PLUGIN_HANDLED;
			}
			
			if(get_points(id) < 7500)
			{
				color(id, ".v%s.g You do not have enough points. You need another:.e %d.g points.", TAG, 7500 - get_points(id))
				return PLUGIN_HANDLED;
			}
			
			set_points(id, get_points(id) - 7500)
			g_permanent_5[id] = 1
			color(id, ".v%s.g You bought.e MoveSpeed 280.g permanently, remaining points:.e %d.g.", TAG, get_points(id))
			set_data(id)
		}
		case 5:
		{
			if(g_permanent_6[id])
			{
				color(id, ".v%s.g Already have.e Invisibility on Knife.g.", TAG)
				return PLUGIN_HANDLED;
			}
			
			if(get_points(id) < 11000)
			{
				color(id, ".v%s.g You do not have enough points. You need another:.e %d.g points.", TAG, 11000 - get_points(id))
				return PLUGIN_HANDLED;
			}
			
			set_points(id, get_points(id) - 11000)
			g_permanent_6[id] = 1
			color(id, ".v%s.g You bought.e Invisibility on Knife.g permanently, remaining points:.e %d.g.", TAG, get_points(id))
			set_data(id)
		}
		case 6:
		{
			if(g_permanent_7[id])
			{
				color(id, ".v%s.g Already have.e Damage +10.g.", TAG)
				return PLUGIN_HANDLED;
			}
			
			if(get_points(id) < 14000)
			{
				color(id, ".v%s.g You do not have enough points. You need another:.e %d.g puncte.", TAG, 14000 - get_points(id))
				return PLUGIN_HANDLED;
			}
			
			set_points(id, get_points(id) - 14000)
			g_permanent_7[id] = 1
			color(id, ".v%s.g You bought.e Damage +10.g permanently, remaining points:.e %d.g.", TAG, get_points(id))
			set_data(id)
		}
		case MENU_EXIT:
		{
		}
	}
	menu_destroy(menu)
	return PLUGIN_HANDLED;
}

public client_putinserver(id)
{
	jumpnum[id] = 0
	dojump[id] = false
	get_data(id)
	set_task(1.0, "show_hud", id, _, _, "b")
}

public client_disconnect(id)
{
	jumpnum[id] = 0
	dojump[id] = false
	set_data(id)
	remove_task(id)
	g_permanent_7[id] = 0
	g_permanent_6[id] = 0
	g_permanent_5[id] = 0
	g_permanent_4[id] = 0
	g_permanent_3[id] = 0
	g_permanent_2[id] = 0
	g_permanent_1[id] = 0
}

public show_hud(id)
{
	if(!is_user_connected(id))
	{
		remove_task(id)
		return
	}
	
	static menu[1104], len;
	len = 0
	if(g_permanent_1[id])
		len += formatex(menu[len], charsmax(menu) - len, "NoRecoil--^n")
	if(g_permanent_2[id])
		len += formatex(menu[len], charsmax(menu) - len, "HP Max 1000^n")
	if(g_permanent_3[id])
		len += formatex(menu[len], charsmax(menu) - len, "Double Jump^n")
	if(g_permanent_4[id])
		len += formatex(menu[len], charsmax(menu) - len, "Refill Ammo on Kill^n")
	if(g_permanent_5[id])
		len += formatex(menu[len], charsmax(menu) - len, "MoveSpeed 280^n")
	if(g_permanent_6[id])
		len += formatex(menu[len], charsmax(menu) - len, "Invisibility on Knife^n")
	if(g_permanent_7[id])
		len += formatex(menu[len], charsmax(menu) - len, "Damage +10^n")
		
	set_hudmessage(255, 127, 0, 0.0, 0.26, 0, 1.1, 1.0)
	ShowSyncHudMsg(id, g_status_sync, menu)
}

public set_data(id)
{
	new name[32];
	get_user_name(id, name, charsmax(name) - 1)

	new cheiasalvarii[64], datelesalvarii[256]
	format(cheiasalvarii, 63, "%s_POINTS", name)
	format(datelesalvarii ,255, "%i#%i#%i#%i#%i#%i#%i#", g_permanent_1[id], g_permanent_2[id], g_permanent_3[id], g_permanent_4[id], g_permanent_5[id], g_permanent_6[id], g_permanent_7[id])
	nvault_set(save_data, cheiasalvarii, datelesalvarii)
}

public get_data(id)
{
	new name[32];
	get_user_name(id, name, charsmax(name) - 1)
	new cheiasalvarii[64], datelesalvarii[256];
	format(cheiasalvarii, 63, "%s_POINTS", name)
	format(datelesalvarii, 255, "%i#%i#%i#%i#%i#%i#%i#", g_permanent_1[id], g_permanent_2[id], g_permanent_3[id], g_permanent_4[id], g_permanent_5[id], g_permanent_6[id], g_permanent_7[id])
	nvault_get(save_data, cheiasalvarii, datelesalvarii, 255)
	replace_all(datelesalvarii, 255, "#", " ")
	new putere_1[4], putere_2[4], putere_3[4], putere_4[4], putere_5[4], putere_6[4], putere_7[4];
	parse(datelesalvarii, putere_1, 3, putere_2, 3, putere_3, 3, putere_4, 3, putere_5, 3, putere_6, 3, putere_7, 3)
	g_permanent_1[id] = str_to_num(putere_1)
	g_permanent_2[id] = str_to_num(putere_2)
	g_permanent_3[id] = str_to_num(putere_3)
	g_permanent_4[id] = str_to_num(putere_4)
	g_permanent_5[id] = str_to_num(putere_5)
	g_permanent_6[id] = str_to_num(putere_6)
	g_permanent_7[id] = str_to_num(putere_7)
}

public show_extra(id)
{
	if(!is_user_alive(id))
		return PLUGIN_HANDLED;
	color(id, ".v%s.g Currently working on this part.", TAG)
	return PLUGIN_CONTINUE;
}

public primary_attack(ent)
{
	new iPlayer = pev(ent,pev_owner)
	pev(iPlayer, pev_punchangle, pl_clpushangle[iPlayer])
	return HAM_IGNORED
}

public primary_attack_post(ent)
{
	new iPlayer = pev(ent, pev_owner)
	if(g_permanent_1[iPlayer])
	{
		new Float:recoil = 0.5
		new Float:push[3]
		pev(iPlayer, pev_punchangle, push)
		xs_vec_sub(push, pl_clpushangle[iPlayer], push)
		xs_vec_mul_scalar(push, recoil, push)
		xs_vec_add(push, pl_clpushangle[iPlayer], push)
		set_pev(iPlayer, pev_punchangle, push)
	}
	return HAM_IGNORED
}

public take_damage(iVictim, iInflictor, iAttacker, Float:iDamage, iDamage_Type)
{
	if(iVictim == iAttacker || !is_user_connected(iAttacker))
		return HAM_IGNORED;
		
	if(IsPlayer(iAttacker) && g_permanent_7[iAttacker])
	{	
		SetHamParamFloat(4, iDamage + 10.0)
	}
	return HAM_IGNORED;
}

public events_lot(id)
{
	if(get_user_weapon(id) == CSW_KNIFE && g_permanent_6[id])
		fm_set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 75)
	else
		fm_set_user_rendering(id)
		
	if(g_permanent_5[id])
		set_pev(id, pev_maxspeed, 280.0)
}

public client_death(killer, victim, wpnindex, hitplace, TK)
{
	if(!csdm_get_ffa() && TK)
		return
		
	if(!is_user_alive(killer))
		return
	
	if(!g_permanent_4[killer])
		return

	for(new a = 0; a < sizeof (g_other_weapons); a++)
		if (wpnindex == g_other_weapons[a])
			return
	
	new weapon = fm_get_weapon_ent(killer, wpnindex)

	for(new a = 0; a < sizeof (g_weapons); a++)
		if(wpnindex == g_weapons[a])
		{
			new ammo = get_weapon_maxclip(wpnindex)

			if(ammo)
			{
				client_cmd(killer, "spk ^"items/9mmclip1.wav^"")
				cs_set_weapon_ammo(weapon, ammo)
			}
			return
		}
}

public client_PreThink(id)
{
	if(!is_user_alive(id)) return PLUGIN_CONTINUE
	if(!g_permanent_3[id]) return PLUGIN_CONTINUE
	new nbut = get_user_button(id)
	new obut = get_user_oldbutton(id)
	if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
	{
		if(jumpnum[id] < 2)
		{
			dojump[id] = true
			jumpnum[id]++
			return PLUGIN_CONTINUE
		}
	}
	if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
	{
		jumpnum[id] = 0
		return PLUGIN_CONTINUE
	}
	return PLUGIN_CONTINUE
}

public client_PostThink(id)
{
	if(!is_user_alive(id)) return PLUGIN_CONTINUE
	if(!g_permanent_3[id]) return PLUGIN_CONTINUE
	if(dojump[id] == true)
	{
		new Float:velocity[3]	
		entity_get_vector(id,EV_VEC_velocity,velocity)
		velocity[2] = random_float(265.0,285.0)
		entity_set_vector(id,EV_VEC_velocity,velocity)
		dojump[id] = false
		return PLUGIN_CONTINUE
	}
	return PLUGIN_CONTINUE
}

public plugin_natives()
{
	register_native("cyby_get_pw_hp", "native_get_hp", 1)
}

public native_get_hp(id)
{
	return g_permanent_2[id]
}

get_weapon_maxclip(wpnid = 0)
{
	for(new a = 0; a < sizeof (g_weapons); a++)
		if(wpnid == g_weapons[a])
			return g_max_clip[a]

	return false
}

fm_get_weapon_ent(id, wpnid = 0)
{
	new name[32]

	if(wpnid)
		get_weaponname(wpnid, name, 31)

	if(!equal(name, "weapon_", 7))
		format(name, sizeof (name) - 1, "weapon_%s", name)

	return fm_find_ent_by_owner(get_maxplayers(), name, id)
}

fm_find_ent_by_owner(id, const classname[], owner, jghgtype = 0)
{
	new strtype[16] = "classname"
	new ent = id

	switch(jghgtype)
	{
		case 1: strtype = "target"
		case 2: strtype = "targetname"
	}

	while ((ent = engfunc(EngFunc_FindEntityByString, ent, strtype, classname)) && pev(ent, pev_owner) != owner)
	{
	}
	return ent
}

fm_set_user_rendering(index, fx=kRenderFxNone, r=255, g=255, b=255, render=kRenderNormal, amount=16)
{
	set_pev(index, pev_renderfx, fx)
	new Float:RenderColor[3]
	RenderColor[0] = float(r)
	RenderColor[1] = float(g)
	RenderColor[2] = float(b)
	set_pev(index, pev_rendercolor, RenderColor)
	set_pev(index, pev_rendermode, render)
	set_pev(index, pev_renderamt, float(amount))
	return 1;
}

stock 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, g_msg_saytext, _, players)
				write_byte(players);
				write_string(msg);
				message_end();
			}
		}
	}
}
93.114.82.17:27015 - Monster Invasion CO-OP Mod
User avatar
LittleBrawler
Membru, skill 0
Membru, skill 0
Posts: 35
Joined: 26 Jun 2014, 17:32
Detinator Steam: Nu
CS Status: Connect FurienZ.Mevid.Ro
Detinator server CS: FurienZ.Mevid.Ro
SteamID: miezu_sam
Fond eXtream: 0
Location: Bucuresti - Craiova
Has thanked: 2 times
Been thanked: 2 times
Contact:

23 Jul 2014, 17:16

Da-ti TC, am cumparat un addon de la ONEMDX.
Image
Image
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 31 guests