Jump to content
  • 0
McKillen

Spawning hunters at base

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;

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
Guest
You are commenting as a guest. If you have an account, please sign in.
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoticons maximum are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Forum Statistics

    8,048
    Total Topics
    52,585
    Total Posts
×