Raised This Month: $ Target: $400
 0% 

Deathmessage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
edgaras85
Senior Member
Join Date: Mar 2010
Location: Lithuania
Old 06-05-2010 , 15:35   Deathmessage
Reply With Quote #1

How i can edit Deathmessage
Like if ct get killed by selfkill : Like ( typing in console "kill" ) in deathmessage would be t killed that guy
and t gets frag
edgaras85 is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 06-05-2010 , 16:17   Re: Deathmessage
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <cstrike>
 
public plugin_init()
        
register_message(get_user_msgid("DeathMsg"), "DeathMsg");
 
public 
DeathMsg()
{
        new 
Killer get_msg_arg_int(1), Victim get_msg_arg_int(2);
 
        if ((!
Killer || Killer == Victim) && cs_get_user_team(Victim) == CS_TEAM_CT)
                
set_msg_arg_int(1ARG_BYTE, <Terrorist ID here>);

__________________
hleV is offline
edgaras85
Senior Member
Join Date: Mar 2010
Location: Lithuania
Old 06-05-2010 , 16:40   Re: Deathmessage
Reply With Quote #3

Quote:
Originally Posted by hleV View Post
PHP Code:
#include <amxmodx>
#include <cstrike>
 
public plugin_init()
        
register_message(get_user_msgid("DeathMsg"), "DeathMsg");
 
public 
DeathMsg()
{
        new 
Killer get_msg_arg_int(1), Victim get_msg_arg_int(2);
 
        if ((!
Killer || Killer == Victim) && cs_get_user_team(Victim) == CS_TEAM_CT)
                
set_msg_arg_int(1ARG_BYTE, <Terrorist ID here>);

What id to write? 1?
edgaras85 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-05-2010 , 18:08   Re: Deathmessage
Reply With Quote #4

That would be the id of terrorist player who will be shown in the deathmsg.
__________________
Bugsy is offline
edgaras85
Senior Member
Join Date: Mar 2010
Location: Lithuania
Old 06-05-2010 , 18:19   Re: Deathmessage
Reply With Quote #5

Quote:
Originally Posted by Bugsy View Post
That would be the id of terrorist player who will be shown in the deathmsg.
How to know id?
Because there will be only one Terrorist
edgaras85 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-05-2010 , 20:19   Re: Deathmessage
Reply With Quote #6

There are many ways to do this. Easiest would be with get_players or you can loop through all players.
__________________
Bugsy is offline
edgaras85
Senior Member
Join Date: Mar 2010
Location: Lithuania
Old 06-06-2010 , 00:40   Re: Deathmessage
Reply With Quote #7

Quote:
Originally Posted by Bugsy View Post
There are many ways to do this. Easiest would be with get_players or you can loop through all players.
Like this?
PHP Code:
#include <amxmodx>
#include <cstrike>
enum _:TEAMS {
   
TE,
   
CT
};
 
public 
plugin_init()
        
register_message(get_user_msgid("DeathMsg"), "DeathMsg");
 
public 
DeathMsg()
{
        new 
Killer get_msg_arg_int(1), Victim get_msg_arg_int(2);
        new 
iPlayers32 ], iNumTEAMS ];
 
     
get_playersiPlayersiNumCT ], "ae""CT" );    get_playersiPlayersiNumTE ], "ae""TERRORIST" );    
     if( 
iNumTE ] > || iNumCT ] > )
     {
        if ((!
Killer || Killer == Victim) && cs_get_user_team(Victim) == CS_TEAM_CT)
  for(new 
0iNum[TE]; i++)
        {
                
set_msg_arg_int(1ARG_BYTEiPlayers[i]);
        }
     }

edgaras85 is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 06-06-2010 , 03:53   Re: Deathmessage
Reply With Quote #8

PHP Code:
#include <amxmodx>
#include <cstrike>
 
new g_MaxPlayers;
 
public 
plugin_init()
{
        
register_message(get_user_msgid("DeathMsg"), "DeathMsg");
 
        
g_MaxPlayers get_maxplayers();
}
 
public 
DeathMsg()
{
        new 
Killer get_msg_arg_int(1), Victim get_msg_arg_int(2);
 
        if ((!
Killer || Killer == Victim) && cs_get_user_team(Victim) == CS_TEAM_CT)
        {      
                new 
Terrorist;
 
                for (new 
Client 1Client <= g_MaxPlayersClient++)
                {
                        if (
cs_get_user_team(Client) != CS_TEAM_T)
                                continue;
 
                        
Terrorist Client;
 
                        break;
                }
 
                if (
Terrorist)
                        
set_msg_arg_int(1ARG_BYTETerrorist);
        }

__________________
hleV is offline
edgaras85
Senior Member
Join Date: Mar 2010
Location: Lithuania
Old 06-06-2010 , 05:18   Re: Deathmessage
Reply With Quote #9

Thanks
ACIU ^^
edgaras85 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 05:27.


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