Raised This Month: $32 Target: $400
 8% 

Infection Bomb Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NEXO.
Member
Join Date: May 2016
Location: Pakistan
Old 10-25-2020 , 17:06   Infection Bomb Help
Reply With Quote #1

Hello, i need help in infection bomb, i want to edit code to like if someone have bought godmode and someone throw inf bomb on him, it will dont effect him

Quote:
// Infection Bomb Explosion
infection_explode(ent)
{
// Round ended (bugfix)
if (g_endround) return;

// Get origin
static FloatriginF[3]
pev(ent, pev_origin, originF)

// Make the explosion
create_blast(originF)

// Infection nade explode sound
static sound[64]
ArrayGetString(grenade_infect, random_num(0, ArraySize(grenade_infect) - 1), sound, charsmax(sound))
emit_sound(ent, CHAN_WEAPON, sound, 1.0, ATTN_NORM, 0, PITCH_NORM)

// Get attacker
static attacker
attacker = pev(ent, pev_owner)

// Infection bomb owner disconnected? (bugfix)
if (!is_user_valid_connected(attacker))
{
// Get rid of the grenade
engfunc(EngFunc_RemoveEntity, ent)
return;
}

// Collisions
static victim
victim = -1

while ((victim = engfunc(EngFunc_FindEntityInSphere, victim, originF, NADE_EXPLOSION_RADIUS)) != 0)
{
// Only effect alive non-spawnprotected humans
if (!is_user_valid_alive(victim) || g_zombie[victim] || g_nodamage[victim])
continue;

// Last human is killed
if (fnGetHumans() == 1)
{
ExecuteHamB(Ham_Killed, victim, attacker, 0)
continue;
}

// Infected victim's sound
ArrayGetString(grenade_infect_player, random_num(0, ArraySize(grenade_infect_player) - 1), sound, charsmax(sound))
emit_sound(victim, CHAN_VOICE, sound, 1.0, ATTN_NORM, 0, PITCH_NORM)

// Turn into zombie
zombieme(victim, attacker, 0, 0, 1, 1)
}

// Get rid of the grenade
engfunc(EngFunc_RemoveEntity, ent)
}
here is my code of inf bomb

Thanks,
NEXO. is offline
Perfect Scrash
Senior Member
Join Date: Aug 2013
Location: Brazil
Old 10-25-2020 , 17:22   Re: Infection Bomb Help
Reply With Quote #2

Test:
Code:
// Infection Bomb Explosion
infection_explode(ent)
{
	// Round ended (bugfix)
	if (g_endround) return;
	
	// Get origin
	static FloatriginF[3]
	pev(ent, pev_origin, originF)
	
	// Make the explosion
	create_blast(originF)
	
	// Infection nade explode sound
	static sound[64]
	ArrayGetString(grenade_infect, random_num(0, ArraySize(grenade_infect) - 1), sound, charsmax(sound))
	emit_sound(ent, CHAN_WEAPON, sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
	
	// Get attacker
	static attacker
	attacker = pev(ent, pev_owner)
	
	// Infection bomb owner disconnected? (bugfix)
	if (!is_user_valid_connected(attacker))
	{
		// Get rid of the grenade
		engfunc(EngFunc_RemoveEntity, ent)
		return;
	}
	
	// Collisions
	static victim
	victim = -1
	
	while ((victim = engfunc(EngFunc_FindEntityInSphere, victim, originF, NADE_EXPLOSION_RADIUS)) != 0)
	{
		// Only effect alive non-spawnprotected humans
		if (!is_user_valid_alive(victim) || g_zombie[victim] || g_nodamage[victim])
			continue;

		if(!pev(victim, pev_takedamage))
			continue
		
		// Last human is killed
		if (fnGetHumans() == 1)
		{
			ExecuteHamB(Ham_Killed, victim, attacker, 0)
			continue;
		}
		
		// Infected victim's sound
		ArrayGetString(grenade_infect_player, random_num(0, ArraySize(grenade_infect_player) - 1), sound, charsmax(sound))
		emit_sound(victim, CHAN_VOICE, sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
		
		// Turn into zombie
		zombieme(victim, attacker, 0, 0, 1, 1)
	}
	
	// Get rid of the grenade
	engfunc(EngFunc_RemoveEntity, ent)
}
__________________
Perfect Scrash is offline
Send a message via Skype™ to Perfect Scrash
NEXO.
Member
Join Date: May 2016
Location: Pakistan
Old 10-26-2020 , 18:58   Re: Infection Bomb Help
Reply With Quote #3

Quote:
Originally Posted by Perfect Scrash View Post
Test:
Code:
// Infection Bomb Explosion
infection_explode(ent)
{
	// Round ended (bugfix)
	if (g_endround) return;
	
	// Get origin
	static FloatriginF[3]
	pev(ent, pev_origin, originF)
	
	// Make the explosion
	create_blast(originF)
	
	// Infection nade explode sound
	static sound[64]
	ArrayGetString(grenade_infect, random_num(0, ArraySize(grenade_infect) - 1), sound, charsmax(sound))
	emit_sound(ent, CHAN_WEAPON, sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
	
	// Get attacker
	static attacker
	attacker = pev(ent, pev_owner)
	
	// Infection bomb owner disconnected? (bugfix)
	if (!is_user_valid_connected(attacker))
	{
		// Get rid of the grenade
		engfunc(EngFunc_RemoveEntity, ent)
		return;
	}
	
	// Collisions
	static victim
	victim = -1
	
	while ((victim = engfunc(EngFunc_FindEntityInSphere, victim, originF, NADE_EXPLOSION_RADIUS)) != 0)
	{
		// Only effect alive non-spawnprotected humans
		if (!is_user_valid_alive(victim) || g_zombie[victim] || g_nodamage[victim])
			continue;

		if(!pev(victim, pev_takedamage))
			continue
		
		// Last human is killed
		if (fnGetHumans() == 1)
		{
			ExecuteHamB(Ham_Killed, victim, attacker, 0)
			continue;
		}
		
		// Infected victim's sound
		ArrayGetString(grenade_infect_player, random_num(0, ArraySize(grenade_infect_player) - 1), sound, charsmax(sound))
		emit_sound(victim, CHAN_VOICE, sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
		
		// Turn into zombie
		zombieme(victim, attacker, 0, 0, 1, 1)
	}
	
	// Get rid of the grenade
	engfunc(EngFunc_RemoveEntity, ent)
}


thanks bro it worked, T/C
NEXO. is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:15.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode