Vehicle System:

Official server feature documentation can be found here

Moderators: Lead Developers, Junior Developers, Lead Admins, Developers

Post Reply
User avatar
Damian
Retired Administrator
Retired Administrator
Posts: 16175
Joined: Fri Aug 10, 2007 5:55 am

Vehicle System:

Post by Damian » Mon Oct 07, 2013 11:34 pm

Script name: Vehicle System
Script author(s): DamianC
Author Comments:


Vehicle Dealership | Attributes | Security | Vehicle Damage | Maintenance |Side-Features | Commands

Around 4 or 5 years ago, Fed, an old developer around here; developed the revolutionary Vehicle System that we still have with us today. A system not fathomed by any other server at the time, and truly set the benchmark high for any further development work around here on LS-RP, and roleplay servers on SA-MP in general. The massive amount of work and care he invested into this system was truly remarkable. Through his brilliance, and receptive feedback from the community at the time the Vehicle System was born.

Not only did it set benchmarks, but it opened the doors for a lot of players on this server. Everyone had a chance to own their own vehicle for once and were even able to buy multiple sets of vehicles. Along with these possibilities came many side features and attributes such as insurance, destroys, modpacks, and so on. All revolutionary, all amazing, all the things that truly make this system so important to us today.

With all that said, thank you Fed for providing us with such a wonderful system. The impact it had then and still today is something quite amazing. It's been an honor to work on the system throughout the years and it's an even bigger honor to take the helm of renovating the system all together. It's a task I take great pride in because I know this is no simple task, and I got a lot to do to live up to what Fed provided us all.

Heading into the revision I already had a clear and pretty huge goal in mind- to create more emphasis and roleplay surrounding the vehicles on LS-RP. I went beyond that goal to a much larger goal- to create an actual personality for each and every vehicle model and player owned vehicles. Along with that, while doing a script re-write I knew I'd have to re-build the entire vehicle system from scratch.

I've been working with various amounts of people- from car freaks, LS-RP enthusiasts, and so on to make this all possible, and I'd like to personally use this opportunity now to thank them all for help, advice, and moral support throughout this very long adventure. Optimization, Efficiency, and User Friendliness were the overall functions when creating this system, and I made sure I stayed true to those three thought processes in each and every feature applied towards this revision.

Vehicle Dealership:
Heading into this revision, I knew the vehicle dealership would be my first and main task. The vehicle dealership is one of the main presences presented to every player on this server that wishes to engage in vehicle roleplay and or to generally just own one. We all know the current bloated text system shown towards the buyer is truly not that pleasant towards the eyes.

User Friendliness was the main goal here and I wanted to beyond just vehicle models and names in a chat screen, main task here was to create a giant GUI screen for players to navigate through in finding out what they want. Once you pick an affordable, available vehicle it will be created IG near them and you'll be placed inside of it and another GUI will be presented with the vehicle model preview, attributes of the vehicle model, and two buttons - "Buy" " << ". If "<<" the vehicle model will be deleted and the person will be taken back the main GUI menu to start over.

ImageImage

If and when they buy a vehicle they'll be able to set their colors for their car, and once they're done with that you will receive your licensed vehicle. If a car it will have a pre-defined parking spot at the Muholland parking lot, flight vehicles will be at the airport, and sailing vehicles will continue to be parked in the canal in Marina.


I've always believed it's the tiniest details and features that set the biggest impact in the longrun. Something to truly set the difference between the Washington and the Manana, and so on and so on when it comes to fuel handling and such- basically the scripted features for vehicles. Nothing too complicated, simple enough for you to continue driving normally and detailed enough to boost roleplay opportunities.

*Energy/Engines:
    First and foremost there will be 5 types of energy resources for the vehicle models:
    • None
    • Petrol
    • Diesel
    • Electric
    • Turbo
    Meaning some will have petrol engines(Sultan), diesel engines(Coach bus), electric(Golf Cart), turbo(flying/sailing vehicles), or just no engines at all(Bicycle). The normal engine lifespan will be 100.000 when first bought. Mid-Range/ will start off at around 75.00. The ones lower than that- bikes and such around 50.000.

    It will deplete in health by 0.001 every 1 minute the engine is turned on. The engine is also affected by the destruction of the vehicle, figures for this varies and can be found under the "Vehicle Damage" section. But overall though a completely healthy vehicle is able to last for a long time. Figures below:

    100.000 - 100,044 Minutes.
    75.000 - 76,041 Minutes.
    50.000 - 51,028 Minutes.
    25.000 - 26,014 Minutes.
    5.000 - 6,000 Minutes

    When it gets around the range of 5.000 the vehicle will start seeing some issues. Worse fuel handling will be the first effect kicking in. As it dips lower the vehicle will have moments will come with visual particles- such as fire and smoke. Eventually when the engine dies it won't be able to turn on. It will be dead. It is un-repairable and the only way a mechanic can fix it is by replacing the engine- which will be very costly.
*Battery:
    This will control the turning on of a vehicle, the /setstation of a vehicle, the automatic shutoff of a vehicle when extremely low on health, and any other electrical functions for the vehicle. The normal max battery for a vehicle will be 100.000, if it isn't 100.000 it will be 50.000. It will also be affected when the vehicle is damaged or destroyed, like the engine- see "Vehicle Damage" below for information on that.

    The battery life will deplete by 0.001 everytime you use an electrical function for the vehicle. When the battery gets around 5.000 you will notice engine start up problems and other issues. The battery will be the least of your concern when it comes to maintenance and general driving. But if you're a reckless driver you may want to keep a closer eye on it.
*Fuel Handling:
  • g_fuel_deduction_rate_petrol(0.004) - Rate of how much the vehicle will lose in fuel if it's a petrol engine vehicle.
  • g_fuel_deduction_rate_diesel(0.002) - Rate of how much the vehicle will lose in fuel if it's a diesel engine vehicle.
  • Basic formula_for_vehicle_fuel_loss - (vehicle_model_mass/distance_traveled_in_meters)*rate_of_loss

    With the fuel editing revamp comes an entirely new system for fuel loss. The standard 1fuel drop point every 5 minutes has been replaced by a MPG system. If you are unfamiliar with MPG then you may also recognize this as KML or L/100KM. Each vehicle model will have their own distinct ranges of values for MPG. They will be measured based off the vehicle category their under, speed, and weight.

    So basically now with the fuel system let's say your vehicle has 21MPG. Everytime your distance travel accumulates by 21 miles you will drop a fuel point at the 5minute mark. If you have not traveled anywhere and the engine is just simply on your car will lose the tiny standard fuel_rate drop.

Security:
Security has always and forever be a top priority for the vehicle system, as the owners deserve the ability to be able to protect their property to the best of their ability. Another aspect of roleplay I wanted to touch up upon would be the roleplay involving the unsecured vehicle side of things and the consequences that usually follow behind that- Car Jacker.

My main aim here was to create a more interactive system rather than just slapping on a timer on it and hoping for the best. While at the same time I want to bring a resounding feel of comfort towards a vehicle owner that their secured vehicle will ward off the masses of car jackers out there. Something to bring the excitement towards and create the hair standing moments much needed when undergoing these operations.
Car Jacker
    There are currently three methods for a Car Jacker to gain access to a vehicle that does not belong to them. First, is the method we all know and love- the old timer system. It has been adjusted to be a little more interactive this time around. A tool will be required in order to start prying open a door. The tool will need to be out and on either your left hand bone or your right hand bone.

    Once that is out of the way you need to crouch next to the door, commence with the command, and the timer begins. Another change here is that the hours spent online while on the career will soon have an effect on how long you have to wait. So for example if you've been online with the car jacker as your job you won't have to wait aslong with the pry method as opposed to someone just starting on the job.

    The next method is a big one composed of two physical actions. You can beat on the door with your fists, the door's health will go down every hit and the alarm will be hit automatically on physical contact. The other sub-method here is that you can also use a melee weapon- bat, shovel, chainsaw for a quicker breakdown method. And won't be as painful as your character that way!

    That is just the breakin method mind you. The job is only half-way done, you still have to get through the process of hotwiring the vehicle. You will have to complete a task of unscrambling a set of words before your time runs out. If you get 7 of the words wrong you will be electrocuted by the wires(tazed)! So be quick on your toes people, this part of the system will either be a breeze or a shocker for you, literally.

    So if you are skilled and at the top of your game you could have some Nicholas Cage Gone In 60 Seconds moments going, and if you are not then...well good luck!
Locks
    Every vehicle will have a stock level lock automatically, no matter if new, blown up, etc. A lock will always be a common piece for every vehicle on this server. For the criminals out there, there will be multiple ways to break into a car and depending on the lock level those multiple ways to break in could be vastly limited.
    ^Stock Level Security:
      +250 second wait time protection against prying method.
    ^Second Level Security:
      +500 second wait time protection against prying method.
      +Stronger armor- better defense against physical attack breaching.(Fist & melee)
    ^Third Level Security:
      +750 second wait time protection against prying method.
      +Special armor- better defense x2 against melee attack breaching.
      +Special armor protection blocks physical attack breaching(Fist).
    ^Fourth Level Security:
      +1,000 second wait time protection against prying method.
      +Special armor- better defense x3 against melee attack breaching.
      +Special armor protection blocks physical attack breaching(Fist).
    ^Fifth Level Security:
      +1,250 second wait time protection against prying method.
      +Special armor protection blocks all types of physical attack breaching.
Alarms
    Although a necessity, you will need to buy an alarm for your vehicle to send off signals in the case of a possible breach or tampering of the wires. There will be no stock alarms installed on vehicles. So if you have no alarms installed then the job for the car jacker will be a heck of a lot easier, so please keep that in mind when securing your vehicle. Remember the higher the alarm the more alerting it will be.
    ^First Level Alarm
      Loud Vehicle Alarm.
    ^Second Level Alarm
      Loud Vehicle Alarm.
      Vehicle alerts its owner's of a possible breach.
    ^Third Level Alarm
      Loud Vehicle Alarm.
      Vehicle alerts its owner's of a possible breach.
      Vehicle alerts the local police department of a possible breach.
    ^Fourth Level Alarm
      Loud Vehicle Alarm.
      Vehicle alerts its owner's of a possible breach.
      Vehicle alerts the local police department of a possible breach.
      Vehicle blip will appear on the LEO's radar.
Immobilizer
    Last but definitely not least, the immobilizer. Although every vehicle will come with a default protection system against hotwiring, immobilizers are still quite the necessity in keeping the jackers under control. Remember, in order to hotwire a vehicle you need to complete the task of unscrambling a set of words under a given time. With an immobilizer it affects just how long a jacker has to complete the task.

    And the higher the immobilizer the lower the time given to complete the task. So keep that in mind before looking at the prices of each level and basing your decision solely off that.
      ›>›Stock Level Immob. - 125sec timelimit.
      ›>›First Level Immob. - 100sec timelimit.
      ›>›Second Level Immob. - 75sec timelimit.
      ›>›Third Level Immob. - 50sec timelimit.
      ›>›Fourth Level Immob. - 25sec timelimit.


The first and major thing you all are going to want to know right now is that vehicle damage of all kinds will be saved to the vehicle. So if you hit a wall and loser a bumper the vehicle will stay that way until you have a visit from the mechanic, visit the Pay n Spray itself, or have some type of insurance coverage.


Another new feature with vehicle damage system is the constant vehicle explosions prevention put in place. Meaning when your vehicle enters black smoke the engine will cut off and a mechanic will be needed for the situation. The engine and or the battery have to have a healthy life-span on it for this to take an effect. You are able to rev the engine and possibly start it again but you'll be risking the vehicle's life, and possible worse fuel handle.

Image


When it comes to vehicle damage and its effects on the engine life and battery life will be based off the formulas below:
    Vehicle_Health >= 650
      Engine Life - No loss.
      Battery Life - No loss.
    550 <= Vehicle_Health <= 649 (White Smoke)
      Engine Life - (vehicle_health_loss/125.0) = deduction from engine life.
      Battery Life - (vehicle_health_loss/150.0) = deduction from battery life.
    390 <= Vehicle_Health <= 549 (Grey Smoke)
      Engine Life - (vehicle_health_loss/100.0) = deduction from engine life.
      Battery Life - (vehicle_health_loss/125.0) = deduction from battery life.
    250 <= Vehicle_Health <= 389 (Black Smoke)
    *Vehicle engine turns off around 325-389 range*
      Engine Life - (vehicle_health_loss/75.0) = deduction from engine life.
      Battery Life - (vehicle_health_loss/100.0) = deduction from battery life.
    On Vehicle Death
      Engine Life - -10+random( 5 ) deducted.
      Battery Life - -10 deducted.

Maintenance:
The changes here are quite different from a lot of what you're currently used to, but at the same time it will be an understandable and simple thing to grasp in the longrun of things. The changes here will be towards mechanic duties, insurance, and overall the end of a vehicle's life. The most important piece I want to talk about and get out of the way is the vehicle life span. When exactly does a vehicle die out on a player?

Well, it varies. A person who drives safely, doesn't worry about fixing his engine or battery will have a car with a lifespan of 69 days/1,667 hours. That's with the /engine on ofcourse. A person that takes good care of his engine and battery and doesn't drive recklessly, which will be costly, can hold on to their car however long they please. A person that drives recklessly will only be able to hold on to it for a few months-weeks-days-hours; varies based upon recklessness.

Overall when the engine life is over the engine will not be able to start up. When the battery life has run out you will need someone to jumpstart your car for you to get it going. When their lives are low they will have to rev the vehicle up to get it going. With all this in place the damage/dent system is being removed from before, in replace of engine and battery lives.
Mileage / Odometer Reading
    This will be just a simple measurement of how far the vehicle has driven. There is no maximum mileage per vehicle model, this variable can go as far as the owner drives it. The odometer is just a good indication of where the vehicle life span may be at, nothing more than just a possible indication. For instance if you drive thousands of miles/kilometers and take good care of your engine and battery then it's fine.

    Over time people will figure out what is a good mileage and what isn't for vehicle models, and if they want a more detailed analysis of what the vehicle condition is entirely they can check out the engine and battery life-statuses.
Insurance
    Insurance in this vehicle system will definitely be different from how you last remembered it. The insurance point will not drop each destroy, but do not get it twisted it is still very important in the event your vehicle happens to blow up or meet some sort of demise. Insurance is very costly the higher the value of the car, and highly protective against alot of messy events.

    Buying insurance is still a one time initial fee, but when the vehicle insurance is called to do repair work on the messy situations a small fee will be required upon the owner's return to the vehicle. Failure to pay the fees will resort in a insurance coverage point drop.
    First Level Insurance Coverage
      Vehicle will always respawn with its max health.
    Second Level Insurance Coverage
      Vehicle will always respawn with its max health.
      Protection against vehicle damage. Vehicle will re-spawn good as new.
    Third Level Insurance Coverage
      Vehicle will always respawn with its max health.
      Protection against vehicle damage. Vehicle will re-spawn good as new.
      Vehicle modification coverage. We got your fancy layout and XM tunes covered!
Vehicle Armor
    Think of the player armor we currently have ingame. How it has its own lifespan, how it keeps your player's health in tact during it's duration of usage. Just keep that method in mind and apply it towards vehicles now. Vehicle owners will have the option to buy upwards of 250 armor points to add on to their vehicle's health. With armor applied to your vehicle it will not receive any vehicle damage, and you will not lose health when you smash into obstacles while driving.

    The price of each armor point varies based on how expensive your vehicle model is. So if you're a person that absolutely hates dents and dings with a passion then armor will be your best friend. Stronger armor for the vehicle and tires, what more can you ask for in safety and security?


Vehicle Objects:
    I've incorporated the moving object tool towards vehicles. So expect to see great things in the future regarding objects, object placements, and so on in the future as the vehicle system continues to grow. The first thing you'll notice with objects and the new system is the new visible weapon system.

    ImageImage

    The system still works the same way it does today- /check, /takegun, and /place. Just with a few changes obviously. /takegun comes with a radius check, so if your gun is in your trunk and you're inside your vehicle you'd have to get out the vehicle to go and retrieve it, and vice versa. The weapon limit for vehicles will be around 4 and below.
    Image

Damian Calhoun
Manager
Head of Staff
Head of Boards
Head of Development
SA:MP BetaTester '06
Tester Information:
Information About Applying.
Head of Mapping.
Contact Information
IRC.
PM me!
Ventrilo.
Highest Player Count:
550!
DamianC.


User avatar
Damian
Retired Administrator
Retired Administrator
Posts: 16175
Joined: Fri Aug 10, 2007 5:55 am

Re: Vehicle System:

Post by Damian » Tue Oct 22, 2013 11:46 am

-Information about Vehicle Armor added to Maintenance.
-A Side Feature updated.
Damian Calhoun
Manager
Head of Staff
Head of Boards
Head of Development
SA:MP BetaTester '06
Tester Information:
Information About Applying.
Head of Mapping.
Contact Information
IRC.
PM me!
Ventrilo.
Highest Player Count:
550!
DamianC.


Post Reply

Return to “Feature documentation”

Who is online

Users browsing this forum: Jeremy_Smile