Raised This Month: $ Target: $400
 0% 

Car accident help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lolz123
Member
Join Date: Aug 2010
Old 06-20-2011 , 08:30   Car accident help
Reply With Quote #1

when a player killing another player with a car its should display a color chat like this:
Blabla killed Blabla with a Car

but insted the plugin display this:
Server name killed Blabla with a Car

Code:
PHP Code:
#include <amxmodx>
#include <colorchat>


new g_msgDeathMsgKilledByVehicle[33];

public 
plugin_init() {
    
register_plugin("Car Accident""1.0""lolz123")
    
g_msgDeathMsg get_user_msgid("DeathMsg")
    
    
register_message(g_msgDeathMsg"hookmsg_death")
    
register_event("DeathMsg""EventDeathMsg""a");
}


public 
hookmsg_death(msgidmsgdestmsgargs)
{
    new 
weapon[32]
    
get_msg_arg_string(4weapon31)

    new 
victim get_msg_arg_int(2);
    
    if (
equal(weapon"vehicle"))
    {
        
KilledByVehicle[victim] = true;
    }
    return 
PLUGIN_CONTINUE
}

public 
EventDeathMsg()
{
    new 
killer read_data(1);
    new 
victim read_data(2);
    new 
ikiller[33], ivictim[33];
    
get_user_name(killerikiller32)
    
get_user_name(victimivictim32)
        
    if( 
victim != killer )
    {
        if(
KilledByVehicle[victim]) {
            
ColorChat(0BLUE"%s Killed %s with a Car !"ikillerivictim)
        }
    }
    
KilledByVehicle[victim] = false;

Lolz123 is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 06-20-2011 , 17:41   Re: Car accident help
Reply With Quote #2

in this car accident, player is killed by worldspawn (i think), not by a player, thats why it returns servers name in get_user_name

Last edited by jimaway; 06-20-2011 at 17:45.
jimaway is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:35.


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