Jump to content

[V|REL|HOOK] LUA Plugin for Script Hook V


headscript

Recommended Posts

headscript

Has anyone figured out a way of using the xbox controller buttons ?

also im trying to a mod that will automatically turn on the light once in any car, and toggle the high beams with the B[red button], and disable the cinematic view which is on the same button i want to use.

 

i've found these in the nativeDB,

void SET_VEHICLE_FULLBEAM(Vehicle vehicle, BOOL state) // 8B7FD87F0DDB421E 9C49CC15

BOOL GET_VEHICLE_LIGHTS_STATE(Vehicle vehicle, Any *p1, Any *p2) // B91B4C20085BD12F 7C278621

void SET_VEHICLE_LIGHTS(Any p0, Any p1) // 34E710FF01247C5A E8930226

 

i've put togtehter this script but i can't seem to get it working :

local LightMod = {}playerPed = PLAYER.PLAYER_PED_ID()player = PLAYER.GET_PLAYER_PED(playerPed)playerVehicle = PED.GET_VEHICLE_PED_IS_USING(playerPed)VEHICLE.SET_VEHICLE_LIGHTS(playerVehicle, true)endreturn LightMod

any help appreciated .. :)

 

i

1. Has anyone figured out a way of using the xbox controller buttons ? i used some in my Traindriver mod check it out :)

2. i've put togtehter this script but i can't seem to get it working : Check on the Wik i(same website as the Download page) how to make a mod and look at the examples ( u missing 2 functions (init,tick) also your end ends nothing^^(so i guess u never used Lua or read anything about Lua) ?

Edited by headscript
Link to comment
Share on other sites

vithepunisher

Am i the only one with this not working? the asi loader says it loads by my lua scripts aint working at all someone please pm me an older version :/

Link to comment
Share on other sites

diamond-optic

Am i the only one with this not working? the asi loader says it loads by my lua scripts aint working at all someone please pm me an older version :/

 

 

you could try the LUA_SDK.asi and see if the console prints out any info

Link to comment
Share on other sites

vithepunisher

 

Am i the only one with this not working? the asi loader says it loads by my lua scripts aint working at all someone please pm me an older version :/

 

 

you could try the LUA_SDK.asi and see if the console prints out any info

 

I did and got this it is attempting to load even my asi loader is making it work its just not loading the lua scripts :/Untitled.jpg

Link to comment
Share on other sites

diamond-optic

well 'Not init 2' is not very helpful now is it haha (at least not to me).. Though someone like headscript would probably know what that means..

 

is that all it says? like even if you scroll up to the beginning?

..you could try removing the lua scripts (just the ones you put in /scripts/addins/, leaving the lua files in the main scripts folder that came with the plugin) and seeing if it says anything different with no scripts loading.. (with no addin scripts loading, there should still be some output to the console coming from the main.lua) and if so, maybe try using 1 script at a time if youre trying to run several. Kind of a pain I know, but it could help with narrowing down the cause by removing the possibility of a problem with a script itself

Edited by diamond-optic
Link to comment
Share on other sites

I tried many versions myself, tried removing the scripts that I used after my lua stopped working, and nothing shows me why or when my lua stopped working.

 

Very very weird, and quite annoying, I really was waiting the week end to relaxe on GTA, lua scripts are a big part of my experience.

 

7, 9 and 10 don't seem to be working for me. SDK loads properly. I'm scratching my head on this one, can't figure out where the incompatibility starts.

Edited by The_XXI
Link to comment
Share on other sites

boss of g-unit

@headscript yea this is my first attempt, i have some good skills on other languages like c# and java , although lua is all another kind of code .. ty ..

 

i went through the examples u gave,

 

here's what came up :

local LightMod = {}function LightMod.unload()endfunction LightMod.Lights()	local playerPed = PLAYER.PLAYER_PED_ID()        local playerVehicle = PED.GET_VEHICLE_PED_IS_USING(playerPed)        VEHICLE.SET_VEHICLE_LIGHTS(playerVehicle, 1)endfunction LightMod.init()	LightMod.Lights()endfunction LightMod.tick()endreturn LightMod

sadly still not working ..

Edited by boss of g-unit
Link to comment
Share on other sites

MerryWeather

Hi @headscript

I'd like to know how to use a combination of keystrokes as the hotkey. For instance, I want to use Ctrl+F7 to trigger some code, while "get_key_pressed(keycode)" is the only function for keyboard events as far as I know, however the following code does not work.

Do you know any documentations on keyboard events in LUA and the libraries you used? Having a combination of hotkeys can free up the (already) crowded hotkey space for LUA script writers :)

function myscript.tick()  --not working  if(get_key_pressed(Keys.ControlKey) and get_key_pressed(Keys.F7)) then     ...  endend
Edited by MerryWeather
Link to comment
Share on other sites

diamond-optic

@headscript yea this is my first attempt, i have some good skills on other languages like c# and java , although lua is all another kind of code .. ty ..

 

i went through the examples u gave,

 

here's what came up :

local LightMod = {}function LightMod.unload()endfunction LightMod.Lights()	local playerPed = PLAYER.PLAYER_PED_ID()        local playerVehicle = PED.GET_VEHICLE_PED_IS_USING(playerPed)        VEHICLE.SET_VEHICLE_LIGHTS(playerVehicle, 1)endfunction LightMod.init()	LightMod.Lights()endfunction LightMod.tick()endreturn LightMod

sadly still not working ..

 

 

you're only calling the LightMod.Lights() function 1 time and only when the plugin first loads. Move the function call from init to tick..

 

and you may also want to use an if statement so youre not trying to set a vehicle's lights when not actually in one:

 

 

if(playerVehicle) then  VEHICLE.SET_VEHICLE_LIGHTS(playerVehicle, 1)end
Edited by diamond-optic
Link to comment
Share on other sites

diamond-optic

 

Hi @headscript

 

I'd like to know how to use a combination of keystrokes as the hotkey. For instance, I want to use Ctrl+F7 to trigger some code, while "get_key_pressed(keycode)" is the only function for keyboard events as far as I know, however the following code does not work.

 

Do you know any documentations on keyboard events in LUA and the libraries you used? Having a combination of hotkeys can free up the (already) crowded hotkey space for LUA script writers :)

function myscript.tick()  --not working  if(get_key_pressed(Keys.ControlKey) and get_key_pressed(Keys.F7)) then     ...  endend
if(get_key_pressed(Keys.ControlKey) and get_key_pressed(Keys.F7)) then  print("pressing ctrl & f7")end

works fine for me...

Edited by diamond-optic
Link to comment
Share on other sites

vithepunisher

fixed it guys updated everything used the sdk lua and removed the lua scripts only left 1 in and its perfect now :santa:

  • Like 1
Link to comment
Share on other sites

Hmm, new problem guys. Now, any time I try to load into Online, I hear 3 sounds, and then the game crashes. This happens after the black cmd window shows up (the one telling me the lua scripts have been loaded).

 

The sounds are the ones that you'd get if you tried to close out a window, but you aren't allowed to select that window, you know what I mean? Like the error type sound?

 

Single player still works fine. But damn dude...I wanna online sometimes. Is there an easy way to just completely disable the script at times? Like, without having to go in and delete the files every time I wanna play online?

 

Thanks bros

Edited by thenimboo
Link to comment
Share on other sites

diamond-optic

youre going to have to remove all your asi files etc to go online

Link to comment
Share on other sites

Really optic? Is this a new thing? It used to work just fine, I haven't changed anything

Edited by thenimboo
Link to comment
Share on other sites

boss of g-unit

@diamond-optic

i've tried what you suggested and now it's like this :

local LightMod = {}local playerPed = PLAYER.PLAYER_PED_ID()local playerVehicle = PED.GET_VEHICLE_PED_IS_USING(playerPed)function LightMod.unload()endfunction LightMod.init()endfunction LightMod.tick()	if(playerVehicle) then  	VEHICLE.SET_VEHICLE_LIGHTS(playerVehicle, 1)	endendreturn LightMod

still no luck, am i declaring the local variables in the wrong place ?

Edited by boss of g-unit
Link to comment
Share on other sites

headscript

 

@diamond-optic

i've tried what you suggested and now it's like this :

local LightMod = {}local playerPed = PLAYER.PLAYER_PED_ID()local playerVehicle = PED.GET_VEHICLE_PED_IS_USING(playerPed)function LightMod.unload()endfunction LightMod.init()endfunction LightMod.tick()	if(playerVehicle) then  	VEHICLE.SET_VEHICLE_LIGHTS(playerVehicle, 1)	endendreturn LightMod

still no luck, am i declaring the local variables in the wrong place ?

 

get the ped and vehicle each tick else because they can change

 

Can you convert my mod to ASI?

maybe? give me more details

Link to comment
Share on other sites

Yo, could you please convert this to a .asi , cant get it to work with the LUA atm. Thanks in advance.

 

http://pastebin.com/vjUCBS4D

 

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

Link to comment
Share on other sites

headscript

https://www.gta5-mods.com/scripts/another-bank-job

 

Well there are 2 .lua files. Is it possible to put them in one .asi?

 

Also since I will be updating this frequently, can you tell me how to convert it myself?

Well there are 2 .lua files. Is it possible to put them in one .asi? yes

Also since I will be updating this frequently, can you tell me how to convert it myself? no sorry thats not possible(yet)

 

@Scrave

can you please provide it as pastebin and not as fulltext

also why doesnt it work?

Edited by headscript
Link to comment
Share on other sites

I'm getting errors in the main.lua when I ran a script.

 

line 145 "Attempt to index local 'mod' (a boolean value) this keeps ticking

and line 59 "Attempt to index field <?> (A boolean value) --- This is done one when time the script loads

 

All names match.

 

Here is the script I'm loading called PacificNoose.lua that's causing this to happen.

 

http://pastebin.com/mQd9GnWP

 

Also I have exactly 3 scripts running, if that makes a difference.

Edited by Trifecta
Link to comment
Share on other sites

boss of g-unit

@headscript

the SET_VEHICLE_LIGHTS is working only if i clear it to 0, which wil disable any way of turning on the lights, but when set it to 1, everything works normally.

how to i get it to to stay on ?? or is there any other function to turn the headlights on and off ?

Link to comment
Share on other sites

diamond-optic

I'm getting errors in the main.lua when I ran a script.

 

line 145 "Attempt to index local 'mod' (a boolean value) this keeps ticking

and line 59 "Attempt to index field <?> (A boolean value) --- This is done one when time the script loads

 

All names match.

 

Here is the script I'm loading called PacificNoose.lua that's causing this to happen.

 

http://pastebin.com/mQd9GnWP

 

Also I have exactly 3 scripts running, if that makes a difference.

 

you need to change the return value at the end to PacificNoose instead of basemodule

Edited by diamond-optic
Link to comment
Share on other sites

 

I'm getting errors in the main.lua when I ran a script.

 

line 145 "Attempt to index local 'mod' (a boolean value) this keeps ticking

and line 59 "Attempt to index field <?> (A boolean value) --- This is done one when time the script loads

 

All names match.

 

Here is the script I'm loading called PacificNoose.lua that's causing this to happen.

 

http://pastebin.com/mQd9GnWP

 

Also I have exactly 3 scripts running, if that makes a difference.

 

you need to change the return value at the end to PacificNoose instead of basemodule

 

 

f*ck me... I'm such an idiot sometimes. I used replace all and it must not have changed the final line for some strange reason :/ Thanks mate.

Link to comment
Share on other sites

diamond-optic

f*ck me... I'm such an idiot sometimes. I used replace all and it must not have changed the final line for some strange reason :/ Thanks mate.

 

lol same thing happened to me the other day so I knew exactly what the cause was when you posted that lol

...and it took me a while till I noticed the mistake I made too lol

Link to comment
Share on other sites

darkphoenixxx

headscipt, can you help me? why

coordsy = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0)vehh = VEHICLE.CREATE_VEHICLE(GAMEPLAY.GET_HASH_KEY("REBEL2"), coordsy.x, coordsy.y, coordsy.z, 0.0, 1, 1)

does not work? (playerPed is defined)

Link to comment
Share on other sites

When I try to run any script that uses GUI I get an error:

This is the script:

http://pastebin.com/6y9uin1n

 

The error is tick: .../GUI.lua:96: attempt to call field 'renderBox' (a nil value)

 

The thing is that there is no renderBox function. Anyone has a fixed GUI script for easy use?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.