AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   public weapon_event() (https://forums.alliedmods.net/showthread.php?t=75034)

minimiller 07-29-2008 12:02

public weapon_event()
 
I need some help with teh weapon_event
I need to find when a player shoots their weapon and shoots a player (successfully and unsuccessfully)

I guess there would both use weapon_event, but im not sure how to register_event("CurWeapon", "..........) properly for each

Any help would be awesome!
:up:

ot_207 07-29-2008 13:15

Re: public weapon_event()
 
The best way i think that it is with fakemeta ->

PHP Code:

public plugin_init()
{
    
register_forward(FM_TraceLine"fw_traceline")
}

public 
fw_traceline(Float:start[3], Float:end[3], conditionsidtr)
{
    if (!
is_user_alive(id)) return FMRES_IGNORED
    
new target get_tr2(trTR_pHit)
    
    if (!
is_user_alive(target))
        
client_print(0,print_chat,"MISSED LOSER!!! :P")
    else
        
client_print(0,print_chat,"GOOD SHOT!!!")

    return 
FMRES_IGNORED



minimiller 07-29-2008 13:47

Re: public weapon_event()
 
Ok thanks, ill try it
+karma for yoooouu

ConnorMcLeod 07-29-2008 19:56

Re: public weapon_event()
 
http://forums.alliedmods.net/showthread.php?t=54887
http://forums.alliedmods.net/showthread.php?t=49395

ot_207 07-30-2008 03:16

Re: public weapon_event()
 
You're right! :D I forgot about those tutorials. I've tested the traceline and it is good when you don't shot through walls :D


All times are GMT -4. The time now is 05:33.

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