Raised This Month: $ Target: $400
 0% 

amx_fire cvar for catching people on fire


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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