SA-MP Forums Archive
[FilterScript] Minigun on tanks - 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] Minigun on tanks (/showthread.php?tid=280678)



Minigun on tanks - Mean - 02.09.2011

What this does, is it puts a MINIGUN onto your tank and you can shoot it by holding the handbrake key (default = space). You can also kill someone with it!

How to install?
First, open up the script and edit the MAX_PLAYERS definition to your slots, if you have more than 5 tanks in your server also change the MAX_MINIGUNS define, and then find this part in the filterscript:

pawn Код:
public OnPlayerDeath( playerid, killerid, reason ) {
    // Paste your OnPlayerDeath here!
    return 1;
}
Paste your OnPlayerDeath in there so it can get called when you kill someone with the minigun, calls with CallLocalFunction.

Screenshots/videos?
Of course:


[ame]http://www.youtube.com/watch?v=-aPi32JXk70[/ame]

Download:
Pastebin!

Worktime: ~4 hours.

Feel free to edit!

Credits:
Mean for most of the stuff,
decondelite because he has some M4's on some cars in his server, but not tanks, so I wanted to make it for tanks... So basically for the idea,
****** for GetXYInFrontOfPlayer.

EDIT:
Small bug found!
Replace:
pawn Код:
new Float:hp;
GetPlayerHealth( u, hp );
SetPlayerHealth( u, hp - 5 );
PlayerPlaySound( u, 1135, 0.0, 0.0, 0.0 );
if( hp < 1 )
    CallLocalFunction( "OnPlayerDeath", "ddd", u, i, 38 );
with:
pawn Код:
new
    Float:hp
    ,Float:hp2
;
GetPlayerHealth( u, hp );
SetPlayerHealth( u, hp - 5 );
GetPlayerHealth( u, hp2 );
PlayerPlaySound( u, 1135, 0.0, 0.0, 0.0 );
if( hp2 < 1 )
    CallLocalFunction( "OnPlayerDeath", "ddd", u, i, 38 );
If you don't do this, OnPlayerDeath won't get called properly.


Re: Minigun on tanks - Meinstad - 02.09.2011

Wow nice. 1st!

Testing now


Re: Minigun on tanks - Cameltoe - 02.09.2011

Looks good !


Re: Minigun on tanks - Mean - 02.09.2011

Thanks. By the way: you can remove the a_npc include because I needed it for something and I removed that part, forgot to remove the include.


Re: Minigun on tanks - Lorenc_ - 02.09.2011

Does it really have that firing effect?


Re: Minigun on tanks - Mean - 02.09.2011

Yes, you may try it. It's a particle.


Re: Minigun on tanks - iPLEOMAX - 02.09.2011

Good release Mean. =)

Whoever does a positive reply will like decondelite's works too


Re: Minigun on tanks - Mean - 02.09.2011

Thanks, that's true.


Re : Minigun on tanks - Velko - 02.09.2011

OO euh gonna try it this is awйsome


Re: Minigun on tanks - [03]Garsino - 02.09.2011

Can you make a video?