AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Forward >"<.... (https://forums.alliedmods.net/showthread.php?t=98681)

5c0r-|3i0 07-27-2009 21:10

Forward >"<....
 
What fakemeta\hamsandwich forwards used when :
1) A player is killed
2) Player is holding a weapon..

I really don't know about this :oops:. Thanks in advance:oops:

TitANious 07-27-2009 21:15

Re: Forward >"<....
 
1. Ham_Killed

Bugsy 07-27-2009 21:37

Re: Forward >"<....
 
Are fakemeta and\or hamsandwich required? Because both can be done without using either.

5c0r-|3i0 07-27-2009 21:45

Re: Forward >"<....
 
@Bugsy:'kay..tell me another method :D.
@TitANious:
Show me an example :D

Bugsy 07-27-2009 23:36

Re: Forward >"<....
 
PHP Code:

#include <amxmodx>

public plugin_init() 
{
    
register_plugin"Weapon and Kill" "1.0" "bugsy" );
    
register_event"CurWeapon" "fw_EvCurWeapon" "be" "1=1" );
    
register_event"DeathMsg" "fw_EvDeathMsg" "a" );
}

public 
fw_EvCurWeaponid )
{
    static 
iWeapon iPrevWeapon;
    static 
szWeapon20 ];
    
    
iWeapon read_data);
    
    if ( 
iWeapon != iPrevWeapon )
    {
        
get_weaponnameiWeapon szWeapon 19 );
        
client_printid print_chat "* You are now using %s" szWeapon] );
        
iPrevWeapon iWeapon;
    }
}

public 
fw_EvDeathMsg( )
{
    static 
iKilleriKiller read_data);
    static 
iVictimiVictim read_data);
    static 
iWasHeadshotiWasHeadshot read_data);
    static 
szWeaponUsed20 ]; read_dataszWeaponUsed 19 );
    static 
szKiller33 ] , szVictim33 ];
    
    
//You could also perform this if-statement via adding condition in the register_event function
    //which will make it only be called if a player kills another player [not called on suicide\slay etc]
    //register_event( "DeathMsg" , "fw_EvDeathMsg" , "a" , "1>0" , "2>0" );
    
if ( iKiller && iVictim )
    {
        
get_user_nameiKiller szKiller 32 );
        
get_user_nameiVictim szVictim 32 );
    
        
client_printprint_chat "* %s killed %s with %s%s" szKiller szVictimszWeaponUsed iWasHeadshot " [HEADSHOT]" "" );
    }



5c0r-|3i0 07-27-2009 23:52

Re: Forward >"<....
 
I was wrong .haha =)) . I think that I have to use cstrike modules when use those 2 events .Thanks a lot :)

Bugsy 07-27-2009 23:58

Re: Forward >"<....
 
cstrike module is not needed.


All times are GMT -4. The time now is 18:31.

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