Raised This Month: $32 Target: $400
 8% 

How to kill a player without displaying a message on the screen


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FatallError
Junior Member
Join Date: Mar 2004
Location: Russia
Old 04-24-2013 , 03:35   How to kill a player without displaying a message on the screen
Reply With Quote #1

How to kill a player without displaying a message on the screen.

What are the tools to control entity life in the world except ForcePlayerSuicide (client)?
FatallError is offline
Send a message via ICQ to FatallError
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-24-2013 , 05:12   Re: How to kill a player without displaying a message on the screen
Reply With Quote #2

Do you mean by message that kill icon upper-right corner ??
Kill weapon icon

Pre hook event player death and block it, Forceplayersuicide, unhook event.
I don't think this is bad
*edit I added bool to check that client match in player_death event. If multiple deaths appear.
PHP Code:
#include <sdktools>

public OnPluginStart()
{
    
RegConsoleCmd("sm_test"cmdtest);
}

new 
bool:g_bSilent[MAXPLAYERS];

public 
Action:cmdtest(clientargs)
{
    if( 
HookEventEx("player_death"player_deathEventHookMode_Pre) )
    {
        
g_bSilent[client] = true;
        
ForcePlayerSuicide(client);
        
g_bSilent[client] = false;
        
UnhookEvent("player_death"player_deathEventHookMode_Pre);
    }
    return 
Plugin_Handled;
}

public 
Action:player_death(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
victim GetClientOfUserId(GetEventInt(event"userid"));
    if( 
g_bSilent[victim] )
    {
        return 
Plugin_Handled;
    }
    return 
Plugin_Continue;

__________________
Do not Private Message @me

Last edited by Bacardi; 04-24-2013 at 05:19.
Bacardi is offline
FatallError
Junior Member
Join Date: Mar 2004
Location: Russia
Old 04-24-2013 , 05:27   Re: How to kill a player without displaying a message on the screen
Reply With Quote #3

Thank you.
Just right
FatallError is offline
Send a message via ICQ to FatallError
FatallError
Junior Member
Join Date: Mar 2004
Location: Russia
Old 04-24-2013 , 05:30   Re: How to kill a player without displaying a message on the screen
Reply With Quote #4

But on the other hand is still interesting.
Quote:
What are the tools to control entity life in the world except ForcePlayerSuicide (client)?
FatallError is offline
Send a message via ICQ to FatallError
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-24-2013 , 05:57   Re: How to kill a player without displaying a message on the screen
Reply With Quote #5

aa...
GetEntProp
PHP Code:
new health GetEntProp(entityProp_Send"m_iHealth"); 
SetEntityHealth(entity, amount)

Last edited by Bacardi; 04-24-2013 at 05:59.
Bacardi 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 04:04.


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