AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [ Solved ] Forward Ham_Killed (https://forums.alliedmods.net/showthread.php?t=187909)

Aooka 06-19-2012 15:04

[ Solved ] Forward Ham_Killed
 
Just one question : what is the param "shouldgib" please ? I do not understand ...

Code:
#include < amxmodx > public plugin_init( ) {     register_plugin( "Who kill who ?" , "1.0" , "Aooka" );         RegisterHam( Ham_Killed , "player" , "Fw_HamKilled" , true ); } public Fw_HamKilled( victim , attacker , shouldgib ) {     new szVictim[ 36 ] , szAttacker[ 36 ];         get_user_name( victim , szVictim , charsmax( szVictim ) );     get_user_name( attacker , szAttacker , charsmax( szAttacker ) );         client_print( victim , print_center , "You ha been killed by %s" , szAttacker );     client_print( attacker , print_center , "You kill %s" , szVictim ); }

Thank you in advance !

<VeCo> 06-19-2012 15:16

Re: [REQ] Forward Ham_Killed
 
It is in what conditions the player should gib on death (break up in meat and bones...).
0 means that the player won't gib.
1 means that the player will gib on big damage.
2 means that the player will always gib (independantly on the damage taken).

Aooka 06-19-2012 15:20

Re: [REQ] Forward Ham_Killed
 
So i can just do :
Code:
public Fw_HamKilled( victim , attacker , 3 )

and the player always break up in meat and bones LoL !

Thanks :D

<VeCo> 06-19-2012 15:22

Re: [REQ] Forward Ham_Killed
 
PHP Code:

SetHamParamInteger(3,2

But the forward should be called as PRE.

Aooka 06-19-2012 15:28

Re: [REQ] Forward Ham_Killed
 
Hum why ? Because the syntax is :
Code:

SetHamParamInteger ( which, value )
Wih = 3 // Ok because i want the third.
Value = 2 // But why 2 and not 1 , 4 , 7 etc ?

And to conclude, where can i set the native ? Because if i set it in the code the compilator his ANGRY

<VeCo> 06-19-2012 15:31

Re: [REQ] Forward Ham_Killed
 
It's 2 because:
Quote:

Originally Posted by <VeCo> (Post 1731847)
0 means that the player won't gib.
1 means that the player will gib on big damage.
2 means that the player will always gib (independantly on the damage taken).

Just set it somewhere in the function, doesn't really matter where.

Aooka 06-19-2012 15:35

Re: [REQ] Forward Ham_Killed
 
Oh yes sorry i forget it :S
Thanks :D

It's work fine. Thanks a lot Veco !

If anyone want it :
PHP Code:

#include < amxmodx >
#include < hamsandwich >


public plugin_init( )
{
    
register_plugin"Who kill who ?" "1.0" "Aooka" );
    
    
RegisterHamHam_Killed "player" "Fw_HamKilled" true );
}

public 
Fw_HamKilledvictim attacker souldgib )
{
    
SetHamParamInteger);
    
    new 
szVictim36 ] , szAttacker36 ];
    
    
get_user_namevictim szVictim charsmaxszVictim ) );
    
get_user_nameattacker szAttacker charsmaxszAttacker ) );
    
    
client_printvictim print_center "You ha been killed by %s" szAttacker );
    
client_printattacker print_center "You kill %s" szVictim );




All times are GMT -4. The time now is 06:09.

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