Prevent givecar from spawning into player buildings?

Is there a way to prevent the /givecar command from spawning vehicles into player buildings? Thanks

This can't currently be prevented. If the givecar command were to prevent spawning the car, then whatever triggered the command (such as a purchase in a shop) would have no way of knowing that the car wasn't spawned, so if any currency was used to purchase the car, it couldn't be refunded.

One solution would be to develop some sort of request/response pattern that uses multiple commands, but this would require cooperation with other plugins that frankly aren't designed for this use case.

One direction we could go would be to make the car spawn somewhere nearby or outside, but this wouldn't be perfect. If the player is inside a base, I could find somewhere nearby on the terrain or on a nearby road to spawn the car, but finding a suitable place at monuments would be trickier.

Another direction would be to add checks into whichever plugin is running the command. For example, a shop plugin could have an option to not allow a purchase inside a building, or to not allow if some configurable bounding box isn't free in front of the player. These are reasonable ideas for shop plugins to have, but this would probably require additional development as I doubt such features exist today.

NKXTQs24ExGTuL8.jpg WhiteThunder

This can't currently be prevented. If the givecar command were to prevent spawning the car, then whatever triggered the command (such as a purchase in a shop) would have no way of knowing that the car wasn't spawned, so if any currency was used to purchase the car, it couldn't be refunded.

One solution would be to develop some sort of request/response pattern that uses multiple commands, but this would require cooperation with other plugins that frankly aren't designed for this use case.

One direction we could go would be to make the car spawn somewhere nearby or outside, but this wouldn't be perfect. If the player is inside a base, I could find somewhere nearby on the terrain or on a nearby road to spawn the car, but finding a suitable place at monuments would be trickier.

Another direction would be to add checks into whichever plugin is running the command. For example, a shop plugin could have an option to not allow a purchase inside a building, or to not allow if some configurable bounding box isn't free in front of the player. These are reasonable ideas for shop plugins to have, but this would probably require additional development as I doubt such features exist today.

Very good points!

I'd rather have a player lose a few hundred RP or scrap than receive tickets constantly of 'I didn't know it would spawn a camper inside my base, can you remove it?' - my most received ticket type  lol 

I highly doubt my shop plugin dev will be adding features - they are mostly afk and only fix issues days after wipe, etc.  Thank you for the reply!    

Another thought that occurs to me is that this frankly isn't the best plugin for purchasing cars. Originally this plugin was developed for a battlefield server, following the idea of the Spawn Mini (now Spawn Heli) plugin which lets players spawn/despawn/fetch for free. Nowadays there are many more vehicle spawner plugins, and some shop plugins even have vehicle spawning built in. Plugins like Vehicle License can be a better fit as you can simply sell the license in the shop, allowing the player to manage the vehicle after it's purchased.

I won't be sad if you move onto another plugin. This plugin was my first and I'm more likely to invest energy in other plugins which have more market share and fewer viable alternatives.

You wont be sad....but I will  :)

I understand what you are saying. Thank you