[Include] Airstrike system - Based on Modern Warfare 2
#1

Okay, I got bored and after a while I decided to release a simple filterscript.

What's it do?
This script lets you choose an area to bomb. It easy to edit all/most values (I #defined 'em ^^) for the optimal experience. I kept it simple, the only functions added are:

pawn Код:
native SetUpPlayerForAirstrike ( playerid ) ; //Used to set up the player to do an airstrike, check the video.
native Airstrike_Init () ; //Inits the script. Can easily be replaced by MapAndreas's standard function.
You MUST use Airstrike_Init() BEFORE using SetUpPlayerForAirstrike or else it WILL NOT WORK!
I suggest you to use Airstrike_Init on a point like OnGameModeInit or OnFilterScriptInit.
What's it look like?
Here's a small video showing multiple times of me using it. I did not test this on an actual server so I don't know about lag!
[ame]http://www.youtube.com/watch?v=IpqxK48NLJU[/ame]

What's its negative side?
  • This script, just like most of my other releases, use the awesome MapAndreas plugin by the SA-MP development team. The problem is that this plugin may use up to 70MB o' RAM
  • This plugin uses a few timers.
What's there to tweak myself?
Obviously, what would a script be worth if you couldn't tweak it easily yourself?
You can tweak the following settings:
pawn Код:
//ALL values below are the STANDARD values. If no values are entered by the user then this will occur.
#define BOMBS 4 //Amount of bombs to be dropped - DO NOT SET THIS TOO HIGH!
#define LOADS  3 //Amount
#define AREA 45 //The Area of Effect in which the bombs will fall. The shape is a square, not a circle.
#define MINIMUM_INTERVAL 3250 // The minimum interval between load drops
#define EXTRA_MAX_INTERVAL 550 // Sort of 'additional' interval
#define EXPLOSION_TYPE 7 //The type of the explosion, check the SA-MP /wiki/Explosion_List for more information.
#define EXPLOSION_RADIUS 8.5 //The radius of the explosion. Dunno if it's worth something but w/e.
Here's some example usage:
pawn Код:
#define BOMBS 8 //8 bombs will be dropped
#define LOADS 1 //There will only be ONE load dropped.
#define AREA 20 //A rather small area.
#define EXPLOSION_TYPE 12 //Explosion type 12, this is the smallest explosion type possible.
#include <airstrike> //You must include the file AFTER you tweak the settings!
This'd result in 8 small explosions in a row. Something like a very small cluster bomb.

Example usage
Here's an example of usage. I highly DISRECOMMEND to use this code as it really SUCKS shit through a straw
pawn Код:
public OnGameModeInit()
{
  Airstrike_Init();
  return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
  SetPVarInt(playerid, "Deaths", GetPVarInt(playerid, "Deaths") + 1);
  if(killerid != INVALID_PLAYER_ID)
  {
    SetPVarInt(killerid, "Kills", GetPVarInt(killerid, "Kills") + 1);
    if(GetPVarInt(killerid, "Kills") == 3) SendClientMessage(killerid, COLOR_WINTERCOW, "Use /gtfo to launch an airstrike!");
  }
  return 1;
}

public OnPlayerCommandText(playerid, cmdtext[]) // I DO recommend using ZCMD, but this is just an example.
{
  if(!strcmp(cmdtext, "/gtfo", true))
  {
    if(GetPVarInt(playerid, "Kills") >= 3) SetUpPlayerForAirstrike(playerid);
    else SendClientMessage(playerid, COLOR_DARKBLUE, "GTFO");
    return 1;
  }
  return 0;
}
Downloads
PasteBin.com
SolidFiles

Credits
  • Major thanks to RSX for helping me with explaining callback hooking
  • Thanks to Y-Less for the tutorial on hooking.
  • Thanks as well to the SA-MP development and Kalcor for MapAndreas
PS: I did not do any tests on an actual public server. If you own a public server and would like to do some tests, please contact me.
Reply


Messages In This Thread
Airstrike system - Based on Modern Warfare 2 - by Hiddos - 03.12.2010, 17:46
Re: Airstrike system - Based on Modern Warfare 2 - by Meinstad - 03.12.2010, 17:50
Re: Airstrike system - Based on Modern Warfare 2 - by WillyP - 03.12.2010, 17:52
Re: Airstrike system - Based on Modern Warfare 2 - by Hiddos - 03.12.2010, 17:59
Re: Airstrike system - Based on Modern Warfare 2 - by The_Moddler - 03.12.2010, 18:02
Re: Airstrike system - Based on Modern Warfare 2 - by Hiddos - 03.12.2010, 18:18
Re: Airstrike system - Based on Modern Warfare 2 - by Dany23 - 03.12.2010, 19:19
Re: Airstrike system - Based on Modern Warfare 2 - by Dime - 03.12.2010, 20:25
Re: Airstrike system - Based on Modern Warfare 2 - by TheDeadLY - 03.12.2010, 20:40
Re: Airstrike system - Based on Modern Warfare 2 - by Kitten - 03.12.2010, 20:53
Re: Airstrike system - Based on Modern Warfare 2 - by WillyP - 03.12.2010, 21:00
Re: Airstrike system - Based on Modern Warfare 2 - by scripter1 - 03.12.2010, 21:07
Re: Airstrike system - Based on Modern Warfare 2 - by WillyP - 03.12.2010, 21:12
Re: Airstrike system - Based on Modern Warfare 2 - by The_Gangstas - 04.12.2010, 02:47
Re: Airstrike system - Based on Modern Warfare 2 - by Scenario - 04.12.2010, 02:54
Re: Airstrike system - Based on Modern Warfare 2 - by Retardedwolf - 04.12.2010, 03:39
Re: Airstrike system - Based on Modern Warfare 2 - by Steven82 - 04.12.2010, 04:57
Re: Airstrike system - Based on Modern Warfare 2 - by DevilG - 04.12.2010, 05:28
Re: Airstrike system - Based on Modern Warfare 2 - by Hiddos - 04.12.2010, 08:20
Re: Airstrike system - Based on Modern Warfare 2 - by WillyP - 04.12.2010, 10:48
AW: Airstrike system - Based on Modern Warfare 2 - by Trooper[Y] - 04.12.2010, 11:14
Re: AW: Airstrike system - Based on Modern Warfare 2 - by Hiddos - 04.12.2010, 11:28
Re: Airstrike system - Based on Modern Warfare 2 - by MrDeath537 - 05.12.2010, 06:21
Re: Airstrike system - Based on Modern Warfare 2 - by Sweet_Mafia™ - 07.12.2010, 10:27
Re: Airstrike system - Based on Modern Warfare 2 - by TheArcher - 07.12.2010, 12:27
Re: Airstrike system - Based on Modern Warfare 2 - by Haydz - 27.12.2010, 00:06
Re: Airstrike system - Based on Modern Warfare 2 - by WillyP - 27.12.2010, 00:07
Re: Airstrike system - Based on Modern Warfare 2 - by Lorenc_ - 27.12.2010, 02:30
Re: Airstrike system - Based on Modern Warfare 2 - by sansko - 27.12.2010, 11:08
Re: Airstrike system - Based on Modern Warfare 2 - by Master_Gangster - 28.12.2010, 00:18
Re: Airstrike system - Based on Modern Warfare 2 - by RenSoprano - 24.08.2012, 09:13
Re: Airstrike system - Based on Modern Warfare 2 - by Lordzy - 11.11.2012, 04:29
Re: Airstrike system - Based on Modern Warfare 2 - by Excel™ - 09.04.2013, 08:00
Re: Airstrike system - Based on Modern Warfare 2 - by MP2 - 09.04.2013, 14:54

Forum Jump:


Users browsing this thread: 3 Guest(s)