AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   multiple death messages (https://forums.alliedmods.net/showthread.php?t=29371)

shino 06-04-2006 09:57

multiple death messages
 
here's the code:
Code:
public plugin_init() {     register_plugin( PLUGINNAME, VERSION, AUTHOR )     register_event( "Damage", "DealDamage", "be" ); } public DealDamage( id ) {       new victim,attacker,damage,minnum,weap     victim = id     attacker = get_user_attacker(victim,weap)     damage = read_data(2)     minnum = 0     if(weap == CSW_AK47 || weap == CSW_AUG || weap == CSW_AWP || weap == CSW_DEAGLE ||     weap == CSW_ELITE || weap == CSW_FAMAS || weap == CSW_FIVESEVEN || weap == CSW_G3SG1 ||     weap == CSW_GALI || weap == CSW_GALIL || weap == CSW_GLOCK18 || weap == CSW_HEGRENADE ||     weap == CSW_KNIFE || weap == CSW_M249 || weap == CSW_M3 || weap == CSW_M4A1 ||     weap == CSW_MAC10 || weap == CSW_MP5NAVY || weap == CSW_P228 || weap == CSW_P90 ||     weap == CSW_SCOUT || weap == CSW_SG550 || weap == CSW_SG552 || weap == CSW_TMP ||     weap == CSW_UMP45 || weap == CSW_USP || weap == CSW_XM1014) {                             if( damage > minnum ) {             set_msg_block( get_user_msgid( "DeathMsg" ), BLOCK_ONCE )             user_kill(victim)             message_begin(MSG_ALL,get_user_msgid("DeathMsg"),{0,0,0})             write_byte(attacker)             write_byte(victim)             write_byte( 0 )             write_string( "usp" )             message_end()         }     }         return PLUGIN_CONTINUE }

when somebody is killed, this occures:
[img]http://img462.**************/img462/9849/sample3ux.jpg[/img]

what should i change in the code?

Locks 06-04-2006 12:46

Maybe try removing
Code:
user_kill(victim)
I don't see the purpose of having that since the victim is going to get killed anyways.

Xanimos 06-04-2006 13:01

use user_silentkill to not show a death message.
You may have to leave the msg block because of the way Damage and DeathMsg work.

v3x 06-04-2006 13:56

Code:
stock cs_log_kill(killer, victim, weapon[],headshot) {     user_silentkill(victim);     set_msg_block(get_user_msgid("DeathMsg"),BLOCK_NOT);     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; }

Xanimos 06-04-2006 15:11

where is the "make_deathmsg" function?


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

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