SA-MP Forums Archive
[FilterScript] Flashbang filterscript by CaveDweller - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Flashbang filterscript by CaveDweller (/showthread.php?tid=517332)



Flashbang filterscript by CaveDweller - CaveDweller - 04.06.2014

Flashbang

Overview
This filterscript allows the grenade in San Andreas to double-up as an incendiary flashbang. When a grenade detonates near a player, they will be temporarily blinded and disoriented. They will take some damage (30% of the normal amount) from the grenade, and if the grenade detonates too close to them then there is a chance that they will die. Flashbangs will damage vehicles in the same way that normal grenades do.

This script is a good, fun script to install on deathmatch servers, where the use of a flashbang can give a tactical advantage to a player, or on roleplay servers, where police can use it to defuse tough situations.

Demonstration
[ame="http://www.youtube.com/watch?v=nZzEd6vnvzQ"]Flashbang Demo[/ame]

Usage
To use the script, simply take the .pwn into your /filterscripts/ folder. Open it in Pawno and hit F5 to compile it. When ingame, type /flashbang and throw it - it will affect all nearby players, both friend and foe! You will need YSI to install this as it uses y_commands.

Download
Download from Pastebin
Licensing and Maintenance
I will attempt to provide support for this script however I cannot guarantee it. The script is released under the MIT license so you are free to do as you please with it - if anyone makes a significant improvement/modification to the script then I will incorporate that into the original, with their permission.


Re: Flashbang filterscript by CaveDweller - CaveDweller - 04.06.2014

Small update, went from this:
pawn Code:
case 1:
{
        SetPlayerDrunkLevel(playerid, 10000);
}
case 2:
{
        SetPlayerDrunkLevel(playerid, 8000);
}
case 3:
{
        SetPlayerDrunkLevel(playerid, 6000);
}
case 4:
{
        SetPlayerDrunkLevel(playerid, 4000);
}
case 5:
{
        SetPlayerDrunkLevel(playerid, 2000);
}
case 6:
{
        SetPlayerDrunkLevel(playerid, 0);
        FlashbangSwayLevel[playerid] = -1;
}
to this:

pawn Code:
case 1 .. 6:
{
        SetPlayerDrunkLevel(playerid, 10000 - (2000 * (FlashbangSwayLevel[playerid] - 1)));
        if (FlashbangSwayLevel[playerid] == 6)
                FlashbangSwayLevel[playerid] = -1;
}
Always follow the DRY principle!


Re: Flashbang filterscript by CaveDweller - HitterHitman - 04.06.2014

EPIC EPIC EPIC!!! Good job bro


Re: Flashbang filterscript by CaveDweller - CaveDweller - 04.06.2014

Quote:
Originally Posted by HitterHitman
View Post
EPIC EPIC EPIC!!! Good job bro
Thanks. Feel free to make any suggestions you have in mind.


Re: Flashbang filterscript by CaveDweller - Dignity - 04.06.2014

Great script, well done.


Re: Flashbang filterscript by CaveDweller - CaveDweller - 04.06.2014

*******


Re: Flashbang filterscript by CaveDweller - Excel™ - 04.06.2014

Pretty well done, nice idea..


Re: Flashbang filterscript by CaveDweller - Devil123 - 04.06.2014

nice keep going its really cool


Re: Flashbang filterscript by CaveDweller - DuongNghia - 04.06.2014

- Can't you make this fs don't lose heath when we thrown that grenade??


Re: Flashbang filterscript by CaveDweller - CaveDweller - 04.06.2014

Quote:
Originally Posted by DuongNghia
View Post
- Can't you make this fs don't lose heath when we thrown that grenade??
Yes, I can, but then the player will take no damage from any explosions at all.