eroare compilare

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
Doctor whO? <3
Membru, skill +3
Membru, skill +3
Posts: 1196
Joined: 21 Jun 2013, 12:40
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Reputatie: Fost Membru Club eXtreamCS (doua luni)
Has thanked: 109 times
Been thanked: 75 times
Contact:

21 Jul 2019, 12:58

Salut, incerc sa compilez acest plugin si primesc urmatoarea eroare : zp_ExtraHuman.sma(12) : error 021: symbol already defined: "zp_override_user_model"
zp_ExtraHuman.sma(121) : warning 217: loose indentation

sursa :

Code: Select all

// zp_ExtraHuman
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <engine>
#include <fakemeta_util>
#include <dhudmessage>
#include <zombieplague>

native zp_override_user_model(id, const model[])
	
#define ID_AURA 	(taskid - TASK_AURA)
#define TASK_AURA	2500

#define ID_SKILL	(taskid - TASK_SKILL)
#define TASK_SKILL	3499

#define SPAWN_TASK	9965

#define DHUD							// Dhud ????????? ? ????????? ?????
#define EXTRAHUMANCOUNT			4		// ??????? ???????? ????? ????? ? ??????
#define EXTRAHUMANHEALTH		300		// ??????? ???????? ????? ? ?????
#define EXTRAHUMANARMOR			250		// ??????? ????? ????? ? ?????
#define EXTRAHUMANDAMAGE		1.0		// ????????? ???????? ???? ? ?????

#define SPAWNTIME				20.0	// ????? ??????? ?????? ???????? ?????
#define WIN_KILLED				100		// ??????? ???? ?????? ????, ??? ???? ?????
#define SPAWNCHANSE				100.0	// ???? ( ? % ), ?? ??????? ??????, ???????? ????? ? ?????? ( ?????????, ????? ??????? ??????? ??? ?????? ) 
// ??? ?????????? ?????, ???? ???????????, ??? ????? ? ?????? ?? ?????.

#define KILLCOUNT				1		// ??????? ????? ???? ?????, ????? ???????? ?????

#define BONUS_AMMO_GIFT		5		// ??????? ????????????? ?????? ???? ?? ???????? ????? ?? ????? AMMO_GIFT
#define BONUS_SUPER_DAMAGE	1.5		// ????????? ???????? ???? ?? ????? SUPER_DAMAGE
#define BONUS_BONUS_AMMO	100		// ??????? ?????? ???? ?? ????? BONUS_AMMO
#define BONUS_MEGA_SKILL	3.0		// ????? ??????? ?? ????? ??????? ????????? ?? ????? MEGA_SKILL
#define BONUS_MEGA_DAMAGE	300		// ?? ??????? ????? ?????? ????????????? ???? ?? ????? MEGA_DAMAGE
#define BONUS_MEGA_DAMAGE_AMMO_GIVE	1	// ??????? ?????? ???? ?? BONUS_MEGA_DAMAGE
enum BONUS
{
NONE = 0, // ??? ???????????
AMMO_GIFT, // + ? ???? ?? ????????
SUPER_DAMAGE, // ?????????? ????
BONUS_AMMO, // ?????? ??????? ? ???? ????
MEGA_SKILL, // ????????? ??????????? ( 
MEGA_DAMAGE // ????????? ??????????????? ???? ?? ???? 
}
//native GetWeapon(index);

new bool:g_ExtraHuman[33], bool:g_NonExtraHuman[33], g_KillCount[33], g_PlayerBonus[33], g_PlayerDamage[33]
new g_ExtraHumanCount, Sprite

new const HeroSprite[] = "HeroSprite"
new const g_HeroModel[] = "extrahuman" 
new const g_HeroSprite[] = "sprites/zombie_plague/hero_sprite.spr"

public plugin_init()
{
register_plugin("[ZP]Extra-Human", "1.0", "Dambas");

register_event("HLTV", "RoundStart", "a", "1=0", "2=0");
register_logevent("RoundEnd", 2, "1=Round_End")

register_clcmd("drop", "clcmd_drop")

RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1);
RegisterHam(Ham_Killed, "player", "fw_PlayerKilled");
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")

RegisterHam(Ham_Touch, "weaponbox", "fw_TouchWeapon")
RegisterHam(Ham_Touch, "armoury_entity", "fw_TouchWeapon")
RegisterHam(Ham_Touch, "weapon_shield", "fw_TouchWeapon")

register_think(HeroSprite, "Think_Sprite")
}

public plugin_natives()
{
register_native("zp_get_extra_human", "native_zp_get_extra_human", 1)
}

public native_zp_get_extra_human(id)
{
return g_ExtraHuman[id];
}

public plugin_precache()
{
new szModel[64]
formatex(szModel, charsmax(szModel), "models/player/%s/%s.mdl", g_HeroModel, g_HeroModel)
engfunc(EngFunc_PrecacheModel, szModel)

precache_model(g_HeroSprite)
}

public RoundStart()
{
g_ExtraHumanCount = 0;

for( new k = 0; k < 33; k++)
{
	g_PlayerBonus[k] = 0;
	g_KillCount[k] = 0;
	g_ExtraHuman[k] = false;
	g_NonExtraHuman[k] = false;
}
}

public RoundEnd()
{
remove_task(SPAWN_TASK)
}

public clcmd_drop(iPlayer)
{
if (g_ExtraHuman[iPlayer])
	return PLUGIN_HANDLED;
	
	return PLUGIN_CONTINUE;
}

public fw_TouchWeapon(weapon, iPlayer)
{
	if(!is_user_connected(iPlayer))
		return HAM_IGNORED;
	
	if(g_ExtraHuman[iPlayer])
		return HAM_SUPERCEDE;
	
	return HAM_IGNORED;
}

public fw_TakeDamage(iVictim, iInflictor, iAttacker, Float:Damage, DamageType)
{
	if(iVictim == iAttacker || !is_user_connected(iAttacker))
		return HAM_IGNORED;
	
	if(DamageType & 1<<24)
		return HAM_SUPERCEDE;
	
	if(zp_get_user_zombie(iAttacker) == zp_get_user_zombie(iVictim))
		return HAM_SUPERCEDE;
	
	if(g_ExtraHuman[iAttacker] && g_PlayerBonus[iAttacker] == 5)
	{
		g_PlayerDamage[iAttacker] += Damage
		if(g_PlayerDamage[iAttacker] >= BONUS_MEGA_DAMAGE)
		{
			zp_set_user_ammo_packs(iAttacker, zp_get_user_ammo_packs(iAttacker) + BONUS_MEGA_DAMAGE_AMMO_GIVE)
			g_PlayerDamage[iAttacker] = 0;
		}
	}
	
	if(g_ExtraHuman[iAttacker] && !zp_get_user_zombie(iAttacker))
	{
		Damage *= EXTRAHUMANDAMAGE;
		if(g_PlayerBonus[iAttacker] == 2)
			Damage *= BONUS_SUPER_DAMAGE;
		
		SetHamParamFloat(4, Damage)
	}
	
	return HAM_IGNORED;
}

public fw_PlayerKilled(iVictim, iAttacker, iShouldgib)
{
	if(!is_user_connected(iAttacker) && !is_user_connected(iVictim))
		return HAM_HANDLED;
	
	if(g_ExtraHuman[iAttacker] && zp_get_user_zombie(iVictim))
	{
		g_KillCount[iAttacker]++;
		
		if(g_PlayerBonus[iAttacker] == 1)
			zp_set_user_ammo_packs(iAttacker, zp_get_user_ammo_packs(iAttacker) + BONUS_AMMO_GIFT)
		
		if(g_KillCount[iAttacker] >= KILLCOUNT)
		{
			g_PlayerBonus[iAttacker] = random_num(1, 5)
			g_KillCount[iAttacker] = 0;
			if(g_PlayerBonus[iAttacker] == 1)
				ChatColor(iAttacker, "!g[ZP] !yYou got a bonus! Get more ammo for killing!")
			if(g_PlayerBonus[iAttacker] == 2)
				ChatColor(iAttacker, "!g[ZP] !yYou got a bonus! Increased damage!")
			if(g_PlayerBonus[iAttacker] == 3)
			{
				ChatColor(iAttacker, "!g[ZP] !yYou got a bonus, !g%d ammo!y!", BONUS_AMMO_GIFT)
				zp_set_user_ammo_packs(iAttacker, zp_get_user_ammo_packs(iAttacker) + BONUS_AMMO_GIFT)
			}
			if(g_PlayerBonus[iAttacker] == 4)
				ChatColor(iAttacker, "!g[ZP] !yYou got a bonus! You will become a man after infection!")
			if(g_PlayerBonus[iAttacker] == 5)
				ChatColor(iAttacker, "!g[ZP] !yYou got a bonus! You get more ammo from doing damage!")
		}
	}
	
	if(g_ExtraHuman[iVictim] && zp_get_user_zombie(iAttacker))
	{
		g_ExtraHuman[iVictim] = false;
		g_ExtraHumanCount--;
		fm_set_rendering(iVictim)
		remove_task(iVictim+TASK_AURA)
		zp_set_user_ammo_packs(iAttacker, zp_get_user_ammo_packs(iAttacker) + WIN_KILLED)
		ChatColor(iAttacker, "!g[ZP] !yYou killed the Hero, and got !g%d Ammo!", WIN_KILLED)
	}
	else
		return HAM_IGNORED;
	
	return PLUGIN_HANDLED;
}

public fw_PlayerSpawn_Post(iPlayer)
{
	if (!is_user_alive(iPlayer))
		return HAM_IGNORED;
	
	remove_task(iPlayer+TASK_AURA)
	return PLUGIN_HANDLED;
}

public zp_user_infected_pre(iPlayer, iInfector)
{
	if(is_user_alive(iPlayer) && is_user_connected(iPlayer))
	{
		if(g_ExtraHuman[iPlayer])
		{
			g_ExtraHuman[iPlayer] = false;
			g_NonExtraHuman[iPlayer] = false;
			g_ExtraHumanCount--;
			fm_set_rendering(iPlayer)
			remove_task(iPlayer+TASK_AURA)
			
			zp_set_user_ammo_packs(iInfector, zp_get_user_ammo_packs(iInfector) + WIN_KILLED)
			ChatColor(iInfector, "!g[ZP] !yYou killed the Hero, and got !g%d Ammo!", WIN_KILLED)
			
			if(g_PlayerBonus[iPlayer] == 4)
			{
				ChatColor(iPlayer,  "!g[ZP] !ySoon you will become !gHuman!y!")
				set_task(BONUS_MEGA_SKILL, "MegaSkill", iPlayer+TASK_SKILL)
			}
		}
	}
}

public MegaSkill(taskid)
{
	if(is_user_connected(ID_SKILL) && zp_get_user_zombie(ID_SKILL) && zp_get_human_count() >= 2)
	{
		zp_disinfect_user(ID_SKILL, 0)
		ChatColor(ID_SKILL, "!g[ZP] !yYou are !tHuman !yagain!")
	}
	else
		return;
}

public zp_round_started(gamemode, id)
{
	switch(gamemode)
	{
		case MODE_INFECTION:
		{
			set_task(SPAWNTIME, "SpawnHuman", SPAWN_TASK)
		}
		case MODE_MULTI:
		{
			set_task(SPAWNTIME, "SpawnHuman", SPAWN_TASK)
		}
	}
	return PLUGIN_HANDLED;
}

public SpawnHuman()
{
	if(g_ExtraHumanCount >= EXTRAHUMANCOUNT)
		return PLUGIN_HANDLED;
	
	static iPlayers[32], iNum, i, id, Float:iMakeHuman;
	get_players(iPlayers, iNum, "ah");
	
	for( i = 0; i < iNum; i++ )
	{
		id = iPlayers[i];
		iMakeHuman = random_float(0.0, (100.0 / SPAWNCHANSE));
		
		if(iMakeHuman <= 1.0 && !g_ExtraHuman[id] && !g_NonExtraHuman[id])	
		{
			g_ExtraHuman[id] = true;
			g_ExtraHumanCount++;
			MakeExtraHuman(id);
			break;
		}
	}
	
	return PLUGIN_HANDLED;
}

public MakeExtraHuman(iPlayer)
{
	if(!is_user_connected(iPlayer) && !is_user_alive(iPlayer))
	{
		g_NonExtraHuman[iPlayer] = true;
		g_ExtraHuman[iPlayer] = false;
		SpawnHuman()
		return PLUGIN_HANDLED;
	}
	
	if(g_ExtraHuman[iPlayer])
	{
		if(!zp_get_user_zombie(iPlayer))
		{
			new PlayerName[32];
			get_user_name(iPlayer, PlayerName, 31)
			#if defined DHUD
			set_dhudmessage(100, 0, 0, -1.0, 0.4, 0, 0.0, 3.0, 1.0, 1.0, false) 
			show_dhudmessage(0,"A hero arrived on the ground %s!", PlayerName)
			#else
			ChatColor(0, "!g[ZP] !yA !ghero !yarrived on the ground %s!", PlayerName)
			#endif
			ChatColor(iPlayer, "!g[ZP] You became !gHero!y! !yKill !g%d !yzombies to get a random bonus!", KILLCOUNT)
			fm_set_user_health(iPlayer, EXTRAHUMANHEALTH)
			fm_set_user_armor(iPlayer, EXTRAHUMANARMOR)
			zp_override_user_model(iPlayer, g_HeroModel)
			SetSprite(iPlayer)
			
			message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0, 0, 0}, iPlayer)
			write_short(1<<11)
			write_short(1<<11)
			write_short(0x0001)
			write_byte(255)
			write_byte(255)
			write_byte(255) 
			write_byte(110) 
			message_end()
			
			//SetWeapon(iPlayer)
			
			set_task(SPAWNTIME, "SpawnHuman", SPAWN_TASK)
			set_task(0.1, "HeroAura", iPlayer+TASK_AURA, _, _, "b")
		}
		else
		{
			g_ExtraHumanCount--;
			g_ExtraHuman[iPlayer] = false;
			g_NonExtraHuman[iPlayer] = true;
			SpawnHuman()
		}
	}
	else
		return PLUGIN_HANDLED;
	
	return PLUGIN_HANDLED;
}

/*public SetWeapon(iPlayer)
{
//native
}*/

public SetSprite(id)
{
if(g_ExtraHuman[id])
{
	Sprite = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"));
	static Origin[3];
	pev(id, pev_origin, Origin);
	Origin[2] += 60;
	engfunc(EngFunc_SetOrigin, Sprite, Origin);
	engfunc(EngFunc_SetModel, Sprite, g_HeroSprite);
	entity_set_float(Sprite, EV_FL_scale, 0.2);
	set_pev(Sprite, pev_classname, HeroSprite);
	set_pev(Sprite, pev_euser1, id);
	set_pev(Sprite, pev_solid, SOLID_NOT);
	set_pev(Sprite, pev_movetype, MOVETYPE_NOCLIP);
	set_pev(Sprite, pev_frame, 10.0);
	set_pev(Sprite, pev_nextthink, get_gametime()+0.1);
}
}

public Think_Sprite(Ent)
{
if(is_valid_ent(Ent))
{
	new id = pev(id, pev_euser1)
	static Float:Origin[3]
	pev(id, pev_origin, Origin)
	Origin[2] += 60;
	
	if(g_ExtraHuman[id])
	{
		engfunc(EngFunc_SetOrigin, Ent, Origin)
		set_pev(Ent, pev_nextthink, get_gametime() + 0.1)
	}
	else
	{
		engfunc(EngFunc_RemoveEntity, Ent)
		return PLUGIN_CONTINUE;
	}
}
return PLUGIN_CONTINUE;
}

public HeroAura(taskid)
{
if(!g_ExtraHuman[ID_AURA])
{
	remove_task(taskid)
	return;
}
static origin[3]
get_user_origin(ID_AURA, origin)

message_begin(MSG_PVS, SVC_TEMPENTITY, origin)
write_byte(TE_DLIGHT)
write_coord(origin[0])
write_coord(origin[1])
write_coord(origin[2])
write_byte(20)
write_byte(255) 
write_byte(255) 
write_byte(255) 
write_byte(2)
write_byte(0)
message_end()
}

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") 
replace_all(msg, 190, "!y", "^1") 
replace_all(msg, 190, "!r", "^3") 
replace_all(msg, 190, "!b", "^0")

if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
	if (is_user_connected(players[i]))
	{
		message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), {0,0,0}, players[i])
		write_byte(players[i])
		write_string(msg)
		message_end()
	}
}
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1033{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/
RoyalServer
User avatar
levin
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 3844
Joined: 24 Aug 2011, 12:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Discord: devilclass
Has thanked: 36 times
Been thanked: 594 times
Contact:

21 Jul 2019, 13:49

Code: Select all

#pragma tabsize 0

// zp_ExtraHuman
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <engine>
#include <fakemeta_util>
#include <dhudmessage>
#include <zombieplague>
	
#define ID_AURA 	(taskid - TASK_AURA)
#define TASK_AURA	2500

#define ID_SKILL	(taskid - TASK_SKILL)
#define TASK_SKILL	3499

#define SPAWN_TASK	9965

#define DHUD							// Dhud ????????? ? ????????? ?????
#define EXTRAHUMANCOUNT			4		// ??????? ???????? ????? ????? ? ??????
#define EXTRAHUMANHEALTH		300		// ??????? ???????? ????? ? ?????
#define EXTRAHUMANARMOR			250		// ??????? ????? ????? ? ?????
#define EXTRAHUMANDAMAGE		1.0		// ????????? ???????? ???? ? ?????

#define SPAWNTIME				20.0	// ????? ??????? ?????? ???????? ?????
#define WIN_KILLED				100		// ??????? ???? ?????? ????, ??? ???? ?????
#define SPAWNCHANSE				100.0	// ???? ( ? % ), ?? ??????? ??????, ???????? ????? ? ?????? ( ?????????, ????? ??????? ??????? ??? ?????? ) 
// ??? ?????????? ?????, ???? ???????????, ??? ????? ? ?????? ?? ?????.

#define KILLCOUNT				1		// ??????? ????? ???? ?????, ????? ???????? ?????

#define BONUS_AMMO_GIFT		5		// ??????? ????????????? ?????? ???? ?? ???????? ????? ?? ????? AMMO_GIFT
#define BONUS_SUPER_DAMAGE	1.5		// ????????? ???????? ???? ?? ????? SUPER_DAMAGE
#define BONUS_BONUS_AMMO	100		// ??????? ?????? ???? ?? ????? BONUS_AMMO
#define BONUS_MEGA_SKILL	3.0		// ????? ??????? ?? ????? ??????? ????????? ?? ????? MEGA_SKILL
#define BONUS_MEGA_DAMAGE	300		// ?? ??????? ????? ?????? ????????????? ???? ?? ????? MEGA_DAMAGE
#define BONUS_MEGA_DAMAGE_AMMO_GIVE	1	// ??????? ?????? ???? ?? BONUS_MEGA_DAMAGE
enum BONUS
{
NONE = 0, // ??? ???????????
AMMO_GIFT, // + ? ???? ?? ????????
SUPER_DAMAGE, // ?????????? ????
BONUS_AMMO, // ?????? ??????? ? ???? ????
MEGA_SKILL, // ????????? ??????????? ( 
MEGA_DAMAGE // ????????? ??????????????? ???? ?? ???? 
}
//native GetWeapon(index);

new bool:g_ExtraHuman[33], bool:g_NonExtraHuman[33], g_KillCount[33], g_PlayerBonus[33], g_PlayerDamage[33]
new g_ExtraHumanCount, Sprite

new const HeroSprite[] = "HeroSprite"
new const g_HeroModel[] = "extrahuman" 
new const g_HeroSprite[] = "sprites/zombie_plague/hero_sprite.spr"

public plugin_init()
{
register_plugin("[ZP]Extra-Human", "1.0", "Dambas");

register_event("HLTV", "RoundStart", "a", "1=0", "2=0");
register_logevent("RoundEnd", 2, "1=Round_End")

register_clcmd("drop", "clcmd_drop")

RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1);
RegisterHam(Ham_Killed, "player", "fw_PlayerKilled");
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")

RegisterHam(Ham_Touch, "weaponbox", "fw_TouchWeapon")
RegisterHam(Ham_Touch, "armoury_entity", "fw_TouchWeapon")
RegisterHam(Ham_Touch, "weapon_shield", "fw_TouchWeapon")

register_think(HeroSprite, "Think_Sprite")
}

public plugin_natives()
{
register_native("zp_get_extra_human", "native_zp_get_extra_human", 1)
}

public native_zp_get_extra_human(id)
{
return g_ExtraHuman[id];
}

public plugin_precache()
{
new szModel[64]
formatex(szModel, charsmax(szModel), "models/player/%s/%s.mdl", g_HeroModel, g_HeroModel)
engfunc(EngFunc_PrecacheModel, szModel)

precache_model(g_HeroSprite)
}

public RoundStart()
{
g_ExtraHumanCount = 0;

for( new k = 0; k < 33; k++)
{
	g_PlayerBonus[k] = 0;
	g_KillCount[k] = 0;
	g_ExtraHuman[k] = false;
	g_NonExtraHuman[k] = false;
}
}

public RoundEnd()
{
remove_task(SPAWN_TASK)
}

public clcmd_drop(iPlayer)
{
if (g_ExtraHuman[iPlayer])
	return PLUGIN_HANDLED;
	
	return PLUGIN_CONTINUE;
}

public fw_TouchWeapon(weapon, iPlayer)
{
	if(!is_user_connected(iPlayer))
		return HAM_IGNORED;
	
	if(g_ExtraHuman[iPlayer])
		return HAM_SUPERCEDE;
	
	return HAM_IGNORED;
}

public fw_TakeDamage(iVictim, iInflictor, iAttacker, Float:Damage, DamageType)
{
	if(iVictim == iAttacker || !is_user_connected(iAttacker))
		return HAM_IGNORED;
	
	if(DamageType & 1<<24)
		return HAM_SUPERCEDE;
	
	if(zp_get_user_zombie(iAttacker) == zp_get_user_zombie(iVictim))
		return HAM_SUPERCEDE;
	
	if(g_ExtraHuman[iAttacker] && g_PlayerBonus[iAttacker] == 5)
	{
		g_PlayerDamage[iAttacker] += Damage
		if(g_PlayerDamage[iAttacker] >= BONUS_MEGA_DAMAGE)
		{
			zp_set_user_ammo_packs(iAttacker, zp_get_user_ammo_packs(iAttacker) + BONUS_MEGA_DAMAGE_AMMO_GIVE)
			g_PlayerDamage[iAttacker] = 0;
		}
	}
	
	if(g_ExtraHuman[iAttacker] && !zp_get_user_zombie(iAttacker))
	{
		Damage *= EXTRAHUMANDAMAGE;
		if(g_PlayerBonus[iAttacker] == 2)
			Damage *= BONUS_SUPER_DAMAGE;
		
		SetHamParamFloat(4, Damage)
	}
	
	return HAM_IGNORED;
}

public fw_PlayerKilled(iVictim, iAttacker, iShouldgib)
{
	if(!is_user_connected(iAttacker) && !is_user_connected(iVictim))
		return HAM_HANDLED;
	
	if(g_ExtraHuman[iAttacker] && zp_get_user_zombie(iVictim))
	{
		g_KillCount[iAttacker]++;
		
		if(g_PlayerBonus[iAttacker] == 1)
			zp_set_user_ammo_packs(iAttacker, zp_get_user_ammo_packs(iAttacker) + BONUS_AMMO_GIFT)
		
		if(g_KillCount[iAttacker] >= KILLCOUNT)
		{
			g_PlayerBonus[iAttacker] = random_num(1, 5)
			g_KillCount[iAttacker] = 0;
			if(g_PlayerBonus[iAttacker] == 1)
				ChatColor(iAttacker, "!g[ZP] !yYou got a bonus! Get more ammo for killing!")
			if(g_PlayerBonus[iAttacker] == 2)
				ChatColor(iAttacker, "!g[ZP] !yYou got a bonus! Increased damage!")
			if(g_PlayerBonus[iAttacker] == 3)
			{
				ChatColor(iAttacker, "!g[ZP] !yYou got a bonus, !g%d ammo!y!", BONUS_AMMO_GIFT)
				zp_set_user_ammo_packs(iAttacker, zp_get_user_ammo_packs(iAttacker) + BONUS_AMMO_GIFT)
			}
			if(g_PlayerBonus[iAttacker] == 4)
				ChatColor(iAttacker, "!g[ZP] !yYou got a bonus! You will become a man after infection!")
			if(g_PlayerBonus[iAttacker] == 5)
				ChatColor(iAttacker, "!g[ZP] !yYou got a bonus! You get more ammo from doing damage!")
		}
	}
	
	if(g_ExtraHuman[iVictim] && zp_get_user_zombie(iAttacker))
	{
		g_ExtraHuman[iVictim] = false;
		g_ExtraHumanCount--;
		fm_set_rendering(iVictim)
		remove_task(iVictim+TASK_AURA)
		zp_set_user_ammo_packs(iAttacker, zp_get_user_ammo_packs(iAttacker) + WIN_KILLED)
		ChatColor(iAttacker, "!g[ZP] !yYou killed the Hero, and got !g%d Ammo!", WIN_KILLED)
	}
	else
		return HAM_IGNORED;
	
	return PLUGIN_HANDLED;
}

public fw_PlayerSpawn_Post(iPlayer)
{
	if (!is_user_alive(iPlayer))
		return HAM_IGNORED;
	
	remove_task(iPlayer+TASK_AURA)
	return PLUGIN_HANDLED;
}

public zp_user_infected_pre(iPlayer, iInfector)
{
	if(is_user_alive(iPlayer) && is_user_connected(iPlayer))
	{
		if(g_ExtraHuman[iPlayer])
		{
			g_ExtraHuman[iPlayer] = false;
			g_NonExtraHuman[iPlayer] = false;
			g_ExtraHumanCount--;
			fm_set_rendering(iPlayer)
			remove_task(iPlayer+TASK_AURA)
			
			zp_set_user_ammo_packs(iInfector, zp_get_user_ammo_packs(iInfector) + WIN_KILLED)
			ChatColor(iInfector, "!g[ZP] !yYou killed the Hero, and got !g%d Ammo!", WIN_KILLED)
			
			if(g_PlayerBonus[iPlayer] == 4)
			{
				ChatColor(iPlayer,  "!g[ZP] !ySoon you will become !gHuman!y!")
				set_task(BONUS_MEGA_SKILL, "MegaSkill", iPlayer+TASK_SKILL)
			}
		}
	}
}

public MegaSkill(taskid)
{
	if(is_user_connected(ID_SKILL) && zp_get_user_zombie(ID_SKILL) && zp_get_human_count() >= 2)
	{
		zp_disinfect_user(ID_SKILL, 0)
		ChatColor(ID_SKILL, "!g[ZP] !yYou are !tHuman !yagain!")
	}
	else
		return;
}

public zp_round_started(gamemode, id)
{
	switch(gamemode)
	{
		case MODE_INFECTION:
		{
			set_task(SPAWNTIME, "SpawnHuman", SPAWN_TASK)
		}
		case MODE_MULTI:
		{
			set_task(SPAWNTIME, "SpawnHuman", SPAWN_TASK)
		}
	}
	return PLUGIN_HANDLED;
}

public SpawnHuman()
{
	if(g_ExtraHumanCount >= EXTRAHUMANCOUNT)
		return PLUGIN_HANDLED;
	
	static iPlayers[32], iNum, i, id, Float:iMakeHuman;
	get_players(iPlayers, iNum, "ah");
	
	for( i = 0; i < iNum; i++ )
	{
		id = iPlayers[i];
		iMakeHuman = random_float(0.0, (100.0 / SPAWNCHANSE));
		
		if(iMakeHuman <= 1.0 && !g_ExtraHuman[id] && !g_NonExtraHuman[id])	
		{
			g_ExtraHuman[id] = true;
			g_ExtraHumanCount++;
			MakeExtraHuman(id);
			break;
		}
	}
	
	return PLUGIN_HANDLED;
}

public MakeExtraHuman(iPlayer)
{
	if(!is_user_connected(iPlayer) && !is_user_alive(iPlayer))
	{
		g_NonExtraHuman[iPlayer] = true;
		g_ExtraHuman[iPlayer] = false;
		SpawnHuman()
		return PLUGIN_HANDLED;
	}
	
	if(g_ExtraHuman[iPlayer])
	{
		if(!zp_get_user_zombie(iPlayer))
		{
			new PlayerName[32];
			get_user_name(iPlayer, PlayerName, 31)
			#if defined DHUD
			set_dhudmessage(100, 0, 0, -1.0, 0.4, 0, 0.0, 3.0, 1.0, 1.0, false) 
			show_dhudmessage(0,"A hero arrived on the ground %s!", PlayerName)
			#else
			ChatColor(0, "!g[ZP] !yA !ghero !yarrived on the ground %s!", PlayerName)
			#endif
			ChatColor(iPlayer, "!g[ZP] You became !gHero!y! !yKill !g%d !yzombies to get a random bonus!", KILLCOUNT)
			fm_set_user_health(iPlayer, EXTRAHUMANHEALTH)
			fm_set_user_armor(iPlayer, EXTRAHUMANARMOR)
			zp_override_user_model(iPlayer, g_HeroModel)
			SetSprite(iPlayer)
			
			message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0, 0, 0}, iPlayer)
			write_short(1<<11)
			write_short(1<<11)
			write_short(0x0001)
			write_byte(255)
			write_byte(255)
			write_byte(255) 
			write_byte(110) 
			message_end()
			
			//SetWeapon(iPlayer)
			
			set_task(SPAWNTIME, "SpawnHuman", SPAWN_TASK)
			set_task(0.1, "HeroAura", iPlayer+TASK_AURA, _, _, "b")
		}
		else
		{
			g_ExtraHumanCount--;
			g_ExtraHuman[iPlayer] = false;
			g_NonExtraHuman[iPlayer] = true;
			SpawnHuman()
		}
	}
	else
		return PLUGIN_HANDLED;
	
	return PLUGIN_HANDLED;
}

/*public SetWeapon(iPlayer)
{
//native
}*/

public SetSprite(id)
{
if(g_ExtraHuman[id])
{
	Sprite = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"));
	static Origin[3];
	pev(id, pev_origin, Origin);
	Origin[2] += 60;
	engfunc(EngFunc_SetOrigin, Sprite, Origin);
	engfunc(EngFunc_SetModel, Sprite, g_HeroSprite);
	entity_set_float(Sprite, EV_FL_scale, 0.2);
	set_pev(Sprite, pev_classname, HeroSprite);
	set_pev(Sprite, pev_euser1, id);
	set_pev(Sprite, pev_solid, SOLID_NOT);
	set_pev(Sprite, pev_movetype, MOVETYPE_NOCLIP);
	set_pev(Sprite, pev_frame, 10.0);
	set_pev(Sprite, pev_nextthink, get_gametime()+0.1);
}
}

public Think_Sprite(Ent)
{
if(is_valid_ent(Ent))
{
	new id = pev(id, pev_euser1)
	static Float:Origin[3]
	pev(id, pev_origin, Origin)
	Origin[2] += 60;
	
	if(g_ExtraHuman[id])
	{
		engfunc(EngFunc_SetOrigin, Ent, Origin)
		set_pev(Ent, pev_nextthink, get_gametime() + 0.1)
	}
	else
	{
		engfunc(EngFunc_RemoveEntity, Ent)
		return PLUGIN_CONTINUE;
	}
}
return PLUGIN_CONTINUE;
}

public HeroAura(taskid)
{
if(!g_ExtraHuman[ID_AURA])
{
	remove_task(taskid)
	return;
}
static origin[3]
get_user_origin(ID_AURA, origin)

message_begin(MSG_PVS, SVC_TEMPENTITY, origin)
write_byte(TE_DLIGHT)
write_coord(origin[0])
write_coord(origin[1])
write_coord(origin[2])
write_byte(20)
write_byte(255) 
write_byte(255) 
write_byte(255) 
write_byte(2)
write_byte(0)
message_end()
}

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") 
replace_all(msg, 190, "!y", "^1") 
replace_all(msg, 190, "!r", "^3") 
replace_all(msg, 190, "!b", "^0")

if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
	if (is_user_connected(players[i]))
	{
		message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), {0,0,0}, players[i])
		write_byte(players[i])
		write_string(msg)
		message_end()
	}
}
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1033{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/
Pentru ajutor, faceți cerere bine detaliată, completând și respectând modelul corespunzător.
Nu-mi mai dați cereri doar pentru a mă avea în lista de prieteni.
Dacă te ajut, și mă ignori/etc > te adaug în „foe”.
Aveți grijă la cei ce încearcă să mă copieze sau să dea drept mine..Puteți lua legătura cu mine prin STEAM dacă aveți o problemă/nelămurire în acest caz! Cont de forum am doar aici.
În cazul în care utilizați ceva din ce am postat(ex: aici), e bine să fiți la curent cu modificările aduse și de aici, iar dacă sunt ceva probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se vor afișa public, doar dacă se găsește ceva critic/urgent de remediat, unele fiind coduri vechi iar unele refăcute chiar recent dar private.
* Nume pe cs1.6: eVoLuTiOn \ Nume vechi: eVo
* Atelierul meu - post2819572.html#p2819572 (închis, click link ca să vedeți de ce)
User avatar
Doctor whO? <3
Membru, skill +3
Membru, skill +3
Posts: 1196
Joined: 21 Jun 2013, 12:40
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Reputatie: Fost Membru Club eXtreamCS (doua luni)
Has thanked: 109 times
Been thanked: 75 times
Contact:

21 Jul 2019, 14:57

Rezolvat , multumesc :)
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests