Raised This Month: $ Target: $400
 0% 

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 , 19:12   Re: Best way to block vehicle kills
Reply With Quote #1

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 #2

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 #3

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 #4

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
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 13:10.


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