Best way to block vehicle kills
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! |
Re: Best way to block vehicle kills
Set godmode for a few seconds (?)
|
Re: Best way to block vehicle kills
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... |
Re: Best way to block vehicle kills
Quote:
I know, I'm a fucking genius (? :stupid: |
Re: Best way to block vehicle kills
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.
|
Re: Best way to block vehicle kills
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! |
Re: Best way to block vehicle kills
Just check for every "func_vehicle" in plugin_init() and set theirs pev_dmg to 0, that's all to it.
|
Re: Best way to block vehicle kills
Quote:
PHP Code:
|
Re: Best way to block vehicle kills
Quote:
|
Re: Best way to block vehicle kills
Well, will have to say that it doesn't work... :D It still kills the player.
|
All times are GMT -4. The time now is 13:46. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.