Raised This Month: $ Target: $400
 0% 

Weapon Event


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 04-02-2004 , 19:30   Weapon Event
Reply With Quote #1

Im trying to figure out what event to use when a player fires his weapon. Im not sure what it is, but my guess was CurWeapon, but I think I need to add some flags to show if its firing or not, plz help!
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
MagicShot
Senior Member
Join Date: Mar 2004
Location: MN
Old 04-02-2004 , 19:40   hrm?
Reply With Quote #2

I don't think there is one yet..

I think there is a native called prethink or something like that.. that will catch +attack..

Not completely sure but I think thats what it was called
__________________
|v|agic$hot
.
Without a Sound
MagicShot is offline
Send a message via MSN to MagicShot Send a message via Yahoo to MagicShot
CheesyPeteza
Senior Member
Join Date: Feb 2004
Location: UK
Old 04-02-2004 , 19:41  
Reply With Quote #3

register_playevent("ak47", "firedAK47")

Unfortunately this native doesn't exist though. Hopefully they will add it.

I'll have a look now and see if there is any messages sent when u fire a weapon, but I don't think there is unless you do some damage.
__________________
YO|Cheesy Peteza

[email protected]

CheesyPeteza is offline
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 04-02-2004 , 19:44  
Reply With Quote #4

i thought curweapon was it, but its not ONLY called when u fire.
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 04-03-2004 , 09:25   hmmm
Reply With Quote #5

in Matrix Mod they have an event that only happens when you fire a weapon... there must be a way[/url]
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 04-03-2004 , 10:14  
Reply With Quote #6

I used this method once (seemed to work fine)

Code:
// a global var: // [0] = Weapon ID // [1] = Weapon Ammo new g_nCurWeapon[33][2] // in plugin_init: register_event( "CurWeapon",  "Event_ShotFired",  "b" ) // Somewhere else.. public Event_ShorFired( id ) {     new wID = read_data( 2 )     new wAmmo = read_data( 3 )         if( g_nCurWeapon[id][0] != wID )     {         g_nCurWeapon[id][0] = wID         g_nCurWeapon[id][1] = wAmmo         return PLUGIN_HANDLED     }     if( g_nCurWeapon[id][1] < wAmmo )     {         g_nCurWeapon[id][1] = wAmmo         return PLUGIN_HANDLED     }     if( g_nCurWeapon[id][1] == wAmmo )         return PLUGIN_HANDLED     g_nCurWeapon[id][1] = wAmmo     g_nCurWeapon[id][0] = wID     // if you made it this far, user shot his/her gun     // ... }
xeroblood is offline
Send a message via MSN to xeroblood
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 04-03-2004 , 10:33   Yes
Reply With Quote #7

I was getting help by PM and he used a method similar to urs Xero, thx anyway though, you would have been the first
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 04-03-2004 , 10:38  
Reply With Quote #8

Can you give us an example of PM's method??
xeroblood is offline
Send a message via MSN to xeroblood
CheesyPeteza
Senior Member
Join Date: Feb 2004
Location: UK
Old 04-03-2004 , 11:47  
Reply With Quote #9

Yours is a nice method xeroblood.
__________________
YO|Cheesy Peteza

[email protected]

CheesyPeteza is offline
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 04-03-2004 , 17:52  
Reply With Quote #10

Thx! lil' lengthy tho, ;)
xeroblood is offline
Send a message via MSN to xeroblood
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 14:41.


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