Hi there again all
Again i am need of some help regarding a pilot reward script that i would very much like to make a bulk standard reward script for our clan pilots
This script was orginally done by Pixel and is as follows
1. In the initLine of the choppers you need a "getin" eventhandler (it is triggered when you enter the vehicle
this addEventHandler ["GetIn", {nul = [_this select 0,_this select 1] execVM "scorepilot
2. You need some GLOBAL variables that are evaluated in the script
currentMission = "name current objective"; // when you get in the chopper it tells you where to go
pilotlist = []; // to make sure players don't cheat and get points getting in and out airplane/ make an array in the init.sqf or playerinit.sqf
missionpos = [x,y,z]; //coordinate to calculate the distance to the objective you have to fly to land and get points as a pilot
if (!local player) exitwith {};
private ["_player","_vehicle","_isPilot","_i","_q","_passengers"];
_player = player;
_vehicle = _this select 0;
_isPilot = _this select 1;
// only run if player is pilot
if (_player != driver _vehicle) exitWith {};
If (_isPilot == "driver") then
{
hint format["Get passengers and\nfly them to %1",currentMission];
sleep 3;
hint "";
_i = round (getPos _vehicle select 2);
while {_i != -100} do
{
// make a delay of 2 minutes to make sure player is getting score once
if (name _player in pilotlist) then {sleep 120; pilotlist = pilotlist - [name _player]};
// flight to missionobjective
if (800 > _vehicle distance missionpos) then
{
hint format ["%1 area",currentMission];
sleep 0.5;
hint "";
sleep 0.5;
hint format ["%1 area",currentMission];
sleep 3;
hint "";
_q = round (getPos _vehicle select 2);
while {_q != -100} do
{
//landing
if (round (getPos _vehicle select 2) < 3) then
{
if ((!(name _player in pilotlist))) then
{
//count passengers
_vehicle = _this select 0;
_passengers = crew _vehicle;
{
if ((!isplayer _x) or (_x == driver _vehicle)) then {
_passengers = _passengers - [_x];
};
} foreach _passengers;
sleep 2;
hint "";
//add pilotscore
_player addscore count _passengers;
// pospone pilotscore reoccurance
pilotlist = pilotlist + [name _player];
};
};
_q = if (_player == vehicle _player || 800 < _vehicle distance missionpos || !alive _player) then {-100} else {round (getPos _vehicle select 2)};
sleep 1;
};
};
_i = if (_player == vehicle _player || !alive _player) then {-100} else {round (getPos _vehicle select 2)};
sleep 1;
};
};
The changes i would very much like to have within this reward script is that it could also be used on an airplane dropping paratroopers and cargo
However i am not a scripter at all,
Could someone be kind enough to help me change this (Naturally all credits will to be the Person that helped and Pixel as this is his script originally)
The part i would like to have changed is that Mission Pos and current Mission Name be changed to have the passenger (player ) to mapclick where he wants to be dropped off
I need this to work for both airplanes and choppers
As this will allow that the pilot gets score
again many thanks in advance for any help given