AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Not displaying right (https://forums.alliedmods.net/showthread.php?t=127876)

asd13 05-25-2010 22:58

Not displaying right
 
Its not reading or displaying right the message.
Problem is that if player kills he/she sees always the same message "You killed '%s' with HeadShot" no matter is it hs or not.

PHP Code:

#include < amxmodx >
#include < hamsandwich >

public plugin_init( ) {
    
RegisterHamHam_Killed"player""PlayerKilled" );
}

public 
PlayerKillediVictimiKilleriHs ) {
    if ( 
iHs == ) {
        
client_printiKillerprint_chat"You killed '%s' with HeadShot"iVictim );
    }
    else {
        
client_printiKillerprint_chat"You killed '%s'"iVictim );
    }



wrecked_ 05-25-2010 23:04

Re: Not displaying right
 
Code:
#include <amxmodx> public plugin_init() {     register_plugin( "Death Message", "1.0", "Wrecked" )     register_event( "DeathMsg", "EventDeathMsg", "a", "1>0" ) } public EventDeathMsg() {     // read_data( 1 ) = Killer     // read_data( 2 ) = Victim     // read_data( 3 ) = Headshot     new name[32]     get_user_name( read_data( 2 ), name, 31 )     client_print( read_data( 1 ), print_chat, "You killed '%s'%s", name, read_data( 3 ) ? "with a headshot!" : "!" ) }

asd13 05-25-2010 23:09

Re: Not displaying right
 
Thanks, but can it be done with hamsandwich ? :O

wrecked_ 05-25-2010 23:11

Re: Not displaying right
 
Why does it matter?

EDIT: The 3rd parameter for Ham_Killed is shouldgib.

I have no idea what that is, but I think it'd be named headshot if it were related to the kill being a headshot.

asd13 05-25-2010 23:12

Re: Not displaying right
 
It'd doesent but i like ham. :D And other stuff like player spawning and so is done with ham. :)

wrecked_ 05-25-2010 23:14

Re: Not displaying right
 
Quote:

Originally Posted by asd13 (Post 1191363)
It'd doesent but i like ham. :D

With green eggs?


Quote:

Originally Posted by asd13 (Post 1191363)
And other stuff like player spawning and so is done with ham. :)

So use hamsandwich for spawning and other things and use DeathMsg for the killed event...

Brreaker 05-27-2010 05:58

Re: Not displaying right
 
Quote:

Originally Posted by asd13 (Post 1191346)
Its not reading or displaying right the message.
Problem is that if player kills he/she sees always the same message "You killed '%s' with HeadShot" no matter is it hs or not.

PHP Code:

#include < amxmodx >

public plugin_init( ) {
    
register_event("DeathMsg""eDeath""a");
}

public 
eDeath() {
    new 
iKillerID read_data(1);
    new 
iVictimID read_data(2);
    new 
isHeadshot read_data(3);
    new 
Name[32];
    
get_user_name(iVictimIDNamecharsmax(Name));
    if(
isHeadshot) {
        
client_print(iKillerclient_print"You killed %s with a headshot!"Name);
        }
    else {
        
client_print(iKillerclient_print"You killed %s!"Name);
        }


note:
isHeadshot is a bool.

I know it's the same thing wrecked said, but I think that this way it's more user-friendly (if it would be in any way xD)


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

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