03.12.2010, 17:46
(
Последний раз редактировалось Hiddos; 03.12.2010 в 18:17.
)
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:
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?
Obviously, what would a script be worth if you couldn't tweak it easily yourself?
You can tweak the following settings:
Here's some example usage:
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
Downloads
PasteBin.com
SolidFiles
Credits
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.
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.
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.
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!
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;
}
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