So i was studying some python and get fed up with it so i took another look at the scripts off I&A3.1. As we all know vehicles are not included in base protection, leading to the occasional mass TK in base. So i looked at the code a bit and wrote some code that includes vehicle in base protection.
The code:
Spoiler
/* * Description: A script that includes vehicles into the existing * AW-base-protection script. * * Original script by BACONMOP, edited by AW-community */ Hunter1 addEventHandler ["Fired", {params ["_unit", "_weapon", "", "", "", "", "_projectile"]; if (player distance (getMarkerPos "respawn_west") < 300) then { deleteVehicle _projectile; hintC "Don't goof at base. Hold your horses soldier, don't fire inside the base."; } } ];
I tested it with a hunter, a slammer, a ghosthawk, a .50cal turret, a wipeout, a mortar and a greyhawk. The script works for each one. (The wipeout was fun because 1 click equals a burst of 20 rounds, meaning you get more than one of those hints.)
And like with the base i designed: it is, of course, up to whoever it's up to to decide if this gets used or not. I'm just sharing something i made. If you got any questions about it, PM me or post them down here.
Question
Stanhope
So i was studying some python and get fed up with it so i took another look at the scripts off I&A3.1. As we all know vehicles are not included in base protection, leading to the occasional mass TK in base. So i looked at the code a bit and wrote some code that includes vehicle in base protection.
The code:
/*
* Description: A script that includes vehicles into the existing
* AW-base-protection script.
*
* Original script by BACONMOP, edited by AW-community
*/
Hunter1 addEventHandler
["Fired",
{params ["_unit", "_weapon", "", "", "", "", "_projectile"];
if (player distance (getMarkerPos "respawn_west") < 300)
then {
deleteVehicle _projectile;
hintC "Don't goof at base. Hold your horses soldier, don't fire inside the base.";
}
}
];
I tested it with a hunter, a slammer, a ghosthawk, a .50cal turret, a wipeout, a mortar and a greyhawk. The script works for each one. (The wipeout was fun because 1 click equals a burst of 20 rounds, meaning you get more than one of those hints.)
And like with the base i designed: it is, of course, up to whoever it's up to to decide if this gets used or not. I'm just sharing something i made. If you got any questions about it, PM me or post them down here.
Link to comment
Share on other sites
21 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now