Raised This Month: $51 Target: $400
 12% 

Spark effect


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 12-13-2013 , 14:56   Spark effect
Reply With Quote #1

Im trying to make a cool spark effect when you knife a block on the blockmaker but i guess something is wrong becuse it doesnt give me a spark effect :/ Help would be very appreciated

Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>

#define PLUGIN "Testing"
#define VERSION "1.0"
#define AUTHOR "Valdemar"

#define RIC "debris/metal6.wav"
#define BLOCK "PCM_Block"

public plugin_precache()
{
	precache_sound(RIC)
}

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	RegisterHam(Ham_TraceAttack, BLOCK, "shoot_item")
}

public shoot_item(ent, attacker, Float:damage, Float:direction[3], trace, damagebits)
{
	static Float:endpoint[3];
	get_tr2(trace, TR_vecEndPos, endpoint);
	draw_spark(endpoint);
	
	engfunc(EngFunc_EmitSound, ent, CHAN_ITEM, RIC, 0.5, ATTN_STATIC, 0, PITCH_NORM);

	return HAM_IGNORED;
}

stock draw_spark(Float:origin[3])
{
	message_begin(MSG_ALL, SVC_TEMPENTITY);
	write_byte(TE_SPARKS);
	engfunc(EngFunc_WriteCoord, origin[0]);
	engfunc(EngFunc_WriteCoord, origin[1]);
	engfunc(EngFunc_WriteCoord, origin[2]);
	message_end();
}
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 12-13-2013 , 18:33   Re: Spark effect
Reply With Quote #2

Is function even calling?
What about the size of block? Maybe it is smaller than the model or whatever, and you just don't see the spark.
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness
GuskiS is offline
Reply



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 06:15.


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