-
Content Count
154 -
Joined
-
Last visited
-
Medals
Everything posted by curtcooll
-
Trying to make it so that when i get in a vehicle my AI group mates will get in without me having to issue command. if (!isServer) exitWith {}; _playergrp = group player; if (player Getin) then { _playergrp doGetIn; }; if (true) exitWith {};
-
So as you can see the veh respawn works the issue is for some reason since installing the game 2 years later the bottum part does not work when trying to respawn the NPC pilots and gunners etc, It was working not sure what has changed it does give me some sort of bad vehicle type which im guess is something to do with the code where the unitsgrp create group part this script is someone else but the bottum part _unitsgrp = creategroup east; everything from there to the bottum was added by my mate ========================================================= */ if (!isServer) exitWith {}; // Define variables _unit = _this select 0; _delay = if (count _this > 1) then {_this select 1} else {30}; _deserted = if (count _this > 2) then {_this select 2} else {120}; _respawns = if (count _this > 3) then {_this select 3} else {0}; _explode = if (count _this > 4) then {_this select 4} else {false}; _dynamic = if (count _this > 5) then {_this select 5} else {false}; _unitinit = if (count _this > 6) then {_this select 6} else {}; _haveinit = if (count _this > 6) then {true} else {false}; _hasname = false; _unitname = vehicleVarName _unit; if (isNil _unitname) then {_hasname = false;} else {_hasname = true;}; _noend = true; _run = true; _rounds = 0; if (_delay < 0) then {_delay = 0}; if (_deserted < 0) then {_deserted = 0}; if (_respawns <= 0) then {_respawns= 0; _noend = true;}; if (_respawns > 0) then {_noend = false}; _dir = getDir _unit; _position = getPosASL _unit; _type = typeOf _unit; _dead = false; _nodelay = false; _crew = crew _unit; // Start monitoring the vehicle while {_run} do { sleep (2 + random 10); if ((getDammage _unit > 0.8) and ({alive _x} count crew _unit == 0)) then {_dead = true}; // Check if the vehicle is deserted. if (_deserted > 0) then { if ((getPosASL _unit distance _position > 10) and ({alive _x} count crew _unit == 0) and (getDammage _unit < 0.8)) then { _timeout = time + _deserted; sleep 0.1; waitUntil {_timeout < time or !alive _unit or {alive _x} count crew _unit > 0}; if ({alive _x} count crew _unit > 0) then {_dead = false}; if ({alive _x} count crew _unit == 0) then {_dead = true; _nodelay =true}; if !(alive _unit) then {_dead = true; _nodelay = false}; }; }; // Respawn vehicle if (_dead) then { if (_nodelay) then {sleep 0.1; _nodelay = false;} else {sleep _delay;}; if (_dynamic) then {_position = getPosASL _unit; _dir = getDir _unit;}; sleep 0.1; deleteVehicle _unit; sleep 2; _unit = _type createVehicle _position; _unit setPosASL _position; _unit setDir _dir; if (_haveinit) then {[[netID _unit, _unitinit], "fnc_setVehicleInit", true, true] spawn BIS_fnc_MP;}; if (_hasname) then {[[netID _unit, _unitname], "fnc_setVehicleVarName", true, true] spawn BIS_fnc_MP;}; _dead = false; // Check respawn amount if !(_noend) then {_rounds = _rounds + 1}; if ((_rounds == _respawns) and !(_noend)) then {_run = false;}; sleep 1; _unitsgrp = creategroup east; { typeof _x createUnit [getpos _unit, _unitsgrp];} foreach _crew; //helicoptertransport synchronizeObjectsAdd [_unitsGroup]; _unitsGroup = units _unitsgrp; //_unitsgroup = synchronizeObjectsAdd [helicoptertransport]; for [{ _loop = 0 },{ _loop < count _unitsGroup},{ _loop = _loop + 1}] do { _guy = _unitsGroup select _loop; //_guy setSkill (_AI_skillArray select _loop); if (_loop == 0) then {_guy moveInDriver _unit}; if (_loop == 0) then {_guy synchronizeObjectsAdd [helicoptertransport]}; if (_loop == 1) then {_guy moveInTurret [_unit,[0]]}; //if (_loop == 1) then {_guy moveinturret _vcl_new}; sleep 0.1; }; }; };
-
Veh respawn script help
curtcooll replied to curtcooll's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Cheers well 90 percent of my mission works you can respawn into the AI team mates you have if you die, I just made it for a 1v1 with my mate, Its only really a few lines of code that need sorting out to fix the issues, Im going to be taking the respawn script i have and give it to my mate for his server for patrols, I know what the issue is and the line of code that is messed up and thats due to the game change in some sort of function, I think this here is the issue as the veh error issue is whatever if i can figure out what to change, Its just an issue with my autism when something does not work i have to get it fixed other wise it just drives me nuts, If not for helping my mate setup his server i would not be having any issue lol createUnit [getpos _unit, _unitsgrp];} -
Veh respawn script help
curtcooll replied to curtcooll's topic in ARMA 3 - MISSION EDITING & SCRIPTING
yeah what that used to do synchronizeobjectsadd was to resync the system to let you recall heli to wherver you are, I understand what this does and such but what i dont understand is what was changed in arma functions/code so what i need to change, Issue i have with my dexlixa is its gonna take me months to even understand anything let alone fix what has been changed in arma with this script, I guess ill have to wait for my mate if she decides to help me fix it, I know it will take someone who is experinced to fix this is no time, its just annoying that its gonna take me months just to understand the basicis let alone even fix the simple of things, It just sucks i know i had this sorta issue before when arma changed ID of certain things but at least then i was fresh out of uni from coding so it was easy now its not, I appreciate your help but trying to understand what you just send me is like rocket science and with 5 kids its just gonna take months like it did back in 2019 when i started back trying to learn, I understand what im also typing here is hard to understand as my english is terrible. -
Veh respawn script help
curtcooll replied to curtcooll's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I just spoke to my mate and from what she said the functions used in the code could possibly not supported functions in the game which would explain why shop/money system is throwing errors also where would i find where the newer functions that were changed -
Veh respawn script help
curtcooll replied to curtcooll's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Yeah i know the errors im getting with the shop system were issues i had before so i have removed that for now everything else is working the veh respawn is working when i remove the above code but the AI that were in that veh without that code does not work anymore as it used to, Is there a script that i can find that can respawn the AI, I used to have old script that would spawn only the pilot and the pilot would have to then get in to the heli, i just cant work out why its giving bad vehicle type from what i can work out that my mate mate that lot of code i commented out that used to work would create the AI that were in the veh and place them back in there no issue -
Veh respawn script help
curtcooll replied to curtcooll's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I can respawn the veh not and issue but respawn the veh with the AI from before does not work as it used to work, I have removed the shop/money feature for now to resolve all other errors and the bad vehicle type is refer to this bit of code which my mate made which no longer seems to work, It used to work as it would resync the module for calling the heli to wherver but it wont respawn the AI, I used to have a script where it would respawn a single pilot and that pilot would get into the heli but then my mate come up with this. // _unitsgrp = creategroup east; //{ typeof _x createUnit [getpos _unit, _unitsgrp];} foreach _crew; //helicopter synchronizeObjectsAdd [_unitsGroup]; // _unitsGroup = units _unitsgrp; //_unitsgroup = synchronizeObjectsAdd [helicopter]; //for [{ _loop = 0 },{ _loop < count _unitsGroup},{ _loop = _loop + 1}] do //{ // _guy = _unitsGroup select _loop; //_guy setSkill (_AI_skillArray select _loop); // if (_loop == 0) then {_guy moveInDriver _unit}; // if (_loop == 0) then {_guy synchronizeObjectsAdd [helicopter]}; // if (_loop == 1) then {_guy moveInTurret [_unit,[0]]}; //if (_loop == 1) then {_guy moveinturret _vcl_new}; -
Veh respawn script help
curtcooll replied to curtcooll's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I can give you the entire mission so you can see so i have no idea as i have said its been years since ive scripted and its gonna take me weeks just to relearn everything again to even understand alot of the stuff, I honestly dont understand why there are so many errors back in 2020 everything was working fine i made sure even before i unistall the game unless somehow i deleted the complete working one and backup an older version which is possible -
Veh respawn script help
curtcooll replied to curtcooll's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Its the correct script, im still getting the bad vehicle type error, I just have so many different back ups had find out which was the latest one, I have the latest backup and it would seem that for whatever reason stuff is broke -
Veh respawn script help
curtcooll replied to curtcooll's topic in ARMA 3 - MISSION EDITING & SCRIPTING
q -
Veh respawn script help
curtcooll replied to curtcooll's topic in ARMA 3 - MISSION EDITING & SCRIPTING
oh ok i found it https://pastebin.com/YTtuaW93 -
Veh respawn script help
curtcooll replied to curtcooll's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I just made a pastebin and the error is bad veh type thats all i get the veh spawns but ai does not and it was working back in 2020 100 percent as my mate help me with the part to spawn AI back into veh, I know prev that bad veh type refers to ID is wrong or something along those lines https://pastebin.com/QMcn6ZPF -
Empty vehicles showing up as enemy.
curtcooll posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
For some reason i got a vehicle with AI unit spawn into it but some reason its showing up as if it is a enemy vehicle even the ai units react to it and say enemy vehicle, but AI friendly is in the chopper its empty vehicle how can i make empty vehicle be a friendly, without spawning a a helicopter with ai already in it. -
I made a game mode a while ago using vehicle re spawn but implemented my own part to the script which allows for Ai pilot to re spawn and re sync the module to call for helicopter, I made this during beta and the script no longer works. If someone could help me out. /* ================================================================================================================== Simple Vehicle Respawn Script v1.8 for Arma 3 by Tophe of Östgöta Ops [OOPS] Put this in the vehicles init line: veh = [this] execVM "vehicle.sqf" Options: There are some optional settings. The format for these are: veh = [object, Delay, Deserted timer, Respawns, Effect, Dynamic] execVM "vehicle.sqf" Default respawn delay is 30 seconds, to set a custom respawn delay time, put that in the init as well. Like this: veh = [this, 15] execVM "vehicle.sqf" Default respawn time when vehicle is deserted, but not destroyed is 120 seconds. To set a custom timer for this first set respawn delay, then the deserted vehicle timer. (0 = disabled) Like this: veh = [this, 15, 10] execVM "vehicle.sqf" By default the number of respawns is infinite. To set a limit first set preceding values then the number of respawns you want (0 = infinite). Like this: veh = [this, 15, 10, 5] execVM "vehicle.sqf" Set this value to TRUE to add a special explosion effect to the wreck when respawning. Default value is FALSE, which will simply have the wreck disappear. Like this: veh = [this, 15, 10, 5, TRUE] execVM "vehicle.sqf" By default the vehicle will respawn to the point where it first was when the mission started (static). This can be changed to dynamic. Then the vehicle will respawn to the position where it was destroyed. First set all preceding values then set TRUE for dynamic or FALSE for static. Like this: veh = [this, 15, 10, 5, TRUE, TRUE] execVM "vehicle.sqf" If you you want to set the INIT field of the respawned vehicle, first set all other values, then set init commands. Those must be inside quotations. Like this: veh = [this, 15, 10, 5, TRUE, FALSE, "this setDammage 0.5"] execVM "vehicle.sqf" Default values of all settings are: veh = [this, 30, 120, 0, FALSE, FALSE] execVM "vehicle.sqf" Contact & Bugreport: cwadensten@gmail.com ================================================================================================================== */ if (!isServer) exitWith {}; // Define variables _unit = _this select 0; _delay = if (count _this > 1) then {_this select 1} else {30}; _deserted = if (count _this > 2) then {_this select 2} else {120}; _respawns = if (count _this > 3) then {_this select 3} else {0}; _explode = if (count _this > 4) then {_this select 4} else {false}; _dynamic = if (count _this > 5) then {_this select 5} else {false}; _unitinit = if (count _this > 6) then {_this select 6} else {}; _haveinit = if (count _this > 6) then {true} else {false}; _hasname = false; _unitname = vehicleVarName _unit; if (isNil _unitname) then {_hasname = false;} else {_hasname = true;}; _noend = true; _run = true; _rounds = 0; if (_delay < 0) then {_delay = 0}; if (_deserted < 0) then {_deserted = 0}; if (_respawns <= 0) then {_respawns= 0; _noend = true;}; if (_respawns > 0) then {_noend = false}; _dir = getDir _unit; _position = getPosASL _unit; _type = typeOf _unit; _dead = false; _nodelay = false; _crew = crew _unit; // Start monitoring the vehicle while {_run} do { sleep (2 + random 10); if ((getDammage _unit > 0.8) and ({alive _x} count crew _unit == 0)) then {_dead = true}; // Check if the vehicle is deserted. if (_deserted > 0) then { if ((getPosASL _unit distance _position > 10) and ({alive _x} count crew _unit == 0) and (getDammage _unit < 0.8)) then { _timeout = time + _deserted; sleep 0.1; waitUntil {_timeout < time or !alive _unit or {alive _x} count crew _unit > 0}; if ({alive _x} count crew _unit > 0) then {_dead = false}; if ({alive _x} count crew _unit == 0) then {_dead = true; _nodelay =true}; if !(alive _unit) then {_dead = true; _nodelay = false}; }; }; // Respawn vehicle if (_dead) then { if (_nodelay) then {sleep 0.1; _nodelay = false;} else {sleep _delay;}; if (_dynamic) then {_position = getPosASL _unit; _dir = getDir _unit;}; if (_explode) then {_effect = "M_AT" createVehicle getPosASL _unit; _effect setPosASL getPosASL _unit;}; sleep 0.1; deleteVehicle _unit; sleep 2; _unit = _type createVehicle _position; _unit setPosASL _position; _unit setDir _dir; if (_haveinit) then {_unit setVehicleInit format ["%1;", _unitinit]; processInitCommands;}; if (_hasname) then {_unit setVehicleInit format ["%1 = this; this setVehicleVarName ""%1""",_unitname]; processInitCommands;}; _dead = false; // Check respawn amount if !(_noend) then {_rounds = _rounds + 1}; if ((_rounds == _respawns) and !(_noend)) then {_run = false;}; sleep 1; _unitsgrp = creategroup east; { typeof _x createUnit [getpos _unit, _unitsgrp];} foreach _crew; //helicoptertransport synchronizeObjectsAdd [_unitsGroup]; _unitsGroup = units _unitsgrp; //_unitsgroup = synchronizeObjectsAdd [helicoptertransport]; for [{ _loop = 0 },{ _loop < count _unitsGroup},{ _loop = _loop + 1}] do { _guy = _unitsGroup select _loop; //_guy setSkill (_AI_skillArray select _loop); if (_loop == 0) then {_guy moveInDriver _unit}; if (_loop == 0) then {_guy synchronizeObjectsAdd [helicopter]}; if (_loop == 1) then {_guy moveInTurret [_unit,[0]]}; //if (_loop == 1) then {_guy moveinturret _vcl_new}; sleep 0.1; }; }; };
-
Vehicle Respawn (Issue)
curtcooll replied to curtcooll's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Dammit i have tried using other re spawn scripts but they don't do much they re spawn vehicle but not original vehicle the script i had re spawned the vehicle and the pilot and co pilot , is there anyone that knows a workaround ---------- Post added at 12:28 ---------- Previous post was at 12:00 ---------- Fixed it now -
[SP]Dynamic Universal War System (DUWS alpha0.1)
curtcooll replied to kibot's topic in ARMA 3 - USER MISSIONS
Ok i tried to manual place enemy zones but the init.sqf file is located in a folder in my downloads section, It does nothing when i change values to true any reason for this? -
Force First Person in vehicle only request
curtcooll posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Need help on trying to force first person when in vehicle or just helicopter. -
Ok I've simulated helicopter crash perfect 2 issues, as I'm using Unitcapture for this works great also force first person due to the shuttering issue, well here the part that i dont understand. If i play say the medic or copilot and my freind plays group leader the AI messes up the unitplay, but if i play as group leader the AI unit plays out the crash perfect. If you dont understand ill post a video of what AI does. is there a way i can make the unitplay feature server side the unitplay works in multi player but i have to choose the group leader.
-
Im trying to make it so that you get money for AI kills when you purchase AI units for your team and kill them you get teamkill punished and get money for ai group kills trying to rework this below script to do such that. at the moment the below script gives you money for player kills. /* Script written by TeeTime dont remove this comment */ //Functions //Debug Tee_Debug_Spawn = { //[] spawn Tee_Player_TK_Punish; /* _mags = magazines player; player groupchat str _mags; diag_log str _mags; */ //call Tee_Base_Set_Base; //call Tee_AttackTown; //_marker = createMarker ["Test", getPos player]; //[] call Tee_CreateTownMarker; // ServicePoint Building : Military Cargo House V1 (Land_Cargo_House_V1_F) // Baracks : Military Cargo HQ V1 (Land_Cargo_HQ_V1_F) // ComandPost : Military Cargo OP V1 (Land_Cargo_Patrol_V1_F)!?! nicht sicher _veh = createVehicle ["Land_Cargo_HQ_V1_F",getPos player,[],0,""]; }; Tee_Debug_Spawn_Weapon = { //[base_1,base_2] call Tee_Marker_ConnectMarker; //[base_2,base_4] call Tee_Marker_ConnectMarker; //[player] call Tee_Town_CreateAIDef; //_mags = weapons player; //player groupchat str _mags; //diag_log str _mags; //player addMagazine "30Rnd_65x39_caseless_green"; //player addWeapon "arifle_Khaybar_ACO_point_F"; }; Tee_Debug_Teleport = { onMapSingleClick "player setPos _pos;"; }; //**************************************** //Basic //**************************************** Tee_Init_Client = { if(playerside == west) then { TW_playerside = "west"; TW_playerside_colour = "ColorBlue";}; if(playerside == east) then { TW_playerside = "east"; TW_playerside_colour = "ColorRed";}; //if(player in TW_westplayer_array) then { TW_playerside = "west"; TW_playerside_colour = "ColorBlue";}; //For Later //if(player in TW_eastplayer_array) then { TW_playerside = "east"; TW_playerside_colour = "ColorRed";}; //For Later player addEventHandler ["killed", "_this call Tee_Player_Killed;"]; "TW_Vote_Start" addPublicVariableEventHandler {[] spawn Tee_Vote_Started;}; "TW_Player_Killed" addPublicVariableEventHandler {TW_Player_Killed call Tee_Player_Killed_Pub;}; "TW_Town_Taken" addPublicVariableEventHandler {TW_Town_Taken call Tee_Town_Caputred_2;}; "TW_Mission_End" addPublicVariableEventHandler { if(TW_restart) then { [] spawn Tee_Client_Restart; } else { endMission "END1"; }; }; }; Tee_Client_Restart = { titleText["Mission ended and will be restarted in 15 seconds.", "PLAIN DOWN"]; //Msg sleep 15; Tee_Konto = 1000; [] spawn Tee_Client_Base_Build_West; //TeeTimeTest [] spawn Tee_Client_Base_Build_East; //TeeTimeTest titleText["Mission Restarted", "PLAIN DOWN"]; //Msg TW_Mission_End = false; }; //******************************* //Voting //******************************* /* Called by player who init the Vote */ Tee_Vote_Start = { private ["_kind","_text","_result","_return"]; _kind = _this select 0; //What kind of Vote is it can be "HQ", //Check and activate Vote if(TW_Voting) exitWith {titleText ["Please wait there is already a active Voting.", "PLAIN DOWN"];}; //Msg TW_Voting = true; //Reset _return = false; TW_Vote_Result = _return; //Own Vote TW_Vote_Votes = [1,0]; publicVariable "TW_Vote_Votes"; TW_Vote_Start = [TW_playerside,_kind,name player]; publicVariable "TW_Vote_Start"; _text = format ["You started a vote. The Team has now %1 Seconds to vote.",TW_Vote_Time]; titleText [_text, "PLAIN DOWN"]; //Msg if(debug) then {TW_Vote_Start spawn Tee_Vote_Started;}; sleep TW_Vote_Time; _text = format ["Voting ended. Resulst: %1 Yes %2 No",TW_Vote_Votes select 0,TW_Vote_Votes select 1]; titleText[_text, "PLAIN DOWN"]; //Msg _return = if((TW_Vote_Votes select 0) > (TW_Vote_Votes select 1)) then {true} else {false}; TW_Vote_Result = _return; TW_Voting = false; }; /* Called on all players */ Tee_Vote_Started = { private ["_side","_kind","_name","_text","_actioncode","_action","_actionarray"]; _side = _this select 0; //Side who is allowed to vote _kind = _this select 1; //What kind of Vote is it _name = _this select 2; if(_side != TW_playerside) exitWith {}; if(TW_Voting) exitWith {}; TW_Voting = true; if(_kind == "HQ") then { _text = format ["%1 wants to mobilize the HQ. Please vote!",_name]; }; titleText [_text, "PLAIN DOWN"]; //Msg _text = "Vote Yes"; _actioncode = format ["[%1] call Tee_Vote_Vote;",true]; _action = player addAction [_text, AddActionCode,_actioncode]; TW_Vote_Actions = TW_Vote_Actions + [_action]; _text = "Vote No"; _actioncode = format ["[%1] call Tee_Vote_Vote;",false]; _action = player addAction [_text, AddActionCode,_actioncode]; TW_Vote_Actions = TW_Vote_Actions + [_action]; }; /* Vote */ Tee_Vote_Vote = { if(_this select 0) then { TW_Vote_Votes = [(TW_Vote_Votes select 0) + 1,(TW_Vote_Votes select 1)]; } else { TW_Vote_Votes = [(TW_Vote_Votes select 0),(TW_Vote_Votes select 1) + 1]; }; publicVariable "TW_Vote_Votes"; { player removeAction _x; } forEach TW_Vote_Actions; TW_Voting = false; TW_Vote_Actions = []; }; //******************************* //Player //******************************* Tee_SetPlayer = { waitUntil {HQ_placed}; waitUntil {TW_HQ_Placed_Client}; waitUntil {alive player}; if(TW_playerside == "west") then {player setPos (getMarkerPos TW_West_Respawn);}; if(TW_playerside == "east") then {player setPos (getMarkerPos TW_East_Respawn);}; //check sleep 2; if(TW_playerside == "west" && player distance hq_west > 10) then {player setPos (getMarkerPos TW_West_Respawn);}; if(TW_playerside == "east" && player distance hq_east > 10) then {player setPos (getMarkerPos TW_East_Respawn);}; //Make sure that leader is a player muss für player squads angepasst werden TeeTimeTest if(! isPlayer(leader (group (vehicle player)))) then { group player selectLeader player; }; //Welcome Msg sleep 20; titleText["Welcome to TeeTimes Warfare - ALPHA", "PLAIN DOWN"]; //Msg sleep 5; titleText["I hope that you wil enjoy this mission and Arma III. Have in mind its only Alpha!", "PLAIN DOWN"]; //Msg sleep 5; titleText["Here some Tipps:", "PLAIN DOWN"]; //Msg sleep 5; titleText["1. Caputure all Cities to win this mission!", "PLAIN DOWN"]; //Msg sleep 5; titleText["2. The Boxes in your base contain different shops for AI, Vehicle and Weapons.", "PLAIN DOWN"]; //Msg sleep 5; titleText["3. Increase your Income by holding more Cities.", "PLAIN DOWN"]; //Msg sleep 5; titleText["4. Dont Spawncamp the enemy Base!", "PLAIN DOWN"]; //Msg sleep 5; titleText["5. Use AI to capture Towns faster.", "PLAIN DOWN"]; //Msg sleep 5; titleText["6. Use i to open the bought ammo boxes.", "PLAIN DOWN"]; //Msg sleep 5; titleText["Good Luke and Have Fun", "PLAIN DOWN"]; //Msg }; //Called on killed Client Tee_Player_Killed = { private ["_victim","_killer","_side","_pos"]; _victim = _this select 0; _killer = _this select 1; _side = playerSide; //TeeTimeTest kann im Moment nur auf Clients ausgeführt werden! _pos = getPos _victim; if(isPlayer _killer) then { TW_Player_Killed = [_victim,_killer,_side,_pos]; publicVariable "TW_Player_Killed"; }; //For selfhosted Missions if(isServer && isPlayer _killer) then { _this call Tee_Player_Killed_Pub; }; }; //Called on all Clients Tee_Player_Killed_Pub = { private ["_victim","_killer","_side","_text","_group"]; _group = group player; _victim = _this select 0; _killer = _this select 1; _side = _this select 2; _group = _this select 3; _unit = _this select 4; //Bonus if(player == _killer && playerside != _side) then { Tee_Konto = Tee_Konto + Tee_Money_Kill_Bonus; player groupchat format ["You got %1$ for killing %2.",Tee_Money_Kill_Bonus,(name _victim)]; //Msg }; //Punish if(player == _killer && playerside == _side) then { //Punish Tee_Money_TK_Punish call Tee_Money_Substract; _text = format ["You killed a Teammember and lost %1$",Tee_Money_TK_Punish]; titleText[_text, "PLAIN DOWN"]; //Msg //HQ if((player distance hq_west < 20 && TW_playerside == "west") or (player distance hq_east < 20 && TW_playerside == "east")) then { player setDamage 1; titleText["You killed a Teammember near the Base and got killed for this.", "PLAIN DOWN"]; //Msg }; //Kick TW_TK_Counter = TW_TK_Counter + 1; if(TW_TK_Counter >= 3) then { [] spawn Tee_Player_TK_Punish; TW_TK_Counter = 0; TW_Player_Kick = getPlayerUID player; publicVariable "TW_Player_Kick"; }; }; }; //Punish Player for TK Tee_Player_TK_Punish = { private ["_i","_pos"]; _pos = getPos player; titleText["You killed to many Teammates and have to stay here for 5 minutes!", "PLAIN DOWN"]; //Msg for [{_i=0},{_i<300},{_i=_i+30}] do { player setPos [0,0,5]; titleText["Dont TK! First look then shoot!", "PLAIN DOWN"]; //Msg sleep 30; }; player setPos _pos; }; //******************************************* //Money //******************************************* Tee_ShowMoney = { hintSilent format ["Your Account: %1$",Tee_Konto]; //Msg }; Tee_Money_Substract = { if(Tee_Konto > _this) then { Tee_Konto = Tee_Konto - _this; } else { Tee_Konto = 0; }; }; Tee_MoneyLoop = { private ["_i","_count","_enemycount"]; while{true} do { sleep 60; _count = 0; _enemycount = 0; //Basic Tee_Konto = Tee_Konto + Tee_Money_Min; //Towns { _object = _x select 0; if(TW_playerside == _object getVariable "TownSide") then { Tee_Konto = Tee_Konto + Tee_Money_Town; _count = _count + 1; } else { if("civ" != _object getVariable "TownSide") then { _enemycount = _enemycount + 1; }; }; } forEach TW_TownArray; //TK Counter Reduce if(_i >= 10) then { TW_TK_Counter = TW_TK_Counter - 1; _i = 0; }; //End Mission Loser if(_enemycount == count TW_TownArray && !TW_Mission_End) exitWith { TW_Mission_End = true; publicVariable "TW_Mission_End"; }; //End Mission Winner if(_count == count TW_TownArray && !TW_Mission_End) exitWith { TW_Mission_End = true; publicVariable "TW_Mission_End"; }; _i = _i + 1; }; }; Tee_ActionLoop = { private ["_cursertarget","_veh","_invehicle","_action","_money_action","_lock_action","_lock_action2","_lock_action3","_lock_actionarray","_townaction","_money_action2","_town_actionarray","_neartown","_hq_action","_hq_actionarray","_veh_s_action","_veh_s_actionarray","_weap_action","_weap_actionarray","_ai_action","_ai_actionarray","_repairaction","_repairactionarray","_count","_object","_weap_typ","_text","_actioncode"]; _money_action = false; _lock_action = false; _lock_action3 = false; _townaction = false; _neartown = false; _hq_action = false; _veh_s_action = false; _weap_action = false; _ai_action = false; _repairaction = false; _town_actionarray = []; _hq_actionarray = []; _veh_s_actionarray = []; _weap_actionarray = []; _ai_actionarray = []; _repairactionarray = []; while{true} do { //Reset after Death and place Player if(! alive player) then { titleText["You died and will Respawn in 30 Seconds!", "PLAIN DOWN"]; //Msg _money_action = false; player removeAction _money_action2; waitUntil{alive player}; if(! isPlayer(leader (group (vehicle player)))) then { group player selectLeader player; }; if(TW_playerside == "west") then {player setPos (getMarkerPos TW_West_Respawn);}; if(TW_playerside == "east") then {player setPos (getMarkerPos TW_East_Respawn);}; }; //Check Vehicle if(player == vehicle player) then { _invehicle = false; _cursertarget = cursorTarget; } else { _veh = vehicle player; _invehicle = true; }; //Money if(!_money_action) then { _money_action2 = player addAction ["Show Money", AddActionCode,'[] call Tee_ShowMoney;']; _money_action = true; //Debug if(debug) then { player addAction ["Spawn Veh", AddActionCode,'[] call Tee_Debug_Spawn;']; player addAction ["Add Weapon", AddActionCode,'[] call Tee_Debug_Spawn_Weapon;']; player addAction ["Teleport", AddActionCode,'[] call Tee_Debug_Teleport;']; }; }; //Lock Unlock Vehicle if(!_invehicle && (_cursertarget in TW_Vehicle_Client) && (player distance _cursertarget < 5) && !_lock_action3) then { _text = "Lock/Unlock"; _actioncode = format ["[%1] call Tee_Vehicle_Lock;",_cursertarget]; _action = player addAction [_text, AddActionCode,_actioncode]; _lock_actionarray = _lock_actionarray + [_action]; _lock_action3 = true; }; if(!_lock_action && ((player distance _cursertarget > 5) || !(_cursertarget in TW_Vehicle_Client) || _invehicle)) then { { player removeAction _x; } forEach _lock_actionarray; _lock_actionarray = []; _lock_action3 = false; }; //Unlock Action for Player in Vehicles if(_invehicle && !_lock_action) then { //Action _text = "Lock/Unlock"; _actioncode = format ["[%1] call Tee_Vehicle_Lock;",_veh]; _lock_action2 = player addAction [_text, AddActionCode,_actioncode]; _lock_action = true; }; if(!_invehicle && _lock_action) then { player removeAction _lock_action2; _lock_action = false; }; //Townshops if(!_townaction) then { { _object = _x select 0; if(player distance _object < 5 && TW_playerside == _object getVariable "TownSide") then { if(!_invehicle) then { { _text = format ["Buy %1 (%2$)",_x call Tee_GetVeh_Name,_x call Tee_GetVeh_Price]; _actioncode = format ["[%1] call Tee_CreateVehicle;",_x]; _action = player addAction [_text, AddActionCode,_actioncode]; _town_actionarray = _town_actionarray + [_action]; } forEach TW_Vehicle_Shop_Town; } else { //Repair _text = format ["Repair your Vehicle (%1$)",TW_Repair_Cost]; _actioncode = format ["[] spawn Tee_Sup_Repair;"]; _action = player addAction [_text, AddActionCode,_actioncode]; _town_actionarray = _town_actionarray + [_action]; //Refuel _text = format ["Refuel your Vehicle (%1$)",TW_Sup_Fuel_Cost]; _actioncode = format ["[] spawn Tee_Sup_Refuel;"]; _action = player addAction [_text, AddActionCode,_actioncode]; _town_actionarray = _town_actionarray + [_action]; }; _townaction = true; }; } forEach TW_TownArray; } else { { _object = _x select 0; if(player distance _object < 5) then { _neartown = true; } else { _neartown = false; }; } forEach TW_TownArray; if(!_neartown && _townaction) then { { player removeAction _x; } forEach _town_actionarray; _town_actionarray = []; _townaction = false; }; }; //West HQ if((player distance hq_west) < 4 && !_invehicle && !(alive driver hq_west)) then { if(TW_playerside == "west" && !_hq_action) then { //Actions _text = format ["Mobilize HQ"]; _actioncode = format ["[%1] spawn Tee_Client_Base_DeMobHQ;"]; _action = player addAction [_text, AddActionCode,_actioncode]; _hq_actionarray = _hq_actionarray + [_action]; _hq_action = true; }; } else { if(_hq_action && TW_playerside == "west") then { { player removeAction _x; } forEach _hq_actionarray; _hq_actionarray = []; _hq_action = false; }; }; //WestHQ SetUp if(player == (driver hq_west)) then { //Actions _text = format ["Build HQ"]; _actioncode = format ["[%1] call Tee_Client_Base_HQ_setUp;"]; _action = player addAction [_text, AddActionCode,_actioncode]; _hq_actionarray = _hq_actionarray + [_action]; _hq_action = true; }; //West Vehicle if((player distance west_shop_veh) < 4 && !_invehicle) then { if(TW_playerside == "west" && !_veh_s_action) then { titleText["Vehicle Shop", "PLAIN DOWN"]; //Msg //Actions { _text = format ["Buy %1 (%2$)",_x call Tee_GetVeh_Name,_x call Tee_GetVeh_Price]; _actioncode = format ["[%1] call Tee_CreateVehicle;",_x]; _action = player addAction [_text, AddActionCode,_actioncode]; _veh_s_actionarray = _veh_s_actionarray + [_action]; } forEach TW_Vehicle_Shop_West; _veh_s_action = true; }; } else { if(_veh_s_action && TW_playerside == "west") then { { player removeAction _x; } forEach _veh_s_actionarray; _veh_s_actionarray = []; _veh_s_action = false; }; }; //West Weapon if((player distance west_shop_weapons) < 4 && !_invehicle) then { if(TW_playerside == "west" && !_weap_action) then { titleText["Weapon Shop", "PLAIN DOWN"]; //Msg //Actions { if(TW_BoxShop) then { _text = format ["Buy %1 (%2$)",_x call Tee_GetVeh_Name,_x call Tee_GetVeh_Price]; _actioncode = format ["[%1] call Tee_CreateVehicle;",_x]; } else { _text = format ["Buy %1 (%2$)",_x call Tee_GetWeap_Name,_x call Tee_GetWeap_Price]; _weap_typ = _x call Tee_GetWeap_Typ; if(_weap_typ == "wep") then { _actioncode = format ["[%1] call Tee_AddWeapon;",_x]; }; if(_weap_typ == "mag") then { _actioncode = format ["[%1] call Tee_AddMag;",_x]; }; }; _action = player addAction [_text, AddActionCode,_actioncode]; _weap_actionarray = _weap_actionarray + [_action]; } forEach TW_Weapon_Shop_West; _weap_action = true; }; } else { if(_weap_action && TW_playerside == "west") then { { player removeAction _x; } forEach _weap_actionarray; _weap_actionarray = []; _weap_action = false; }; }; //West AI Shop if((player distance west_shop_ai) < 4 && !_invehicle) then { if(TW_playerside == "west" && !_ai_action) then { titleText["AI Shop", "PLAIN DOWN"]; //Msg //Actions { _text = format ["Buy %1 (%2$)",_x call Tee_GetUnit_Name,_x call Tee_GetUnit_Price]; _actioncode = format ["[%1] call Tee_BuyUnit;",_x]; _action = player addAction [_text, AddActionCode,_actioncode]; _ai_actionarray = _ai_actionarray + [_action]; } forEach TW_AI_Shop_West; _ai_action = true; }; } else { if(_ai_action && TW_playerside == "west") then { { player removeAction _x; } forEach _ai_actionarray; _ai_actionarray = []; _ai_action = false; }; }; //West Repair Station if((player distance hq_west) < 10 && _invehicle) then { if(TW_playerside == "west" && !_repairaction) then { //titleText["Repair Station", "PLAIN DOWN"]; //Msg //Repair _text = format ["Repair your Vehicle (%1$)",TW_Repair_Cost]; _actioncode = format ["[] spawn Tee_Sup_Repair;"]; _action = player addAction [_text, AddActionCode,_actioncode]; _repairactionarray = _repairactionarray + [_action]; //Refuel _text = format ["Refuel your Vehicle (%1$)",TW_Sup_Fuel_Cost]; _actioncode = format ["[] spawn Tee_Sup_Refuel;"]; _action = player addAction [_text, AddActionCode,_actioncode]; _repairactionarray = _repairactionarray + [_action]; //Reammo _text = format ["Reammo your Vehicle (%1$)",TW_Sup_Reammo_Cost]; _actioncode = format ["[] spawn Tee_Sup_Reammo;"]; _action = player addAction [_text, AddActionCode,_actioncode]; _repairactionarray = _repairactionarray + [_action]; _repairaction = true; }; } else { if(_repairaction && TW_playerside == "west") then { { player removeAction _x; } forEach _repairactionarray; _repairactionarray = []; _repairaction = false; }; }; //******************* //East //******************* //East HQ if(player distance hq_east < 4 && !_invehicle && !(alive driver hq_east)) then { if(TW_playerside == "east" && !_hq_action) then { //Actions _text = format ["Mobilize HQ"]; _actioncode = format ["[%1] spawn Tee_Client_Base_DeMobHQ;"]; _action = player addAction [_text, AddActionCode,_actioncode]; _hq_actionarray = _hq_actionarray + [_action]; _hq_action = true; }; } else { if(_hq_action && TW_playerside == "east") then { { player removeAction _x; } forEach _hq_actionarray; _hq_actionarray = []; _hq_action = false; }; }; //EastHQ SetUp if(player == driver hq_east) then { //Actions _text = format ["Build HQ"]; _actioncode = format ["[%1] call Tee_Client_Base_HQ_setUp;"]; _action = player addAction [_text, AddActionCode,_actioncode]; _hq_actionarray = _hq_actionarray + [_action]; _hq_action = true; }; //East Vehicle Shop if(player distance east_shop_veh < 4 && !_invehicle) then { if(TW_playerside == "east" && !_veh_s_action) then { titleText["Vehicle Shop", "PLAIN DOWN"]; //Msg //Actions { _text = format ["Buy %1 (%2$)",_x call Tee_GetVeh_Name,_x call Tee_GetVeh_Price]; _actioncode = format ["[%1] call Tee_CreateVehicle;",_x]; _action = player addAction [_text, AddActionCode,_actioncode]; _veh_s_actionarray = _veh_s_actionarray + [_action]; } forEach TW_Vehicle_Shop_East; _veh_s_action = true; }; } else { if(_veh_s_action && TW_playerside == "east") then { { player removeAction _x; } forEach _veh_s_actionarray; _veh_s_action = false; _veh_s_actionarray = []; }; }; //East Weapon if((player distance east_shop_weapons) < 4 && !_invehicle) then { if(TW_playerside == "east" && !_weap_action) then { titleText["Weapon Shop", "PLAIN DOWN"]; //Msg //Actions { _text = format ["Buy %1 (%2$)",_x call Tee_GetWeap_Name,_x call Tee_GetWeap_Price]; _weap_typ = _x call Tee_GetWeap_Typ; if(_weap_typ == "wep") then { _actioncode = format ["[%1] call Tee_AddWeapon;",_x]; }; if(_weap_typ == "mag") then { _actioncode = format ["[%1] call Tee_AddMag;",_x]; }; _action = player addAction [_text, AddActionCode,_actioncode]; _weap_actionarray = _weap_actionarray + [_action]; } forEach TW_Weapon_Shop_East; _weap_action = true; }; } else { if(_weap_action && TW_playerside == "east") then { { player removeAction _x; } forEach _weap_actionarray; _weap_actionarray = []; _weap_action = false; }; }; //East AI Shop if((player distance east_shop_ai) < 4 && !_invehicle) then { if(TW_playerside == "east" && !_ai_action) then { titleText["AI Shop", "PLAIN DOWN"]; //Msg //Actions { _text = format ["Buy %1 (%2$)",_x call Tee_GetUnit_Name,_x call Tee_GetUnit_Price]; _actioncode = format ["[%1] call Tee_BuyUnit;",_x]; _action = player addAction [_text, AddActionCode,_actioncode]; _ai_actionarray = _ai_actionarray + [_action]; } forEach TW_AI_Shop_East; _ai_action = true; }; } else { if(_ai_action && TW_playerside == "east") then { { player removeAction _x; } forEach _ai_actionarray; _ai_actionarray = []; _ai_action = false; }; }; //East Repair Station if((player distance hq_east) < 10 && _invehicle) then { if(TW_playerside == "east" && !_repairaction) then { //titleText["Repair Station", "PLAIN DOWN"]; //Msg //Repair _text = format ["Repair your Vehicle (%1$)",TW_Repair_Cost]; _actioncode = format ["[] spawn Tee_Sup_Repair;"]; _action = player addAction [_text, AddActionCode,_actioncode]; _repairactionarray = _repairactionarray + [_action]; //Refuel _text = format ["Refuel your Vehicle (%1$)",TW_Sup_Fuel_Cost]; _actioncode = format ["[] spawn Tee_Sup_Refuel;"]; _action = player addAction [_text, AddActionCode,_actioncode]; _repairactionarray = _repairactionarray + [_action]; //Reammo _text = format ["Reammo your Vehicle (%1$)",TW_Sup_Reammo_Cost]; _actioncode = format ["[] spawn Tee_Sup_Reammo;"]; _action = player addAction [_text, AddActionCode,_actioncode]; _repairactionarray = _repairactionarray + [_action]; _repairaction = true; }; } else { if(_repairaction && TW_playerside == "east") then { { player removeAction _x; } forEach _repairactionarray; _repairactionarray = []; _repairaction = false; }; }; //End sleep 5; }; }; //****************************************** //Base //****************************************** Tee_Base_Create_Marker = { private ["_marker","_name"]; waitUntil {HQ_placed}; //West if(TW_playerside == "west") then { //Create Respawn _marker = CreateMarkerLocal [TW_West_Respawn, [((getPos west_shop_veh) select 0) + 5,((getPos west_shop_veh) select 1) -10,(getPos west_shop_veh) select 2]]; //TeeTimeTest Marker ist Lokal //HQ _marker = CreateMarkerLocal [TW_West_BaseMarker, position hq_west]; _marker setMarkerTypeLocal "flag_NATO"; //Shops //Vehicle //_name = format ["sh_m_%1_%2",floor(time),floor(random(1000))]; _marker = CreateMarkerLocal [TW_West_ShopMarker_V, getPos west_shop_veh]; _marker setMarkerShapeLocal "Icon"; _marker setMarkerTypeLocal "mil_dot"; _marker setMarkerTextLocal "Vehicle"; //Weapon //_name = format ["sh_m_%1_%2",floor(time),floor(random(1000))]; _marker = CreateMarkerLocal [TW_West_ShopMarker_G, getPos west_shop_weapons]; _marker setMarkerShapeLocal "Icon"; _marker setMarkerTypeLocal "mil_dot"; _marker setMarkerTextLocal "Armory"; //AI //_name = format ["sh_m_%1_%2",floor(time),floor(random(1000))]; _marker = CreateMarkerLocal [TW_West_ShopMarker_AI, getPos west_shop_ai]; _marker setMarkerShapeLocal "Icon"; _marker setMarkerTypeLocal "mil_dot"; _marker setMarkerTextLocal "Barracks"; }; //East if(TW_playerside == "east") then { //Create Respawn _marker = CreateMarkerLocal [TW_East_Respawn, [((getPos east_shop_veh) select 0) + 5,((getPos east_shop_veh) select 1) -10,(getPos east_shop_veh) select 2]]; //TeeTimeTest Marker ist Lokal _marker = CreateMarkerLocal [TW_East_BaseMarker, position hq_east]; _marker setMarkerTypeLocal "flag_Iran"; //Shops //Vehicle //_name = format ["sh_m_%1_%2",floor(time),floor(random(1000))]; _marker = CreateMarkerLocal [TW_East_ShopMarker_V, getPos east_shop_veh]; _marker setMarkerShapeLocal "Icon"; _marker setMarkerTypeLocal "mil_dot"; _marker setMarkerTextLocal "Vehicle"; //Weapon //_name = format ["sh_m_%1_%2",floor(time),floor(random(1000))]; _marker = CreateMarkerLocal [TW_East_ShopMarker_G, getPos east_shop_weapons]; _marker setMarkerShapeLocal "Icon"; _marker setMarkerTypeLocal "mil_dot"; _marker setMarkerTextLocal "Armory"; //AI //_name = format ["sh_m_%1_%2",floor(time),floor(random(1000))]; _marker = CreateMarkerLocal [TW_East_ShopMarker_AI, getPos east_shop_ai]; _marker setMarkerShapeLocal "Icon"; _marker setMarkerTypeLocal "mil_dot"; _marker setMarkerTextLocal "Barracks"; }; TW_HQ_Placed_Client = true; }; Tee_Client_Base_Build_West = { private ["_hq","_marker"]; _hq = hq_west; //Set Respawn TW_West_Respawn setMarkerPosLocal [((getPos west_shop_veh) select 0) + 5,((getPos west_shop_veh) select 1) - 10,(getPos west_shop_veh) select 2]; //TeeTimeTest Marker ist Lokal //Set Veh Spawn west_shop_veh setPosATL [(getPos _hq) select 0,((getPos _hq) select 1) + 10,(getPos _hq) select 2]; "west_vehspawn" setMarkerPos [((getPos _hq) select 0) - 10,((getPos _hq) select 1),(getPos _hq) select 2]; //Nicht genutzt //Set Weapon Shop west_shop_weapons setPosATL [(getPos _hq) select 0,((getPos _hq) select 1) + 5,(getPos _hq) select 2]; //Set AI Shop west_shop_ai setPosATL [(getPos _hq) select 0,((getPos _hq) select 1) - 5,(getPos _hq) select 2]; }; Tee_Client_Base_Build_East = { private ["_hq","_marker"]; _hq = hq_east; //Set Respawn TW_East_Respawn setMarkerPosLocal [((getPos east_shop_veh) select 0) + 5,((getPos east_shop_veh) select 1) - 10,(getPos east_shop_veh) select 2]; //TeeTimeTest Marker ist Lokal //Set Veh Spawn east_shop_veh setPosATL [(getPos _hq) select 0,((getPos _hq) select 1) + 10,(getPos _hq) select 2]; "east_vehspawn" setMarkerPos [((getPos _hq) select 0) - 10,((getPos _hq) select 1),(getPos _hq) select 2]; //Nicht genutzt //Set Weapon Shop east_shop_weapons setPosATL [(getPos _hq) select 0,((getPos _hq) select 1) + 5,(getPos _hq) select 2]; //Set AI Shop east_shop_ai setPosATL [(getPos _hq) select 0,((getPos _hq) select 1) - 5,(getPos _hq) select 2]; }; //Mobilze HQ Tee_Client_Base_DeMobHQ = { private ["_hq"]; if(TW_playerside == "west") then { _hq = hq_west; }; if(TW_playerside == "east") then { _hq = hq_east; }; //Start Voting ["HQ"] spawn Tee_Vote_Start; sleep (TW_Vote_Time + 2); if(!TW_Vote_Result) exitWith {}; //Exit if Voting failed //Mob HQ player moveInDriver _hq; _hq setFuel 1; _hq lock false; if(TW_playerside == "west") then { //[] spawn Tee_Client_Base_Build_West; }; if(TW_playerside == "east") then { //[] spawn Tee_Client_Base_Build_East; }; }; //Build HQ Tee_Client_Base_HQ_setUp = { private ["_hq"]; if(TW_playerside == "west") then { _hq = hq_west; }; if(TW_playerside == "east") then { _hq = hq_east; }; if(player != (driver _hq)) exitWith {}; //Set HQ _hq setDir 90; moveOut player; _hq setFuel 0; _hq lock true; if(TW_playerside == "west") then { [] spawn Tee_Client_Base_Build_West; }; if(TW_playerside == "east") then { [] spawn Tee_Client_Base_Build_East; }; }; //************************************************* //Towns //************************************************* Tee_Client_CreateTownMarker = { private ["_object","_markername","_text","_marker"]; { _object = _x select 0; _markername = _x select 1; _text = _x select 2; //Create Marker _marker = CreateMarkerLocal [_markername, position _object]; _marker setMarkerShapeLocal "Icon"; _marker setMarkerTypeLocal "mil_circle"; _marker setMarkerTextLocal format["%1 100/100",_text]; _marker setMarkerColorLocal "ColorBlack"; } forEach TW_TownArray; }; /* Called on all Client who took the last points */ Tee_Town_Caputred = { private ["_object","_side"]; _object = _this select 0; _side = TW_playerside; TW_Town_Taken = [_object,_side]; publicVariable "TW_Town_Taken"; TW_Town_Taken_Server = [_object,_side]; publicVariable "TW_Town_Taken_Server"; if(isServer && !isDedicated) then { TW_Town_Taken_Server call Tee_Server_Town_CreateAIDef; }; }; /* Called on all Clients when a Town got captured */ Tee_Town_Caputred_2 = { private ["_object","_side"]; _object = _this select 0; _side = _this select 1; if(player distance _object <= TW_Town_CapDis && _side == TW_playerside) then { Tee_Konto = Tee_Konto + Tee_Money_TownCap; _text = format ["You took that Town and earned %1$",Tee_Money_TownCap]; titleText[_text, "PLAIN DOWN"]; //Msg }; }; Tee_AttackTown = { private ["_object","_unitcount","_name","_points","_marker","_text"]; while{true} do { waitUntil{alive player}; { _object = _x select 0; _marker = _x select 1; _name = _x select 2; if(player distance _object <= TW_Town_CapDis) then { _points = _object getVariable "TownPoints"; if(TW_playerside != _object getVariable "TownSide") then { //Count near AI units _unitcount = 0; { if(_x distance _object <= TW_Town_CapDis) then { _unitcount = _unitcount + 1; }; } forEach (units (group player)); _points = _points - (5 * _unitcount); if(debug) then { _points = _points - 20; }; if(_points <= 0) then { _object setVariable ["TownSide",TW_playerside , true]; _object setVariable ["TownPoints", 100, true]; //_marker = _object getVariable "TownMarker"; //TeeTimeTest gedoppelt _marker setMarkerColorLocal TW_playerside_colour; _marker setMarkerTextLocal format["%1 100/100",_name]; Tee_Konto = Tee_Konto + Tee_Money_TownCap; _text = format ["You took that Town and earned %1$",Tee_Money_TownCap]; titleText[_text, "PLAIN DOWN"]; //Msg //Create AI Def [_object] call Tee_Town_Caputred; } else { _object setVariable ["TownPoints", _points, true]; _marker setMarkerTextLocal format["%1 %2/100",_name,_points]; _text = format ["%1 Points left",_points]; titleText[_text, "PLAIN DOWN"]; //Msg }; } else { if(_points < 100) then { _points = _points + 10; _object setVariable ["TownPoints", _points, true]; }; }; }; } forEach TW_TownArray; sleep 30; }; }; //********************************************************** //Support and Supply Functions //********************************************************** /* Repair Function Must be spawned */ Tee_Sup_Repair = { private ["_i","_vehicle","_pos","_damage","_text"]; _vehicle = vehicle player; _pos = getPos _vehicle; _damage = getDammage _vehicle; if(_damage == 0) exitWith { titleText["There is nothing you could repair at this vehicle!", "PLAIN DOWN"]; //Msg }; if(Tee_Konto < TW_Repair_Cost) exitWith { titleText["You dont have the money to repair this vehicle!", "PLAIN DOWN"]; //Msg }; Tee_Konto = Tee_Konto - TW_Repair_Cost; _vehicle engineOn false; _text = format ["You started to repair your vehicle. Please wait here for %1 Seconds.", TW_Repair_Time]; titleText[_text, "PLAIN DOWN"]; //Msg for [{_i=0},{_i< TW_Repair_Time},{_i=_i+5}] do { sleep 5; if(getPos _vehicle distance _pos > 1) exitWith { titleText["Repairing aborted", "PLAIN DOWN"]; //Msg }; _vehicle setDammage (getDammage _vehicle - (_damage / (TW_Repair_Time / 5))); titleText["Repairing", "PLAIN DOWN"]; //Msg }; _vehicle setDammage 0; titleText["Vehicle Repaired", "PLAIN DOWN"]; //Msg }; /* Refuel Function Must be spawned */ Tee_Sup_Refuel = { private ["_i","_vehicle","_pos"]; _vehicle = vehicle player; _pos = getPos _vehicle; if(fuel _vehicle == 1) exitWith { titleText["Your fueltank is full!", "PLAIN DOWN"]; //Msg }; if(Tee_Konto < TW_Sup_Fuel_Cost) exitWith { titleText["You dont have the money to refuel this vehicle!", "PLAIN DOWN"]; //Msg }; Tee_Konto = Tee_Konto - TW_Sup_Fuel_Cost; _vehicle engineOn false; titleText["You started to refuel your vehicle. Please wait here.", "PLAIN DOWN"]; //Msg while {fuel _vehicle < 1} do { sleep TW_Sup_Fuel_Time; if(getPos _vehicle distance _pos > 1) exitWith { titleText["Repairing aborted", "PLAIN DOWN"]; //Msg }; _vehicle setFuel ((fuel _vehicle + 0.1) min 1); titleText["Refueling", "PLAIN DOWN"]; //Msg }; titleText["Vehicle Refueled", "PLAIN DOWN"]; //Msg }; /* Reammo Function Must be spawned */ Tee_Sup_Reammo = { private ["_i","_vehicle","_pos","_text"]; _vehicle = vehicle player; _pos = getPos _vehicle; if(Tee_Konto < TW_Sup_Reammo_Cost) exitWith { titleText["You dont have the money to reammo this vehicle!", "PLAIN DOWN"]; //Msg }; Tee_Konto = Tee_Konto - TW_Sup_Reammo_Cost; _vehicle engineOn false; _text = format ["You started to load Ammunition. Please wait here for %1 Seconds.", TW_Sup_Reammo_Time]; titleText[_text, "PLAIN DOWN"]; //Msg sleep TW_Sup_Reammo_Time; if(getPos _vehicle distance _pos > 1) exitWith { titleText["You moved so you were unable to load the Ammunition", "PLAIN DOWN"]; //Msg }; _vehicle setVehicleAmmo 1; titleText["Amunition loaded!", "PLAIN DOWN"]; //Msg }; //********************************************************** //Marker //********************************************************** //Player Marker and Marker Uodate Tee_PlayerMarker_Loop = { private ["_i","_markerarray","_name","_type","_marker","_object","_text","_points","_side","_colour","_text","_actioncode","_action"]; waitUntil {HQ_placed}; _markerarray = []; while {true} do { _i = 0; //Delete PlayerMarker { deleteMarkerLocal _x; } forEach _markerarray; //Create PlayerMarker { _i = _i + 1; _name = format ["PlMa_%1",_i]; if(alive _x && isPlayer _x && playerSide == side _x) then { if(vehicle _x == _x) then { _type = "n_inf"; } else { _type = "b_motor_inf"; }; _marker = CreateMarkerLocal [_name, position _x]; _marker setMarkerShapeLocal "Icon"; _marker setMarkerTypeLocal _type; _marker setMarkerTextLocal name _x; _markerarray = _markerarray + [_marker]; }; } forEach playableUnits; //Update HQ if(TW_playerside == "west") then { TW_West_BaseMarker setMarkerPosLocal (getPos hq_west); TW_West_ShopMarker_V setMarkerPosLocal (getPos west_shop_veh); TW_West_ShopMarker_G setMarkerPosLocal (getPos west_shop_weapons); TW_West_ShopMarker_AI setMarkerPosLocal (getPos west_shop_ai); }; if(TW_playerside == "east") then { TW_East_BaseMarker setMarkerPosLocal (getPos hq_east); TW_East_ShopMarker_V setMarkerPosLocal (getPos east_shop_veh); TW_East_ShopMarker_G setMarkerPosLocal (getPos east_shop_weapons); TW_East_ShopMarker_AI setMarkerPosLocal (getPos east_shop_ai); }; //Update Town { _object = _x select 0; _name = _x select 1; _text = _x select 2; _points = _object getVariable "TownPoints"; _name setMarkerTextLocal format["%1 %2/100",_text,_points]; _side = _object getVariable "TownSide"; if(_side == "civ") then {_colour = "ColorBlack";}; if(_side == "west") then {_colour = "ColorBlue";}; if(_side == "east") then {_colour = "ColorRed";}; _name setMarkerColorLocal _colour; } forEach TW_TownArray; //Update Respawn TW_West_Respawn setMarkerPosLocal [((getPos west_shop_veh) select 0) + 5,((getPos west_shop_veh) select 1) - 10,(getPos west_shop_veh) select 2]; //TeeTimeTest Marker ist Lokal TW_East_Respawn setMarkerPosLocal [((getPos east_shop_veh) select 0) + 5,((getPos east_shop_veh) select 1) - 10,(getPos east_shop_veh) select 2]; //TeeTimeTest Marker ist Lokal //Basic Values if(playerside == west) then { TW_playerside = "west"; TW_playerside_colour = "ColorBlue";}; if(playerside == east) then { TW_playerside = "east"; TW_playerside_colour = "ColorRed";}; sleep 10; }; }; Tee_Marker_ConnectMarker = { private ["_base1","_base2","_xdif","_ydif","_xpos","_ypos","_pos","_marker"]; _base1 = getPos (_this select 0); _base2 = getPos (_this select 1); _xdif = (_base1 select 0) - (_base2 select 0); _ydif = (_base1 select 1) - (_base2 select 1); _xpos = (_base1 select 0) - _xdif / 2; _ypos = (_base1 select 1) - _ydif / 2; _pos = [_xpos,_ypos,0]; _dir = atan ( _xdif / _ydif ); player globalChat str _pos; _name = format ["CM_%1_%2",floor(time),floor(random(1000))]; _type = "RECTANGLE"; _marker = CreateMarkerLocal [_name, _pos]; _marker setMarkerShapeLocal "RECTANGLE"; _marker setMarkerBrushLocal "Solid"; _marker setMarkerDirLocal _dir; _marker setMarkerSizeLocal [10, ((_base1 distance _base2) / 2) * 0.95]; //Auf 95% runter wegen Optik _marker setMarkerColorLocal "ColorBlack"; }; //******************************************************* //Vehicles //******************************************************* Tee_GetVeh_Name = { private ["_return"]; _return = 0; { if(_this == _x select 0) exitWith {_return = _x select 1;}; } forEach Tee_Veh_Array; _return }; Tee_GetVeh_Class = { private ["_return"]; _return = 0; { if(_this == _x select 0) exitWith {_return = _x select 2;}; } forEach Tee_Veh_Array; _return }; Tee_GetVeh_Price = { private ["_return"]; _return = 0; { if(_this == _x select 0) exitWith {_return = _x select 3;}; } forEach Tee_Veh_Array; _return }; Tee_GetVeh_Typ = { private ["_return"]; _return = 0; { if(_this == _x select 0) exitWith {_return = _x select 5;}; } forEach Tee_Veh_Array; _return }; Tee_CreateVehicle = { private ["_id","_class","_price","_typ","_text","_veh"]; _id = _this select 0; _class = _id call Tee_GetVeh_Class; _price = _id call Tee_GetVeh_Price; _typ = _id call Tee_GetVeh_Typ; if(!TW_air && _typ == "Air") exitWith { titleText["You cant buy this Vehicle. It has been restricted by the server!", "PLAIN DOWN"]; //Msg }; if(Tee_Konto < _price) exitWith { titleText["You dont have the money to buy this!", "PLAIN DOWN"]; //Msg }; Tee_Konto = Tee_Konto - _price; _text = format ["You have now %1$ at your account", Tee_Konto]; titleText[_text, "PLAIN DOWN"]; //Msg //Create _veh = _class createVehicle (position player); _veh setVehicleVarName format["veh_%1_%2",floor(time),floor(random(50))]; //Lock/Unlock Action if(_typ != "Box") then { _veh lock true; TW_Vehicle_Client = TW_Vehicle_Client + [_veh]; //Action _text = "Lock/Unlock"; _actioncode = format ["[%1] call Tee_Vehicle_Lock;",_veh]; //_action = _veh addAction [_text, AddActionCode,_actioncode]; } else { //Action //_text = "Open Box"; //_actioncode = format ['createGearDialog [player, "RscDisplayGear"];',_veh]; //_action = _veh addAction [_text, AddActionCode,_actioncode]; //player groupchat str weaponCargo _veh; //Debug }; }; /* Lock Unlock given Vehicle */ Tee_Vehicle_Lock = { private ["_veh","_locked","_dis","_dis2"]; _veh = _this select 0; //Work Arround _dis2 = 999; { _dis = player distance _x; if(alive _x && _dis < _dis2) then { _dis2 = _dis; _veh = _x; }; } forEach TW_Vehicle_Client; //Work Arround _locked = locked _veh; if(_locked == 2) then { _veh lock false; titleText["Unlocked", "PLAIN DOWN"]; //Msg } else { _veh lock true; titleText["Locked", "PLAIN DOWN"]; //Msg }; }; //************************* //Weapons //************************* Tee_GetWeap_Name = { private ["_return"]; _return = 0; { if(_this == _x select 0) exitWith {_return = _x select 1;}; } forEach Tee_Weapon_Array; _return }; Tee_GetWeap_Class = { private ["_return"]; _return = 0; { if(_this == _x select 0) exitWith {_return = _x select 2;}; } forEach Tee_Weapon_Array; _return }; Tee_GetWeap_Price = { private ["_return"]; _return = 0; { if(_this == _x select 0) exitWith {_return = _x select 3;}; } forEach Tee_Weapon_Array; _return }; Tee_GetWeap_Typ = { private ["_return"]; _return = 0; { if(_this == _x select 0) exitWith {_return = _x select 5;}; } forEach Tee_Weapon_Array; _return }; Tee_AddWeapon = { private ["_id","_class","_price","_text"]; _id = _this select 0; _class = _id call Tee_GetWeap_Class; _price = _id call Tee_GetWeap_Price; if(debug) then { player groupChat "Wep"; player groupChat _class; }; if(Tee_Konto < _price) exitWith { titleText["You dont have the money to buy this!", "PLAIN DOWN"]; //Msg }; Tee_Konto = Tee_Konto - _price; player addWeapon _class; _text = format ["You have now %1$ at your account", Tee_Konto]; titleText[_text, "PLAIN DOWN"]; //Msg }; Tee_AddMag = { private ["_id","_class","_price"]; _id = _this select 0; _class = _id call Tee_GetWeap_Class; _price = _id call Tee_GetWeap_Price; if(debug) then { player groupChat "Mag"; player groupChat _class; }; if(Tee_Konto < _price) exitWith { titleText["You dont have the money to buy this!", "PLAIN DOWN"]; //Msg }; Tee_Konto = Tee_Konto - _price; player addMagazine _class; _text = format ["You have now %1$ at your account", Tee_Konto]; titleText[_text, "PLAIN DOWN"]; //Msg }; //AI Tee_GetUnit_Name = { private ["_return"]; _return = 0; { if(_this == _x select 0) exitWith {_return = _x select 1;}; } forEach Tee_AI_Array; _return }; Tee_GetUnit_Class = { private ["_return"]; _return = 0; { if(_this == _x select 0) exitWith {_return = _x select 2;}; } forEach Tee_AI_Array; _return }; Tee_GetUnit_Price = { private ["_return"]; _return = 0; { if(_this == _x select 0) exitWith {_return = _x select 3;}; } forEach Tee_AI_Array; _return }; Tee_GetUnit_Side = { private ["_return"]; _return = 0; { if(_this == _x select 0) exitWith {_return = _x select 5;}; } forEach Tee_AI_Array; _return }; Tee_CreateUnit = { private ["_group","_class","_pos","_unit"]; _group = _this select 0; _class = _this select 1; _pos = _this select 2; _unit = _group createUnit [_class, _pos, [], 0, "FORM"]; //_unit = _class createUnit [_pos, __group]; _unit }; Tee_BuyUnit = { private ["_id","_class","_price","_group","_unit","_text"]; _id = _this select 0; _class = _id call Tee_GetUnit_Class; _price = _id call Tee_GetUnit_Price; _group = group player; if(debug) then { player groupChat "AI"; player groupChat _class; }; if(!TW_ai) exitWith { titleText["You cant buy AI. It has been restricted by the server!", "PLAIN DOWN"]; //Msg }; if(Tee_Konto < _price) exitWith { titleText["You dont have the money to buy this!", "PLAIN DOWN"]; //Msg }; if(count (units _group) >= (TW_AI_max + 1)) exitWith { titleText["You reached the AI Limit!", "PLAIN DOWN"]; //Msg }; Tee_Konto = Tee_Konto - _price; _unit = [_group,_class,position player] call Tee_CreateUnit; _text = format ["You have now %1$ at your account", Tee_Konto]; titleText[_text, "PLAIN DOWN"]; //Msg };
-
Co-pilot setdamage help
curtcooll replied to curtcooll's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thats awesome dude killed co-pilot then moved in another pilot so players can play as co-pilot, what im doing with my coop mission is making it so that only pilots fly so seeing as the pilot dies only one left. thanks for that though now the first part mission is complete the helicopter simulated crash is epic. -
Ok this is code to kill pilot, I know turret is the co-pilot but tried that don't work in the trigger? driver chopper setDamage 1;
-
How to i make it in editor so you can play as independent?
-
Co-pilot setdamage help
curtcooll replied to curtcooll's topic in ARMA 3 - MISSION EDITING & SCRIPTING
That didnt work but thanks if you cant kill the Co-pilot is there a way to make the pilot non playable but the co-pilot playable note that I'm not using empty vehicle.