AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Shows 2 deaths (https://forums.alliedmods.net/showthread.php?t=17188)

v3x 08-27-2005 03:22

Shows 2 deaths
 
Here's what I use to handle the kill ( KleeneX's, but modified by me ):
Code:
stock log_kill(killer, victim, weapon[],headshot) {     user_silentkill(victim)     make_deathmsg(killer,victim,headshot,weapon)         if(get_user_team(killer)!=get_user_team(victim))         set_user_frags(killer,get_user_frags(killer) +1);     if(get_user_team(killer)==get_user_team(victim))         set_user_frags(killer,get_user_frags(killer) -1);             message_begin(MSG_BROADCAST,get_user_msgid("ScoreInfo"));     write_byte(killer);     write_short(get_user_frags(killer));     write_short(cs_get_user_deaths(killer));     write_short(0);     write_short(1);     message_end();             new kname[32], vname[32], kauthid[32], vauthid[32], kteam[10], vteam[10];     get_user_name(killer, kname, 31);     get_user_team(killer, kteam, 9);     get_user_authid(killer, kauthid, 31);       get_user_name(victim, vname, 31);     get_user_team(victim, vteam, 9);     get_user_authid(victim, vauthid, 31);             log_message("^"%s<%d><%s><%s>^" killed ^"%s<%d><%s><%s>^" with ^"%s^"",     kname, get_user_userid(killer), kauthid, kteam,     vname, get_user_userid(victim), vauthid, vteam, weapon);     return PLUGIN_CONTINUE; }
Now, my problem is that sometimes it won't block the actual death message itself ( the one from CS ). So then it'll show 2 death messages sometimes.

Now, here's my damage function:
Code:
public BulletDamage(id,attacker) {     new iDmg = get_cvar_num("VM_silverbullets_damage");         if(get_user_team(id) != get_user_team(attacker))     {         if(get_user_health(id) > iDmg)         {             fakedamage(id,"Silver Bullets",float(iDmg),DMG_BULLET);             #if defined DEBUG                 client_print(attacker,print_chat,"[VM] You did damage with silver bullets");             #endif         }         else             log_kill(attacker,id,"Silver Bullets",0);     }     return; }
Any ideas? Or maybe someone has a better way of doing this. Thanks :)

Freecode 08-27-2005 03:36

where do you block the deathmsg>??

v3x 08-27-2005 03:43

Code:
user_silentkill(victim)
I kill him, then make my own death message.

Freecode 08-27-2005 03:45

post that function too 8)

v3x 08-27-2005 03:46

Ahem :)
http://amxmodx.org/funcwiki.php?go=func&id=404

GHW_Chronic 08-27-2005 03:47

Quote:

Originally Posted by v3x

O DISS! MESSED YOU UP!

Freecode 08-27-2005 03:58

anyways beyond the stupid comments by GHW.
v3x id imagine that something is broken inside block msg if it doesnt block like you say. But it seems to me that log_kill might be getting called twice at once. throw in a debug message in there to see how many times it gets called when you get 2 deathmsg's

v3x 08-27-2005 04:00

Well.. What I meant was that the original deathmsg gets called ( the one coming from CS itself ), and then mine gets called.

GHW_Chronic 08-27-2005 04:01

Quote:

Originally Posted by v3x
Well.. What I meant was that the original deathmsg gets called ( the one coming from CS itself ), and then mine gets called.

i understood that....

Freecode 08-27-2005 04:01

and you know the original gets called how?
ill check the block_msg native in a sec
GHW: Keep yourself outta this. Thank You


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

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