SA-MP Forums Archive
Hydra damage - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Hydra damage (/showthread.php?tid=424040)



Hydra damage - Squirrel - 20.03.2013

Hello guys, well I am building some sort of TDM and there are hydras in it, is it somehow possible to reduce their damage? Or for example disable CTRL key for few seconds?


Re: Hydra damage - Misiur - 20.03.2013

https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange - detect if fire was pressed, add timer with cooldown, done


Re: Hydra damage - Squirrel - 20.03.2013

I tried with that but there arent actually ways to disable the button itself.
For example I tried with.
Quote:

if(PRESSED(KEY_FIRE)) return 0;

But the issue is that I cannot find any way to disable the button. If you add if he/she presses the button and add key fire it wont stop him from shooting the hydra flare.


Re: Hydra damage - Misiur - 20.03.2013

Ok, sorry, I didn't think that through. https://sampwiki.blast.hk/wiki/OnPlayerTakeDamage is what you are looking for. Just make sure damager is in hydra, and the reason is explosion/rocket


Re: Hydra damage - Squirrel - 20.03.2013

So how should it be for example?
Quote:

if(IsPlayerInVehicle(playerid, 1))
{
if(issuerid != INVALID_PLAYER_ID && weaponid == 51))
{
what here?
}
}




Re: Hydra damage - MP2 - 20.03.2013

You can't detect if a player kills a player by blowing up their vehicle which sucks. You could detect it with angles and projections (like a line of sight sort of thing) and a timer/distance but it would be difficult and unreliable. I've been waiting for this to be added for years.


Re: Hydra damage - Squirrel - 20.03.2013

Pfff, so no chance in reducing any type of vehicle weapon? Or disabling a key or such?

If not I guess I'll have to freeze player each time he shoots :/


Edit: I mean like there is not 100 percent sure way to do it like detect.w