Currently the developers are putting their own money into JC2-MP to keep the servers online.

Please take a few seconds of your time and disable your AdBlock plugin for our website.

Ad revenue is not going to developers, it is used purely for covering our hosting costs.

 

You are also free to donate, which removes all ads from our website!

Patch 0.3 was just released! Full changelog here: https://t.co/4A50m6IKen

3 years ago

Advertisement
September 28, 2020, 09:40:07 am

Author Topic: [RELEASE] Better buy/spawn menu  (Read 5353 times)

Freddie

  • Newbie
  • *
  • Posts: 19
    • View Profile
[RELEASE] Better buy/spawn menu
« on: August 24, 2015, 04:32:10 pm »
Features:
  • Everything is free
  • Removed all pricing UI (no cost column, cash counter, new chat messages and help page rewritten)
  • DLC items added (removable)
  • Allows for 2 vehicles to spawned by each player, infinite, or just the default 1
  • Additional categories splitting all the vehicles and weapons apart
  • Added a cooldown preventing players from spam-spawning vehicles
  • Now prevents players from spawning vehicles while in a vehicle or not standing on the ground. This blocks players from spam-spawning new vehicles if they get taken down or damaged to survive dog-fights, tank battles and PVP. The additional cooldown means that players have to wait after bailing to spawn a new vehicle as well, leaving them exposed to their enemy for a short time.


To remove DLC items:
  • Open "AdvancedBuyMenu-Shared.lua" in a text editor
  • Scroll down to line 136. From here, you can scroll through the listed items. To remove one from the menu, simply comment out that line of code using a double hyphen, like so:
Before:
Code: [Select]
VehicleBuyMenuEntry( 44, 0, "Softtop", nil, "" ),
-- ^ Hamaya Oldman Softtop

After:
Code: [Select]
--VehicleBuyMenuEntry( 44, 0, "Softtop", nil, "" ),
-- ^ Hamaya Oldman Softtop


To change how many vehicles each player can spawn:
  • By default, this spawn menu allows for unlimited vehicle spawning per player. I recommend having a low idle vehicle despawn timer for this to clear empty cars. This is not a problem for servers with low player counts.
  • To set the vehicle buy count to 2 vehicles per player add these lines of code: click me
  • To allow for limited vehicle spawning to just one vehicle per player, open the file "AdvancedBuyMenu-Server.lua" with a text editor, scroll to line 299 and uncomment this block of code:
Code: [Select]
--Game:FireEvent(ply.weapon.picked_up)
    --if IsValid( self.vehicles[ player:GetId() ] ) then
    --    self.vehicles[ player:GetId() ]:Remove()
    --    self.vehicles[ player:GetId() ] = nil
    --end


To change the cooldown between spawning vehicles and after a player bails:
  • Open "AdvancedBuyMenu-Client.lua" with a text editor.
  • Change the cooldown variable value on line 2. You may wish to also change the chat output on line 764 to remain consistent with your new cooldown time.


Why release this?
I was helped to create this hugely, and I see a lot of servers that still miss important features like this. I only wanted this for my friends and I over LAN, but I hope this helps someone out :) Have fun!
« Last Edit: October 03, 2015, 11:29:56 pm by Freddie »

HolyPhoenix

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: [RELEASE] Better buy/spawn menu
« Reply #1 on: October 03, 2015, 11:21:28 pm »
Where is the link to the download for this?  It sounds like exactly what I want. 

Freddie

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: [RELEASE] Better buy/spawn menu
« Reply #2 on: October 03, 2015, 11:29:23 pm »
I don't know why it wasn't attached. This should be it, but I'm doing this in a rush via remote desktop.

Feel free to reply if you have any more problems :) I hope you like my work!

YummyHD

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: [RELEASE] Better buy/spawn menu
« Reply #3 on: October 10, 2015, 08:26:03 pm »
Is it possible to disable the feature that you cant spawn vehicles if you are not on the ground? Because its annoying that I cant spawn boats.

Freddie

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: [RELEASE] Better buy/spawn menu
« Reply #4 on: October 10, 2015, 08:47:16 pm »
Is it possible to disable the feature that you cant spawn vehicles if you are not on the ground? Because its annoying that I cant spawn boats.
Try this:
  • Open 'client\AdvancedBuyMenu-Client.lua'
  • Go to line 768
  • Delete or comment out these 3 lines of code:
Code: [Select]
if state ~= 6 and state ~= 12 and state ~= 19 and state ~= 7 and state ~= 9 then
Chat:Print("You can only spawn vehicles on the ground!", Color(255, 34, 34))
return
end

I never thought about boats! Good thinking!
« Last Edit: October 10, 2015, 08:49:47 pm by Freddie »

Vengone000

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: [RELEASE] Better buy/spawn menu
« Reply #5 on: December 23, 2015, 05:47:49 pm »
it doesn't work how do i access the buy screen. PLEASE HELP :'(

Smapa_Purf

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: [RELEASE] Better buy/spawn menu
« Reply #6 on: December 24, 2015, 12:03:16 am »
You should make a github repository for this