Raised This Month: $ Target: $400
 0% 

amx_fire cvar for catching people on fire


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bmann_420
AMX_Super Pooper
Join Date: Jan 2005
Location: [SuperCentral.co]
Old 06-07-2007 , 23:05   amx_fire cvar for catching people on fire
Reply With Quote #1

I dont know where to add or how to add a cvar ( I tried) to make it where you can 1 = catch people on fire, 0 = you cant. Something like this:
Code:
public ignite_player(skIndex[])   {
	new kIndex = skIndex[0]

	if (is_user_alive(kIndex) && onfire[kIndex] )    {
		new korigin[3]
		new players[32], inum = 0
		new pOrigin[3]
		new kHeath = get_user_health(kIndex)
		get_user_origin(kIndex,korigin)

		//create some damage
		set_user_health(kIndex,kHeath - 10)
		message_begin(MSG_ONE, gmsgDamage, {0,0,0}, kIndex)
		write_byte(30) // dmg_save
		write_byte(30) // dmg_take
		write_long(1<<21) // visibleDamageBits
		write_coord(korigin[0]) // damageOrigin.x
		write_coord(korigin[1]) // damageOrigin.y
		write_coord(korigin[2]) // damageOrigin.z
		message_end()

		//create some sound
		emit_sound(kIndex,CHAN_ITEM, "ambience/flameburst1.wav", 0.6, ATTN_NORM, 0, PITCH_NORM)

		//Ignite Others
		get_players(players,inum,"a")
		for(new i = 0 ;i < inum; ++i)   {
			get_user_origin(players[i],pOrigin)
			if( get_distance(korigin,pOrigin) < 100  )   {
				if( !onfire[players[i]] )   {
					new spIndex[2]
					spIndex[0] = players[i]
					new pName[32], kName[32]
					get_user_name(players[i],pName,31)
					get_user_name(kIndex,kName,31)
					emit_sound(players[i],CHAN_WEAPON ,"scientist/scream07.wav", 1.0, ATTN_NORM, 0, PITCH_HIGH)
					client_print(0,3,"%L", LANG_PLAYER, "AMX_SUPER_FIRE_SPREAD",kName,pName)
					onfire[players[i]] =1
					ignite_player(players[i])
					ignite_effects(players[i])
				}
			}
		}

		players[0] = 0
		pOrigin[0] = 0
		korigin[0] = 0

		//Call Again in 2 seconds
		set_task(2.0, "ignite_player" , 0 , skIndex, 2)
	}
	return PLUGIN_CONTINUE
}


public admin_fire(id,level,cid) {
	if (!cmd_access(id,level,cid,2))
		return PLUGIN_HANDLED

	new arg[32]
	read_argv(1,arg,31)

	new victim = cmd_target(id,arg,7)
	if (!victim)
		return PLUGIN_HANDLED

	new skIndex[2]
	skIndex[0] = victim
	new name[32], victimauthid[36]
	get_user_name(victim,name,31)
	get_user_authid(victim,victimauthid,35)

	onfire[victim] = 1
	ignite_effects(skIndex)
	ignite_player(skIndex)

	new adminname[32], adminauthid[36]
	get_user_name(id,adminname,31)
	get_user_authid(id,adminauthid,35)

	switch(get_cvar_num("amx_show_activity"))   {
Tried
Code:
	//create some sound
		emit_sound(kIndex,CHAN_ITEM, "ambience/flameburst1.wav", 0.6, ATTN_NORM, 0, PITCH_NORM)

		//Ignite Others
		if(!get_pcvar_num(allowcatchfire) == 1)
			return PLUGIN_CONTINUE
		
		get_players(players,inum,"a")
		for(new i = 0 ;i < inum; ++i)   {
			get_user_origin(players[i],pOrigin)
			if( get_distance(korigin,pOrigin) < 100  )   {
				if( !onfire[players[i]] )   {
					new spIndex[2]
					spIndex[0] = players[i]
					new pName[32], kName[32]
					get_user_name(players[i],pName,31)
					get_user_name(kIndex,kName,31)
					emit_sound(players[i],CHAN_WEAPON ,"scientist/scream07.wav", 1.0, ATTN_NORM, 0, PITCH_HIGH)
					client_print(0,3,"%L", LANG_PLAYER, "AMX_SUPER_FIRE_SPREAD",kName,pName)
					onfire[players[i]] =1
					ignite_player(players[i])
					ignite_effects(players[i])
I know its in the wrong spot, and it screws with everyhting else. So im lost and sorry if this was answered before, I also searched
(possibly turn it into a while loop?)
__________________

Last edited by bmann_420; 06-07-2007 at 23:31.
bmann_420 is offline
djmd378
Senior Member
Join Date: Sep 2004
Old 06-07-2007 , 23:43   Re: amx_fire cvar for catching people on fire
Reply With Quote #2

I thought amx_fire already included a cvar to allow you to catch other people on fire or not. (I'm talking about the independent version, not the one included with amx_super)
__________________
djmd378 is offline
bmann_420
AMX_Super Pooper
Join Date: Jan 2005
Location: [SuperCentral.co]
Old 06-07-2007 , 23:45   Re: amx_fire cvar for catching people on fire
Reply With Quote #3

THe one included in teh amx_super is the origional independant version by f117. Unless your refering to another version, which i would love to see.
__________________
bmann_420 is offline
djmd378
Senior Member
Join Date: Sep 2004
Old 06-07-2007 , 23:56   Re: amx_fire cvar for catching people on fire
Reply With Quote #4

This should work. I didn't test it though.

CVAR:
amx_fire_others <1 = On/0 = off>
Attached Files
File Type: sma Get Plugin or Get Source (amx_fire.sma - 750 views - 4.6 KB)
__________________
djmd378 is offline
bmann_420
AMX_Super Pooper
Join Date: Jan 2005
Location: [SuperCentral.co]
Old 06-08-2007 , 00:05   Re: amx_fire cvar for catching people on fire
Reply With Quote #5

I just got it (I think not tested)
Code:
		//Ignite Others 
		if ( get_pcvar_num(allowcatchfire)==1)    {       
			get_players(players,inum,"a") 
			
			for(new i = 0 ;i < inum; ++i)   {                            
				get_user_origin(players[i],pOrigin) 
				
				if( get_distance(korigin,pOrigin) < 100  )   { 
					
					if( !onfire[players[i]] )   { 
						
						new spIndex[2] 
						spIndex[0] = players[i] 
						new pName[32], kName[32]                
						get_user_name(players[i],pName,31) 
						get_user_name(kIndex,kName,31) 
						emit_sound(players[i],CHAN_WEAPON ,"scientist/scream07.wav", 1.0, ATTN_NORM, 0, PITCH_HIGH) 
						client_print(0,3,"* [AMX] OH! NO! %s has caught %s on fire!",kName,pName) 
						onfire[players[i]] =1 
						ignite_player(players[i]) 
						ignite_effects(players[i])    
					}                
				} 
			}          
			players[0] = 0 
			pOrigin[0] = 0                
			korigin[0] = 0       
		} 
		//Call Again in 2 seconds       
		set_task(2.0, "ignite_player" , 0 , skIndex, 2)       
	}    
	
	return PLUGIN_CONTINUE 
}
__________________
bmann_420 is offline
bmann_420
AMX_Super Pooper
Join Date: Jan 2005
Location: [SuperCentral.co]
Old 06-08-2007 , 02:04   Re: amx_fire cvar for catching people on fire
Reply With Quote #6

THe one i posted only works if you have it enabled.

I'll try yours

Well yours is exactly the same except )) instead of )==1)
__________________

Last edited by bmann_420; 06-08-2007 at 02:07.
bmann_420 is offline
bmann_420
AMX_Super Pooper
Join Date: Jan 2005
Location: [SuperCentral.co]
Old 06-08-2007 , 02:14   Re: amx_fire cvar for catching people on fire
Reply With Quote #7

And that did it. THankx
__________________
bmann_420 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 10:30.


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