Welcome to AhoyWorld

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

  • 0
McKillen

Spawning hunters at base

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

  • 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

I know it used to be availble at base but we have loads already at base, even on a fully pop server I rarely can't find a vehicle to take from the motor pool (though many are strangely damaged).

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...

×   You have pasted content with formatting.   Remove formatting

  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

Loading...

  • Forum Statistics

    7,389
    Total Topics
    48,485
    Total Posts