Raised This Month: $ Target: $400
 0% 

[Q] What is the event name?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Giass
Member
Join Date: Aug 2011
Location: {Israel}
Old 05-26-2017 , 13:50   [Q] What is the event name?
Reply With Quote #1

Hi!
I got this code
What do i need to write if i want to use the TriggerH when the player shoot??

HTML Code:
#include <amxmodx>
#include <fakemeta_util>
#include <hamsandwich>
#include <engine>

new laserspr;
new const laser[ ] = "sprites/dot.spr";

public plugin_init()
{
	///   ????
}

public plugin_precache()
{	
	laserspr = precache_model( laser );
}

public TriggerH(client)
{
	static iTarget, iBody;
	get_user_aiming( client, iTarget, iBody );
	static iOrigin[ 3 ];
	get_user_origin( client, iOrigin, 3 );		
	message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
	write_byte( TE_BEAMENTPOINT );
	write_short( client | 0x1000 );
	write_coord( iOrigin[ 0 ] );
	write_coord( iOrigin[ 1 ] );
	write_coord( iOrigin[ 2 ] );
	write_short( laserspr );
	write_byte( 1 );
	write_byte( 10 );
	write_byte( 1 );
	write_byte( 5 );
	write_byte( 0 );
	write_byte( random_num(0,255) );
	write_byte( random_num(0,255) );
	write_byte( random_num(0,255) );
	write_byte( 150 );
	write_byte( 25 );
	message_end( );
}
__________________
All you need is carb

Last edited by Giass; 05-26-2017 at 13:58.
Giass is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-26-2017 , 16:33   Re: [Q] What is the event name?
Reply With Quote #2

Hook Ham_PrimaryAttack for the weapon(s) you need.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Giass
Member
Join Date: Aug 2011
Location: {Israel}
Old 05-26-2017 , 16:41   Re: [Q] What is the event name?
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
Hook Ham_PrimaryAttack for the weapon(s) you need.
thanks, i got another problem

PHP Code:
#include <amxmodx>
#include <fakemeta>

new laserspr;
new const 
laser[ ] = "sprites/dot.spr";

public 
plugin_init()
{
    
register_forwardFM_PlaybackEvent"fwdPlaybackEvent" );
}

public 
plugin_precache()
{    
    
laserspr precache_modellaser );
}

public 
fwdPlaybackEvent(attackeriEnt)
{
    new 
iOrigin]
    
get_user_origin(attackeriOrigin3);
    
message_beginMSG_BROADCASTSVC_TEMPENTITY );
    
write_byteTE_BEAMENTPOINT );
    
write_shortiEnt 0x1000 );
    
write_coordiOrigin] );
    
write_coordiOrigin] );
    
write_coordiOrigin] );
    
write_shortlaserspr );
    
write_byte);
    
write_byte15 );
    
write_byte);
    
write_byte);
    
write_byte);
    
write_byterandom_num(0,255) );
    
write_byterandom_num(0,255) );
    
write_byterandom_num(0,255) );
    
write_byte150 );
    
write_byte255 );
    
message_end( );

edit: i played with this a little bit and fixed big issue, now i got little one,
when player shoots and it draws the laser, the person who looks at the attacker sees the beam bent and you can see the beam through the wall
how to fix that
__________________
All you need is carb

Last edited by Giass; 05-26-2017 at 17:08.
Giass is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 05-27-2017 , 02:17   Re: [Q] What is the event name?
Reply With Quote #4

Hook ham traceattack , dont hook fwdPlaybackevent
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 05-27-2017 at 02:18.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Giass
Member
Join Date: Aug 2011
Location: {Israel}
Old 05-27-2017 , 03:34   Re: [Q] What is the event name?
Reply With Quote #5

Quote:
Originally Posted by Natsheh View Post
Hook ham traceattack , dont hook fwdPlaybackevent
thanks!
__________________
All you need is carb
Giass is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 05-27-2017 , 07:13   Re: [Q] What is the event name?
Reply With Quote #6

Quote:
Originally Posted by Natsheh View Post
Hook ham traceattack , dont hook fwdPlaybackevent
why not ham primaryattack ?
Craxor is offline
Send a message via ICQ to Craxor
Natsheh
Veteran Member
Join Date: Sep 2012
Old 05-27-2017 , 08:46   Re: [Q] What is the event name?
Reply With Quote #7

Quote:
Originally Posted by Craxor View Post
why not ham primaryattack ?
Because its better to get the trace of the attack.
The trace ld , It is passed into the function,no need to create another trace in primaryattack function, do what you like.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 05-27-2017 , 10:04   Re: [Q] What is the event name?
Reply With Quote #8

No, i was just asking
Craxor is offline
Send a message via ICQ to Craxor
Giass
Member
Join Date: Aug 2011
Location: {Israel}
Old 05-27-2017 , 15:08   Re: [Q] What is the event name?
Reply With Quote #9

Do you guys have simple vote map plugin?

Galileo is too hardcore

I just want simple plugin that every 15 mins creates a votemap
__________________
All you need is carb
Giass is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 05-27-2017 , 15:29   Re: [Q] What is the event name?
Reply With Quote #10

Quote:
Originally Posted by Giass View Post
Do you guys have simple vote map plugin?

Galileo is too hardcore

I just want simple plugin that every 15 mins creates a votemap
How is it hardcore? It's the best ever created, if you're too lazy to manage all of the stuff there then search it yourself. Besides, this has nothing to do with this topic.
redivcram 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 23:12.


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