Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ a large list of mod and color codes can be found at
- 7http://www.nextgenupdate.com/forums/grand-theft-auto-v-modding/766645-rpc-resource-vehicle-editing-natives-addresses-bles-1-16
- -a-2.html
- index color numbers can be found at http://gtaforums.com/topic/788275-models-color-hashes/?p=1067393998
- ]]--
- local car ={}
- local function inTable(tbl, item)
- for key, value in pairs(tbl) do
- if value == item then return true end
- end
- return false
- end
- local function repairVeh(int)
- VEHICLE.SET_VEHICLE_FIXED(int)
- --Clean the car - dirtLvl = 0 (clean) to 15 (dirty)
- VEHICLE.SET_VEHICLE_DIRT_LEVEL(int, 0)
- --Lets make our car "not wanted" anymore as well
- VEHICLE.SET_VEHICLE_IS_WANTED(int, false)
- return
- end
- local function setWheels(int)
- local sport = {0, 3, 1, 5, 6, 7}
- local offroad = {9, 11, 12}
- local suv = {2, 4}
- --Wheel Type 0: Sport, 1: Muscle, 2: Lowrider, 3: SUV, 4: Offroad, 5: Tuner, 6: Bike Wheels, 7: High End
- if(inTable(sport, VEHICLE.GET_VEHICLE_CLASS(int))) then
- --Set the wheel type according to the above
- VEHICLE.SET_VEHICLE_WHEEL_TYPE(int, 7)
- --Change the style of rim by changing the 3rd parameter
- VEHICLE.SET_VEHICLE_MOD(int, 23, 7, true)
- end
- if(inTable(offroad, VEHICLE.GET_VEHICLE_CLASS(int))) then
- VEHICLE.SET_VEHICLE_WHEEL_TYPE(int, 4)
- VEHICLE.SET_VEHICLE_MOD(int, 23, 6, true)
- end
- if(inTable(suv, VEHICLE.GET_VEHICLE_CLASS(int))) then
- VEHICLE.SET_VEHICLE_WHEEL_TYPE(int, 3)
- VEHICLE.SET_VEHICLE_MOD(int, 23, 13, true)
- end
- return
- end
- --Returns the maximum available mod slot
- local function getMods(veh, int)
- if(VEHICLE.GET_NUM_VEHICLE_MODS(veh, int) > 1) then
- return VEHICLE.GET_NUM_VEHICLE_MODS(veh, int)-1 end
- return 0
- end
- --sometimes, you just want to upgrade the looks a little bit...
- local function getMinMods(veh, int)
- if(VEHICLE.GET_NUM_VEHICLE_MODS(veh, int) > 0) then
- return 1 end
- return 0
- end
- function car.tick()
- local playerPed = PLAYER.PLAYER_PED_ID()
- local player = PLAYER.GET_PLAYER_PED(playerPed)
- local playerExists = ENTITY.DOES_ENTITY_EXIST(playerPed)
- local myCar = PED.GET_VEHICLE_PED_IS_USING(player)
- if(playerExists) then
- if(PED.IS_PED_IN_ANY_VEHICLE(playerPed, false)) then
- local veh = PED.GET_VEHICLE_PED_IS_IN(playerPed,true)
- --------------------------------------------------
- -- Maximum Mods (M) --
- --------------------------------------------------
- if(get_key_pressed(77))then
- VEHICLE.SET_VEHICLE_MOD_KIT(veh, 0)
- VEHICLE.SET_VEHICLE_NUMBER_PLATE_TEXT(veh, 'BOSS-MAN')
- --Spoilers
- VEHICLE.SET_VEHICLE_MOD(veh, 0, getMods(veh, 0), true)
- --Front Bumper
- VEHICLE.SET_VEHICLE_MOD(veh, 1, getMods(veh, 1), true)
- --Rear Bumper
- VEHICLE.SET_VEHICLE_MOD(veh, 2, getMods(veh, 2), true)
- --Side Skirt
- VEHICLE.SET_VEHICLE_MOD(veh, 3, getMods(veh, 3), true)
- --Exhaust
- VEHICLE.SET_VEHICLE_MOD(veh, 4, getMods(veh, 4), true)
- --Frame
- VEHICLE.SET_VEHICLE_MOD(veh, 5, getMods(veh, 5), true)
- --Grille
- VEHICLE.SET_VEHICLE_MOD(veh, 6, getMods(veh, 6), true)
- --Hood
- VEHICLE.SET_VEHICLE_MOD(veh, 7, getMods(veh, 7), true)
- --Fender
- VEHICLE.SET_VEHICLE_MOD(veh, 8, getMods(veh, 8), true)
- --Right Fender
- VEHICLE.SET_VEHICLE_MOD(veh, 9, getMods(veh, 9), true)
- --Roof
- VEHICLE.SET_VEHICLE_MOD(veh, 10, getMods(veh, 10), true)
- -----------------------------------------------
- -- These Mods are constant for every vehicle --
- -----------------------------------------------
- --Tint (-1 = Stock, 0 = None, 1 = Limo, 2 = Dark Smoke, 3 = Light Smoke, 4 = None, 5 = Blacked Out, 6 =
- Green)
- VEHICLE.SET_VEHICLE_WINDOW_TINT(veh, 1)
- --Turbo
- VEHICLE.TOGGLE_VEHICLE_MOD(veh, 18, true)
- --Headlights(22=Xenon)
- VEHICLE.TOGGLE_VEHICLE_MOD(veh, 22, true)
- --Engine (0: Level 1, 1: Level 2, 2: Level 3, 3: Level 4)
- VEHICLE.SET_VEHICLE_MOD(veh, 11, getMods(veh, 11), true)
- --Brakes (0: Street, 1: Sport, 2: Race )
- VEHICLE.SET_VEHICLE_MOD(veh, 12, getMods(veh, 12), true)
- --Transmission (1: Street, 2: Sport, 3: Race)
- VEHICLE.SET_VEHICLE_MOD(veh, 13, getMods(veh, 13), true)
- --Horns
- --[[0: Truck, 1: Cop, 2: Clown
- --3: Musical 1, 4: Musical 2, 5: Musical 3, 6: Musical 4, 7: Musical 5
- --8: Classical 1, 9: Classical 2, 10: Classical 3, 11: Classical 4, 12: Classical 5, 13:
- Classical 6, 14:
- Classical 7
- --15: Do, 16: Re, 17: Mi, 18: Fa, 19: Sol, 20: La, 21: Ti, 22: Do (High)
- --23: Jazz 1, 24: Jazz 2, 25: Jazz 3, 26: Jazz Loop
- --27: Star Spangled Banner 1, 28: Star Spangled Banner 2, 29: Star Spangled Banner 3,
- 30: Star Spangled
- Banner 4
- ]]--
- VEHICLE.SET_VEHICLE_MOD(veh, 14, 1, true)
- --Suspension (0: Lowered, 1: Street, 2: Sport, 3: Competition)
- VEHICLE.SET_VEHICLE_MOD(veh, 15, getMods(veh, 15), true)
- --Armor (0: 20%, 1: 40%, 2: 60%, 3: 80%, 4: 100%)
- VEHICLE.SET_VEHICLE_MOD(veh, 16, getMods(veh, 16), true)
- --Clean and repair
- repairVeh(veh)
- --Set rim style
- setWheels(veh)
- --Wheel Color, Black
- VEHICLE.SET_VEHICLE_EXTRA_COLOURS(veh,111,1)
- local testmodule = {}
- end
- --------------------------------------------------
- -- Bare Minimum Mods (,) --
- --------------------------------------------------
- if(get_key_pressed(188))then
- VEHICLE.SET_VEHICLE_MOD_KIT(veh, 0)
- VEHICLE.SET_VEHICLE_NUMBER_PLATE_TEXT(veh, 'DR PEPPER')
- --Spoilers
- VEHICLE.SET_VEHICLE_MOD(veh, 0, getMinMods(veh, 0), true)
- --Front Bumper
- VEHICLE.SET_VEHICLE_MOD(veh, 1, getMinMods(veh, 1), true)
- --Rear Bumper
- VEHICLE.SET_VEHICLE_MOD(veh, 2, getMinMods(veh, 2), true)
- --Side Skirt
- VEHICLE.SET_VEHICLE_MOD(veh, 3, getMinMods(veh, 3), true)
- --Exhaust
- VEHICLE.SET_VEHICLE_MOD(veh, 4, getMinMods(veh, 4), true)
- --Frame
- VEHICLE.SET_VEHICLE_MOD(veh, 5, getMinMods(veh, 5), true)
- --Grille
- VEHICLE.SET_VEHICLE_MOD(veh, 6, getMinMods(veh, 6), true)
- --Hood
- VEHICLE.SET_VEHICLE_MOD(veh, 7, getMinMods(veh, 7), true)
- --Fender
- VEHICLE.SET_VEHICLE_MOD(veh, 8, getMinMods(veh, 8), true)
- --Right Fender
- VEHICLE.SET_VEHICLE_MOD(veh, 9, getMinMods(veh, 9), true)
- --Roof
- VEHICLE.SET_VEHICLE_MOD(veh, 10, getMinMods(veh, 10), true)
- local testmodule = {}
- end
- --Silver Rims (N)
- if(get_key_pressed(78))then
- VEHICLE.SET_VEHICLE_MOD_KIT(veh, 0)
- --Set rim style
- setWheels(veh)
- --Rim Color (vehicle, type, color index
- VEHICLE.SET_VEHICLE_EXTRA_COLOURS(veh,111,4)
- --Repair/Clean Vehicle
- repairVeh(veh)
- local testmodule = {}
- end
- --Black Color Coordination (Numpad 1)
- if(get_key_pressed(97))then
- VEHICLE.SET_VEHICLE_MOD_KIT(veh, 0)
- VEHICLE.CLEAR_VEHICLE_CUSTOM_PRIMARY_COLOUR(veh)
- VEHICLE.CLEAR_VEHICLE_CUSTOM_SECONDARY_COLOUR(veh)
- VEHICLE.SET_VEHICLE_COLOURS(veh, 1, 1)
- --Rim Color (vehicle, type, color index
- VEHICLE.SET_VEHICLE_EXTRA_COLOURS(veh,120,1)
- --Tire Smoke
- VEHICLE.TOGGLE_VEHICLE_MOD(veh, 20, true)
- VEHICLE.SET_VEHICLE_TYRE_SMOKE_COLOR(veh, 8,8,8)
- --Repair/Clean Vehicle
- repairVeh(veh)
- local testmodule = {}
- end
- --Blue Color Coordination (Numpad 2)
- if(get_key_pressed(98))then
- VEHICLE.SET_VEHICLE_MOD_KIT(veh, 0)
- VEHICLE.CLEAR_VEHICLE_CUSTOM_PRIMARY_COLOUR(veh)
- VEHICLE.CLEAR_VEHICLE_CUSTOM_SECONDARY_COLOUR(veh)
- VEHICLE.SET_VEHICLE_COLOURS(veh, 73, 73)
- --Rim Color (vehicle, type, color index
- VEHICLE.SET_VEHICLE_EXTRA_COLOURS(veh,70,73)
- --Tire Smoke
- VEHICLE.TOGGLE_VEHICLE_MOD(veh, 20, true)
- VEHICLE.SET_VEHICLE_TYRE_SMOKE_COLOR(veh, 0,85,196)
- --Repair/Clean Vehicle
- repairVeh(veh)
- local testmodule = {}
- end
- --Red Color Coordination (Numpad 3)
- if(get_key_pressed(99))then
- VEHICLE.SET_VEHICLE_MOD_KIT(veh, 0)
- VEHICLE.CLEAR_VEHICLE_CUSTOM_PRIMARY_COLOUR(veh)
- VEHICLE.CLEAR_VEHICLE_CUSTOM_SECONDARY_COLOUR(veh)
- VEHICLE.SET_VEHICLE_COLOURS(veh, 29, 29)
- --Rim Color (vehicle, type, color index
- VEHICLE.SET_VEHICLE_EXTRA_COLOURS(veh,28,29)
- --Tire Smoke
- VEHICLE.TOGGLE_VEHICLE_MOD(veh, 20, true)
- VEHICLE.SET_VEHICLE_TYRE_SMOKE_COLOR(veh, 138,11,0)
- --Repair/Clean Vehicle
- repairVeh(veh)
- local testmodule = {}
- end
- --Yellow Color Coordination (Numpad 4)
- if(get_key_pressed(100))then
- VEHICLE.SET_VEHICLE_MOD_KIT(veh, 0)
- VEHICLE.CLEAR_VEHICLE_CUSTOM_PRIMARY_COLOUR(veh)
- VEHICLE.CLEAR_VEHICLE_CUSTOM_SECONDARY_COLOUR(veh)
- VEHICLE.SET_VEHICLE_MOD_COLOR_1(veh, 1,33,33)
- VEHICLE.SET_VEHICLE_MOD_COLOR_2(veh, 1,33)
- --Rim Color (vehicle, type, color index
- VEHICLE.SET_VEHICLE_EXTRA_COLOURS(veh,5,89)
- --Tire Smoke
- VEHICLE.TOGGLE_VEHICLE_MOD(veh, 20, true)
- VEHICLE.SET_VEHICLE_TYRE_SMOKE_COLOR(veh, 217,166,0)
- --Repair/Clean Vehicle
- repairVeh(veh)
- local testmodule = {}
- end
- --Green Color Coordination (Numpad 5)
- if(get_key_pressed(101))then
- VEHICLE.SET_VEHICLE_MOD_KIT(veh, 0)
- VEHICLE.CLEAR_VEHICLE_CUSTOM_PRIMARY_COLOUR(veh)
- VEHICLE.CLEAR_VEHICLE_CUSTOM_SECONDARY_COLOUR(veh)
- VEHICLE.SET_VEHICLE_COLOURS(veh, 0, 0)
- --Rim Color (vehicle, type, color index
- VEHICLE.SET_VEHICLE_EXTRA_COLOURS(veh,55,0)
- --Tire Smoke
- VEHICLE.TOGGLE_VEHICLE_MOD(veh, 20, true)
- VEHICLE.SET_VEHICLE_TYRE_SMOKE_COLOR(veh, 0,56,5)
- --Repair/Clean Vehicle
- repairVeh(veh)
- local testmodule = {}
- end
- --White Color Coordination (Numpad 6)
- if(get_key_pressed(102))then
- VEHICLE.SET_VEHICLE_MOD_KIT(veh, 0)
- VEHICLE.CLEAR_VEHICLE_CUSTOM_PRIMARY_COLOUR(veh)
- VEHICLE.CLEAR_VEHICLE_CUSTOM_SECONDARY_COLOUR(veh)
- VEHICLE.SET_VEHICLE_COLOURS(veh, 111, 111)
- --Rim Color (vehicle, type, color index
- VEHICLE.SET_VEHICLE_EXTRA_COLOURS(veh,112,111)
- --Tire Smoke
- VEHICLE.TOGGLE_VEHICLE_MOD(veh, 20, true)
- VEHICLE.SET_VEHICLE_TYRE_SMOKE_COLOR(veh, 240,240,240)
- --Repair/Clean Vehicle
- repairVeh(veh)
- local testmodule = {}
- end
- --Sliver Color Coordination (Numpad 7)
- if(get_key_pressed(103))then
- VEHICLE.SET_VEHICLE_MOD_KIT(veh, 0)
- VEHICLE.CLEAR_VEHICLE_CUSTOM_PRIMARY_COLOUR(veh)
- VEHICLE.CLEAR_VEHICLE_CUSTOM_SECONDARY_COLOUR(veh)
- VEHICLE.SET_VEHICLE_COLOURS(veh, 4, 4)
- --Rim Color (vehicle, type, color index
- VEHICLE.SET_VEHICLE_EXTRA_COLOURS(veh,111,4)
- --Tire Smoke
- VEHICLE.TOGGLE_VEHICLE_MOD(veh, 20, true)
- VEHICLE.SET_VEHICLE_TYRE_SMOKE_COLOR(veh, 8,8,8)
- --Repair/Clean Vehicle
- repairVeh(veh)
- local testmodule = {}
- end
- --Gold Color Coordination (Numpad 8)
- if(get_key_pressed(104))then
- VEHICLE.SET_VEHICLE_MOD_KIT(veh, 0)
- VEHICLE.CLEAR_VEHICLE_CUSTOM_PRIMARY_COLOUR(veh)
- VEHICLE.CLEAR_VEHICLE_CUSTOM_SECONDARY_COLOUR(veh)
- VEHICLE.SET_VEHICLE_MOD_COLOR_1(veh, 4,3,3)
- VEHICLE.SET_VEHICLE_MOD_COLOR_2(veh, 4,3)
- --Rim Color (vehicle, type, color index
- VEHICLE.SET_VEHICLE_EXTRA_COLOURS(veh,89,158)
- --Tire Smoke
- VEHICLE.TOGGLE_VEHICLE_MOD(veh, 20, true)
- VEHICLE.SET_VEHICLE_TYRE_SMOKE_COLOR(veh, 8,8,8)
- --Repair/Clean Vehicle
- repairVeh(veh)
- local testmodule = {}
- end
- --Chrome Color Coordination (Numpad 9)
- if(get_key_pressed(105))then
- VEHICLE.SET_VEHICLE_MOD_KIT(veh, 0)
- VEHICLE.CLEAR_VEHICLE_CUSTOM_PRIMARY_COLOUR(veh)
- VEHICLE.CLEAR_VEHICLE_CUSTOM_SECONDARY_COLOUR(veh)
- VEHICLE.SET_VEHICLE_MOD_COLOR_1(veh, 5,0,0)
- VEHICLE.SET_VEHICLE_MOD_COLOR_2(veh, 5,0)
- --Rim Color (vehicle, type, color index
- VEHICLE.SET_VEHICLE_EXTRA_COLOURS(veh,5,4)
- --Tire Smoke
- VEHICLE.TOGGLE_VEHICLE_MOD(veh, 20, true)
- VEHICLE.SET_VEHICLE_TYRE_SMOKE_COLOR(veh, 255,255,255)
- --Repair/Clean Vehicle
- repairVeh(veh)
- local testmodule = {}
- end
- ------------------------------------------------------------------
- -- Secondary Colors, Stripes, Details, etc --
- ------------------------------------------------------------------
- --black (B)
- if(get_key_pressed(66))then
- VEHICLE.CLEAR_VEHICLE_CUSTOM_SECONDARY_COLOUR(veh)
- VEHICLE.SET_VEHICLE_MOD_COLOR_2(veh, 1,0)
- local testmodule = {}
- end
- --white (J)
- if(get_key_pressed(74))then
- VEHICLE.CLEAR_VEHICLE_CUSTOM_SECONDARY_COLOUR(veh)
- VEHICLE.SET_VEHICLE_MOD_COLOR_2(veh, 1,73)
- local testmodule = {}
- end
- --chrome (K)
- if(get_key_pressed(75))then
- VEHICLE.CLEAR_VEHICLE_CUSTOM_SECONDARY_COLOUR(veh)
- VEHICLE.SET_VEHICLE_MOD_COLOR_2(veh, 5,0)
- local testmodule = {}
- end
- --yellow (L)
- if(get_key_pressed(76))then
- VEHICLE.CLEAR_VEHICLE_CUSTOM_SECONDARY_COLOUR(veh)
- VEHICLE.SET_VEHICLE_MOD_COLOR_2(veh, 1,33)
- local testmodule = {}
- end
- --red (I)
- if(get_key_pressed(73))then
- VEHICLE.CLEAR_VEHICLE_CUSTOM_SECONDARY_COLOUR(veh)
- VEHICLE.SET_VEHICLE_MOD_COLOR_2(veh, 1,14)
- local testmodule = {}
- end
- --light blue (O)
- if(get_key_pressed(79))then
- VEHICLE.CLEAR_VEHICLE_CUSTOM_SECONDARY_COLOUR(veh)
- VEHICLE.SET_VEHICLE_MOD_COLOR_2(veh, 1,53)
- local testmodule = {}
- end
- --dark blue (P)
- if(get_key_pressed(80))then
- VEHICLE.CLEAR_VEHICLE_CUSTOM_SECONDARY_COLOUR(veh)
- VEHICLE.SET_VEHICLE_MOD_COLOR_2(veh, 1,52)
- local testmodule = {}
- end
- end
- end
- end
- return car
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement