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

Best way to block vehicle kills


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 07-31-2014 , 13:11   Best way to block vehicle kills
Reply With Quote #1

Let's get on the topic - I'm trying to find the best way to block any kills with any kind of vehicle. Allright, I had some ideas (which may sound suuper srupid):
- registering message (get_user_smgid("DeathMsg")) and check if the weapon entity is "vehicle". Allright, but how to block (set_msg_block?). And also, how to prevent player from death - just continue pushing by the vehicle or just set his origin away from the vehicle ent?
- registering Ham_TakeDamage, where to check if inflictor is "vehicle" and then return the ham_supercede. But is this ham even called on vehicle kill?!


I'm still thinking that the first way is better, but have no clear idea how to fully block the killing and prevent player from dying... Thanks!
__________________

Last edited by Flick3rR; 07-31-2014 at 13:11.
Flick3rR is offline
Send a message via Skype™ to Flick3rR
NikKOo31
Senior Member
Join Date: May 2013
Location: Home
Old 07-31-2014 , 15:03   Re: Best way to block vehicle kills
Reply With Quote #2

Set godmode for a few seconds (?)
__________________
Hey ^_^
NikKOo31 is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 07-31-2014 , 17:14   Re: Best way to block vehicle kills
Reply With Quote #3

Mmm, I don't know if it's the best way, since when he should die, something unknown will be done... Like flying the player away or stucking him somewhere, idk... Just guessing.
Waiting for some ideas, maybe...
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
NikKOo31
Senior Member
Join Date: May 2013
Location: Home
Old 07-31-2014 , 17:39   Re: Best way to block vehicle kills
Reply With Quote #4

Quote:
Originally Posted by Flick3rR View Post
Mmm, I don't know if it's the best way, since when he should die, something unknown will be done... Like flying the player away or stucking him somewhere, idk... Just guessing.
Waiting for some ideas, maybe...
Godmode + Noclip + Speed = 0 (?

I know, I'm a fucking genius (?
__________________
Hey ^_^
NikKOo31 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 07-31-2014 , 18:20   Re: Best way to block vehicle kills
Reply With Quote #5

I think you can loop through all "func_vehicle" entities and put their pev_dmg to 0, that should do it, no more drive-overs.
klippy is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 07-31-2014 , 19:12   Re: Best way to block vehicle kills
Reply With Quote #6

Okay, but what's the best way to get entity's index from DeathMsg message? What does exactly read_data(4) or in this case get_msg_arg_string(4) return - is the string classname, or what, and how to get entity index from that string? FindEntityBy_ what?
Plus, where exactly to set pev_dmg to 0 to prevent making eny damage, do I have to do it directly in the message hook?
Thanks!
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 07-31-2014 , 20:32   Re: Best way to block vehicle kills
Reply With Quote #7

Just check for every "func_vehicle" in plugin_init() and set theirs pev_dmg to 0, that's all to it.
klippy is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 07-31-2014 , 20:50   Re: Best way to block vehicle kills
Reply With Quote #8

Quote:
Originally Posted by KliPPy View Post
Just check for every "func_vehicle" in plugin_init() and set theirs pev_dmg to 0, that's all to it.
Just like this? And that's all? :O
PHP Code:
#include <amxmodx>
#include <fakemeta>

public plugin_init()
{
    
register_plugin("No Vehicle Kills""1.0""Flicker")
    
    new 
ent FM_NULLENT
    
    
    
while((ent engfunc(EngFunc_FindEntityByStringent"classname""func_vehicle")))
        
set_pev(entpev_dmg0)

__________________

Last edited by Flick3rR; 07-31-2014 at 20:54.
Flick3rR is offline
Send a message via Skype™ to Flick3rR
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 07-31-2014 , 21:41   Re: Best way to block vehicle kills
Reply With Quote #9

Quote:
Originally Posted by Flick3rR View Post
Just like this? And that's all? :O
PHP Code:
#include <amxmodx>
#include <fakemeta>

public plugin_init()
{
    
register_plugin("No Vehicle Kills""1.0""Flicker")
    
    new 
ent FM_NULLENT
    
    
    
while((ent engfunc(EngFunc_FindEntityByStringent"classname""func_vehicle")))
        
set_pev(entpev_dmg0)

You should have tested it before posting here, but yes, that should be it, only if I haven't mistaken damage amount field, but since it says the key is "dmg" in VHE keyvalue, I guess it is pev_dmg indeed. I know for sure that pev_impulse is max speed(can be found in HLSDK).

Last edited by klippy; 07-31-2014 at 22:05.
klippy is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 08-05-2014 , 16:48   Re: Best way to block vehicle kills
Reply With Quote #10

Well, will have to say that it doesn't work... It still kills the player.
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
Reply


Thread Tools
Display Modes

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 06:52.


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