Hi there,
I would like to add a Scrap Transport Helicopter to the commands section of this plugin. I have the helicopter implemented into the shop now and players are able to purchase it. However, due to the scrap helicopter game mechanics it will squish the player once spawned, ultimately killing them. Is it possible to spawn the helicopter just a little infront of the player instead of right on top of them? Below is the configuration.
"Shop - Shop List": {
"Scrap Transport Helicopter": {
"DisplayName": "Scrap Transport Helicopter",
"Shortname": "scraptransporthelicopter",
"EnableBuy": true,
"EnableSell": false,
"Image": "",
"SellPrice": 1.0,
"BuyPrice": 3000.0,
"BuyCooldown": 0,
"SellCooldown": 0,
"KitName": null,
"Command": [
"spawn scraptransporthelicopter \"$player.x $player.y $player.z\""
],
"SkinId": 0
Thanks in advance for all of your help!
Alter the distance a entity spawns from a playerSolved
The plugin was designed to spawn the mini copters/sedans by where the player was looking at with a distance check. If they look too far it is supposed to spawn where their feat is. I can add a config option to adjust this distance check but it was recently updated (Updated 2.0.4 patch) to fix a bug where the vehicles could spawn at the base of player's bases/under rust map rocks..
For now open up the Plugin CS file and go down into the #helper region section it'll be this section of code here that you need to update. (around the 9k lines.
#region Helpers
private Vector3 GetLookPoint(BasePlayer player)
{
RaycastHit raycastHit;
if (!Physics.Raycast(new Ray(player.eyes.position, Quaternion.Euler(player.serverInput.current.aimAngles) * Vector3.forward), out raycastHit, 10f))
{
return player.ServerPosition;
}
return raycastHit.point;
}Change the 10f (higher like 15 or 20f, etc) until it is at a suitable distance for you.
Khan,
That worked perfectly! Thank you :).
Locked automatically