Jump to content
  • 0

Spawning hunters at base


Guest

Question

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: --/--/--

    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.

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

Spoiler

hunterSpawn = true;

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Well it used to be there but I was also thinking of putting it in at the FOBs aswell as at the main base. Only problem is that the way that I made it it would take multiple loops which hit server performance

Link to comment
Share on other sites

  • 0

The reason the system was removed was because the hunter spawn was getting spammed by people. I can not really see a 3 minute timer helping at all to be honest. If it were up to me I think if the squad thing that was talked about in the rewards idea I would make it so only squad leads can spawn hunters, Hopefully minimising the amount of spam.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Forum Statistics

    11.1k
    Total Topics
    66.4k
    Total Posts
×
×
  • Create New...