AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to use the ham_killed (https://forums.alliedmods.net/showthread.php?t=113356)

MouseSplash! 12-25-2009 19:35

How to use the ham_killed
 
hi everyone can help me
i need 1 tutorial for ham_killed , and ham_take damage
and others :S!

thx

Doc-Holiday 12-25-2009 22:03

Re: How to use the ham_killed
 
PHP Code:

RegisterHam(Ham_Killed"player""Player_Death"0/1before death 1 after 

PHP Code:

public Player_Death(id)
{
    
//Player Death


To register Bots so that they are affected by your ham sandwich forwards
PHP Code:

new bool:gBotsRegistered;

public 
client_authorizedid )
{
    if( !
gBotsRegistered && is_user_botid ) )
    {
        
set_task0.1"register_bots"id );
    }
}

public 
register_botsid )
{
    if( !
gBotsRegistered && is_user_connectedid ) )
    {
        
RegisterHamFromEntityHam_Killedid"Player_Death"); // This should look identical to the RegisterHam in the plugin init
        
gBotsRegistered true;
    }



MouseSplash! 12-26-2009 03:23

Re: How to use the ham_killed
 
PHP Code:

RegisterHam(Ham_Killed"player""Player_Death"0/1before death 1 after 


PHP Code:

public Player_Death(id)
{
    
//Player Death
   // give me here 1 example more complete pls ! :D






Hasler 12-26-2009 04:19

Re: How to use the ham_killed
 
PHP Code:

#include <amxmodx>
#include <hamsandwich>

public plugin_init() {
    
register_plugin("ham_killed example""1.4""Hasler")
    
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled")
}

 public 
fw_PlayerKilled(victimattackershouldgib)
{
      static 
namevictim[33]
      
get_user_name(victimnamevictim32)
      new 
aName[32]
      
get_user_name(attackeraNamesizeof(aName)-1)
 
      if(
get_user_team(attacker) == 1)
            
client_print(0print_chat"%s kill %s",aName,namevictim)



MouseSplash! 12-26-2009 07:11

Re: How to use the ham_killed
 
thx +k


All times are GMT -4. The time now is 04:17.

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