This is similar to the old hunter vehicle script. The difference is that instead of spawning an unarmed hunter every time it is clicked, it only spawns one hunter every three minutes. The time can obviously be edited to suit needs. If the vehicle has already been spawned less than three minutes ago then a hint is displayed. Currently the hint is displayed globaly to the entire server however I'm sure this can be changed to display it in the area of the spawn point. It functions the same as before using addAction on an AI character.
This is the main spawning script.
Spoiler
/*
Author: McKillen
Description: Allows a hunter to be spawned every few minutes
Based off of a baseHunter.sqf script by BACONMOP
Last edited: --/--/--
//if var hunterSpawn is true then spawn the hunter
if (hunterSpawn) then{
_veh = "B_MRAP_01_F" createVehicle (getMarkerPos "hunterSpawn");
_dir = markerDir "hunterSpawn";
_veh setDir _dir;
clearItemCargoGlobal _veh;
clearMagazineCargoGlobal _veh;
clearWeaponCargoGlobal _veh;
clearBackpackCargoGlobal _veh;
//sets the variable to false and redirects to hunterSwitch file for the timer
hunterSpawn = false;
[] remoteExec ["AW_fnc_hunterSwitch",2];
}
//if hunterSpawn is false tell them one has been recently spawned
else{
hint "A hunter has recently been spawned. \nPlease wait for the timer to end.";
};
This is another script which creates the delay.
Spoiler
/*
Author: McKillen
Description: Sets a delay of a certain amunt of time (currently three minutes) before it can be spawned in again
Last edited: --/--/--
File name: functions\vehicle\fn_hunterSwitch
*/
//waits three minutes and sets the variable to true
sleep 180;
hunterSpawn = true;
This variable is inserted into the initServer.sqf as it is needed to be set as true for the script to run in the first place
Question
Guest
This is similar to the old hunter vehicle script. The difference is that instead of spawning an unarmed hunter every time it is clicked, it only spawns one hunter every three minutes. The time can obviously be edited to suit needs. If the vehicle has already been spawned less than three minutes ago then a hint is displayed. Currently the hint is displayed globaly to the entire server however I'm sure this can be changed to display it in the area of the spawn point. It functions the same as before using addAction on an AI character.
This is the main spawning script.
/*
Author: McKillen
Description: Allows a hunter to be spawned every few minutes
Based off of a baseHunter.sqf script by BACONMOP
Last edited: --/--/--
File name: functions\vehicle\fn_hunterSpawn.sqf
*/
//if var hunterSpawn is true then spawn the hunter
if (hunterSpawn) then{
_veh = "B_MRAP_01_F" createVehicle (getMarkerPos "hunterSpawn");
_dir = markerDir "hunterSpawn";
_veh setDir _dir;
clearItemCargoGlobal _veh;
clearMagazineCargoGlobal _veh;
clearWeaponCargoGlobal _veh;
clearBackpackCargoGlobal _veh;
//sets the variable to false and redirects to hunterSwitch file for the timer
hunterSpawn = false;
[] remoteExec ["AW_fnc_hunterSwitch",2];
}
//if hunterSpawn is false tell them one has been recently spawned
else{
hint "A hunter has recently been spawned. \nPlease wait for the timer to end.";
};
This is another script which creates the delay.
/*
Author: McKillen
Description: Sets a delay of a certain amunt of time (currently three minutes) before it can be spawned in again
Last edited: --/--/--
File name: functions\vehicle\fn_hunterSwitch
*/
//waits three minutes and sets the variable to true
sleep 180;
hunterSpawn = true;
This variable is inserted into the initServer.sqf as it is needed to be set as true for the script to run in the first place
hunterSpawn = true;
Link to comment
Share on other sites
4 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