Raised This Month: $51 Target: $400
 12% 

How to register a kill on a player without killing the player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jacken
New Member
Join Date: Nov 2019
Old 11-14-2019 , 14:22   How to register a kill on a player without killing the player
Reply With Quote #1

An example could be if a player was to take over 99 damage with an AWP, instead of killing him, it just registers that -100 damage as a kill on the scoreboard but the player is left unharmed (edit: without having to use sv_godemode)


im not sure if something like this is possible because im still learning sp

Last edited by Jacken; 11-14-2019 at 14:27.
Jacken is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 11-14-2019 , 14:45   Re: How to register a kill on a player without killing the player
Reply With Quote #2

Its possible.

Hook SDKHook_OnTakeDamage for check if damage >= current victim health, remove weapons and add a kill to the player and a dead to the victim with coding.

PHP Code:
stock SetClientFrags(clientvalue)
{
    
SetEntProp(clientProp_Data"m_iFrags"value);
}

stock SetClientDeaths(clientvalue)
{
    
SetEntProp(clientProp_Data"m_iDeaths"value);

__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.


Last edited by Franc1sco; 11-14-2019 at 14:46.
Franc1sco is offline
Send a message via MSN to Franc1sco
Jacken
New Member
Join Date: Nov 2019
Old 11-15-2019 , 03:41   Re: How to register a kill on a player without killing the player
Reply With Quote #3

Quote:
Originally Posted by Franc1sco View Post
Its possible.

Hook SDKHook_OnTakeDamage for check if damage >= current victim health, remove weapons and add a kill to the player and a dead to the victim with coding.
Im not sure how to code this since im still a beginner at sp even though i've been looking over resources and researching it. any way for you to write that part for me so i can use it as a reference?
__________________
still learning sp
Jacken is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 11-16-2019 , 10:51   Re: How to register a kill on a player without killing the player
Reply With Quote #4

Quote:
Originally Posted by Franc1sco View Post
Its possible.

Hook SDKHook_OnTakeDamage for check if damage >= current victim health, remove weapons and add a kill to the player and a dead to the victim with coding.

PHP Code:
stock SetClientFrags(clientvalue)
{
    
SetEntProp(clientProp_Data"m_iFrags"value);
}

stock SetClientDeaths(clientvalue)
{
    
SetEntProp(clientProp_Data"m_iDeaths"value);

Teach him how to send player_death event please, on my phone RN
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
lugui
Senior Member
Join Date: Feb 2016
Location: GetClientAbsOrigin();
Old 11-26-2019 , 08:21   Re: How to register a kill on a player without killing the player
Reply With Quote #5

if the idea is just to make it seem like the player wasn't harmmed, you can get the kill position, respawn the player and teleport him back
__________________
Add me for commissions!
Steam: [U:1:88621772]
Discord: lugui#0889
My Plugins
lugui is offline
supertimor
AlliedModders Donor
Join Date: Sep 2017
Old 11-26-2019 , 09:49   Re: How to register a kill on a player without killing the player
Reply With Quote #6

sdk ontakedamage -> check damage -> if its as you want to shoot fake player_death event
supertimor is offline
cristian20042
AlliedModders Donor
Join Date: Jun 2016
Location: Romania
Old 11-29-2019 , 17:23   Re: How to register a kill on a player without killing the player
Reply With Quote #7

So, you need to make it that when the player takes damage if it's more than his health the damage will be 0 and the attacker will get +1 frag.

I have 4 variations for you:

1. Check if Damage is more than victim's health + Check if the attacker has an AWP
Spoiler


2. Check if Damage is more than victim's health without AWP check
Spoiler


3. Just sets the damage to 0 always and adds 1 frag to the attacker

Spoiler


4. Just sets the damage to 0 always and adds 1 frag to the attacker + check for AWP

Spoiler
__________________
Steam - https://steamcommunity.com/id/sniperheroofficialu/
Discord - SniperHero#8545

Last edited by cristian20042; 11-29-2019 at 17:24.
cristian20042 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 02:22.


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