Raised This Month: $ Target: $400
 0% 

[SOLVED]Killed self with player?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
powwoww
BANNED
Join Date: Oct 2008
Old 11-27-2009 , 02:25   [SOLVED]Killed self with player?
Reply With Quote #1

I got the problem last week:
The normal killing events show as suicide sometimes(its not always happening)
The client console will print: XXX killed self with player (with suicide hud icon)
Server Log: XXX committed suicide with "player" (world)

Did anyone see this before, plz help ,thanks.
Debug code below, no special weapons( knife,m4a1.etc...)

#include <amxmodx>
#include <hamsandwich>
new logfilename[64]
public plugin_init(){
register_plugin("[DEBUG] Kill Event", "0.1", "Flea")

register_event("DeathMsg", "evDeath", "a")
RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
RegisterHam(Ham_Killed, "player", "fw_PlayerKilled_Post", 1)
get_time("kills%m%d.txt", logfilename, 63)
}
public fw_PlayerKilled(victim, attacker, shouldgib){
new name[32],name1[32]
if(is_user_alive(attacker)) get_user_name(attacker,name,31)
else name="-Suicide-"
get_user_name(victim,name1,31)
log_to_file(logfilename, "[Pre]%s Kill %s", name,name1)
}
public fw_PlayerKilled_Post(victim, attacker, shouldgib){
new name[32],name1[32]
if(is_user_alive(attacker)) get_user_name(attacker,name,31)
else name="-Suicide-"
get_user_name(victim,name1,31)
log_to_file(logfilename, "[post]%s Killed %s", name,name1)
}
public evDeath(){//击杀事件
new kr = read_data(1),vm = read_data(2),name[32],name1[32]
get_user_name(vm,name1,31)
if(!is_user_alive(kr)) log_to_file(logfilename, "[Ev]%s Suicide %d!!!!!!!", name1,kr)
else{
get_user_name(kr,name,31)
log_to_file(logfilename, "[Ev]%s Kill %s", name,name1)
}
}

LOGFILE:
L 11/28/2009 - 128:23: [Pre]wtl Kill Candy*Stars>l.w<W.w //Normal
L 11/28/2009 - 128:23: [Ev]Candy*Stars>l.w<W.w Suicide 0!!!!!!! //WTF ?
L 11/28/2009 - 128:23: [post]wtl Killed Candy*Stars>l.w<W.w //Normal

Now I've got it myself:
set_pev(id,pev_flags,FL_DUCKING,1)
This code forces a player to duck to prevent from being blocked, but the problem is that after using this, when this player kills someone, it will cause the bug.

Last edited by powwoww; 11-29-2009 at 03:51.
powwoww is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-27-2009 , 02:43   Re: Killed self with player?
Reply With Quote #2

Not sure to understand your problem. Maybe you have "special" weapons installed on your server.
__________________
Arkshine is offline
byetovice
Senior Member
Join Date: Nov 2009
Location: Turkey
Old 11-27-2009 , 03:03   Re: Killed self with player?
Reply With Quote #3

PHP Code:
user_slientkill(targetplayer)
make_deathmsg(id,targetplayer,0,"weaponname"
byetovice is offline
powwoww
BANNED
Join Date: Oct 2008
Old 11-27-2009 , 23:49   Re: Killed self with player?
Reply With Quote #4

I'm still confused about the event and ham..
powwoww is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-28-2009 , 15:12   Re: Killed self with player?
Reply With Quote #5

Your code is weird. I'm not sure to understand what you are trying to do.
__________________
Arkshine is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 11-28-2009 , 16:15   Re: Killed self with player?
Reply With Quote #6

He's getting suicide with "player" console messages and he tried to debug the info...

It's your server, are you sure no other plugins or metamod addons can affect this ? remove them all and try again just to be sure... it can be a plugin hooking deathmsg and modifying it so that the killer is himself and weapon is "player" :-?? ... oooor a plugin that allows players to kill with alternate modes... like a player kills another player by dropping in his head, or something... I dunno what you have there.

I tried the debug code (altered a bit) and works just fine:
Code:
// killing a bot:
[Pre]Digi Kill [POD]Pissed Off (97)
[Ev]Digi Kill [POD]Pissed Off (97)
[post]Digi Killed [POD]Pissed Off (97)
// then a kill command:
[Pre](suicide) Kill Digi
[Ev](suicide) Kill Digi
[post](suicide) Killed Digi
PHP Code:
#include <amxmodx>
#include <hamsandwich>
 
public plugin_init()
{
    
register_plugin("[DEBUG] Kill Event""0.1""Flea")
 
    
register_event("DeathMsg""evDeath""a")
 
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled")
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled_Post"1)
}
 
public 
fw_PlayerKilled(victimattackershouldgib)
{
    new 
name[32],name1[32]
 
    
get_user_name(victim,name1,31)
 
    if(
is_user_alive(attacker))
        
get_user_name(attacker,name,31)
    else
        
copy(name31"(suicide)")
 
    
server_print("[Pre]%s Kill %s"name,name1)
}
 
public 
fw_PlayerKilled_Post(victimattackershouldgib)
{
    new 
name[32],name1[32]
 
    
get_user_name(victim,name1,31)
 
    if(
is_user_alive(attacker))
        
get_user_name(attacker,name,31)
    else
        
copy(name31"(suicide)")
 
    
server_print("[post]%s Killed %s"name,name1)
}
 
public 
evDeath()
{
    new 
kr read_data(1),vm read_data(2),name[32],name1[32]
 
    
get_user_name(vm,name1,31)
 
    if(
is_user_alive(kr))
        
get_user_name(kr,name,31)
    else
        
copy(name31"(suicide)")
 
    
server_print("[Ev]%s Kill %s"name,name1)

__________________

Last edited by Hunter-Digital; 11-28-2009 at 16:22.
Hunter-Digital is offline
Reply



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 13:43.


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