forward_return and FMRES_OVERRIDE
This is for my Weapon Immunity plugin, to make players immune to the HE grenade. The idea is to stop a grenade's FindEntityInSphere from returning any players that are immune. This is my code:
Code:
immune[hit][CSW_HEGRENADE] is true. Part of this works, in that I can't take any damage from HE grenades. The message comes up and gives me a valid entity index that isn't me. The problem is that this seemingly stops any more checks from being called afterwards: If I get a bot and turn on friendlyfire, make myself immune and him not, when I throw a grenade at us both, it tells me that I was hit by a grenade, and that it is instead returning 2 (the bot). However, the bot takes no damage (and neither do I, since I'm immune). This is the same functionality as if I were to return FMRES_SUPERCEDE. Why wouldn't this be working? Thanks. |
Re: forward_return and FMRES_OVERRIDE
You are printing the message to 0, everyone, so that is why it says you got hit even though you did not get hit.
But why isn't the bot getting damaged? I'm shooting in the dark, but I'm guessing the forward would be called as many times as there are players in the radius, so just ignore the one time its called for you. Shouldn't you be able to extract the id of the player that is supposed to be hit without this line? Code:
new hit = engfunc(EngFunc_FindEntityInSphere,start,origin,radius) |
Re: forward_return and FMRES_OVERRIDE
Quote:
Quote:
Code:
Quote:
|
Re: forward_return and FMRES_OVERRIDE
Let's see what they'll say: http://forums.alliedmods.net/showthread.php?t=50284
EDIT: stupok69, i believe that you do not realise what's going on, though Avalanche was correct and clarified everithing for you, you have to look at his explanations. |
Re: forward_return and FMRES_OVERRIDE
with this wrong id is no wonder,you use double find_entinsphere and save it on same variable(hit).use this and you see what i mean:
Code:
First have your id,the second the bot id. |
Re: forward_return and FMRES_OVERRIDE
Though in practice it wouldn't really make much difference at least because he said that both players get "immuned". This is happen because of the issue with overriding plus here is the bug with forward_return cell/float
See the link above for details. |
Re: forward_return and FMRES_OVERRIDE
You can use temporary to set this user in godmode during he get this damage.
|
Re: forward_return and FMRES_OVERRIDE
My test shows, mode unset should be done at least not right after that (i.e. not in post call), pre PlayerPreThink will be fine.
And actually I do not see the problem in the parent code. He is skipping the immuned player by returning the next entity index. I believe you just didn't get the concept. |
Re: forward_return and FMRES_OVERRIDE
VEN: So, the root of the problem comes down to...
Quote:
|
Re: forward_return and FMRES_OVERRIDE
Not entirely sure how grenades work in CS, but in NS when they think, and globals->time is greater than or equal to pev->dmgtime, they blow up. You could set god mode on the players you want to be invincible, and then remove it in post.
|
| All times are GMT -4. The time now is 22:26. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.