AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Deathmessage (https://forums.alliedmods.net/showthread.php?t=128804)

edgaras85 06-05-2010 15:35

Deathmessage
 
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

hleV 06-05-2010 16:17

Re: Deathmessage
 
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>);



edgaras85 06-05-2010 16:40

Re: Deathmessage
 
Quote:

Originally Posted by hleV (Post 1200719)
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?

Bugsy 06-05-2010 18:08

Re: Deathmessage
 
That would be the id of terrorist player who will be shown in the deathmsg.

edgaras85 06-05-2010 18:19

Re: Deathmessage
 
Quote:

Originally Posted by Bugsy (Post 1200785)
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

Bugsy 06-05-2010 20:19

Re: Deathmessage
 
There are many ways to do this. Easiest would be with get_players or you can loop through all players.

edgaras85 06-06-2010 00:40

Re: Deathmessage
 
Quote:

Originally Posted by Bugsy (Post 1200872)
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]);
        }
     }



hleV 06-06-2010 03:53

Re: Deathmessage
 
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);
        }



edgaras85 06-06-2010 05:18

Re: Deathmessage
 
Thanks
ACIU ^^


All times are GMT -4. The time now is 05:27.

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