Jump to content

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


headscript

Recommended Posts

I have a bug with the version 9, if I load a save or take a taxi and skip the ride, the lua loader die and no lua mods are working. Is there a way to fix this?

Link to comment
Share on other sites

diamond-optic

Um everytime I install this I'm getting an error depicting that both of the lua.asi files have failed to load, why??

well theres the obligatory response, do you have the VS 2013 x64 redistributable installed?

 

and also, what do you mean by both the lua.asi files? are you running 2 of them at once?

Link to comment
Share on other sites

Vrock_wave

guys I'm trying to create a menu for Lua I create buttons in this manner

Menu.GUI.addButton("*-=Vrock=-*-=Gen-options=-*",Menu.Name,0,0.5,0.05,0.05)

the question of how to remove them when they are no longer needed me?

Link to comment
Share on other sites

darkphoenixxx

guys I'm trying to create a menu for Lua I create buttons in this manner

Menu.GUI.addButton("*-=Vrock=-*-=Gen-options=-*",Menu.Name,0,0.5,0.05,0.05)

the question of how to remove them when they are no longer needed me?

a = Menu.GUI.addButton("*-=Vrock=-*-=Gen-options=-*",Menu.Name,0,0.5,0.05,0.05)

Menu.GUI.removeButton(a)

 

does that work? i have no clue what i just wrote, btw

Link to comment
Share on other sites

Vrock_wave

 

guys I'm trying to create a menu for Lua I create buttons in this manner

Menu.GUI.addButton("*-=Vrock=-*-=Gen-options=-*",Menu.Name,0,0.5,0.05,0.05)

the question of how to remove them when they are no longer needed me?

a = Menu.GUI.addButton("*-=Vrock=-*-=Gen-options=-*",Menu.Name,0,0.5,0.05,0.05)

Menu.GUI.removeButton(a)

 

does that work? i have no clue what i just wrote, btw

 

no it's not working, I was looking on the internet functions but nothing worked to remove

There is only this but it hides all menus and I need to remove individual buttons

Menu.GUI.hidden = true

Link to comment
Share on other sites

headscript

 

 

guys I'm trying to create a menu for Lua I create buttons in this manner

Menu.GUI.addButton("*-=Vrock=-*-=Gen-options=-*",Menu.Name,0,0.5,0.05,0.05)

the question of how to remove them when they are no longer needed me?

a = Menu.GUI.addButton("*-=Vrock=-*-=Gen-options=-*",Menu.Name,0,0.5,0.05,0.05)

Menu.GUI.removeButton(a)

 

does that work? i have no clue what i just wrote, btw

 

no it's not working, I was looking on the internet functions but nothing worked to remove

There is only this but it hides all menus and I need to remove individual buttons

Menu.GUI.hidden = true

 

try to add this to the GUI.lua

function GUI.removeButton(name)	for buttonID, buttonSettings in ipairs(GUI.GUI) do 		if(buttonSettings["name"] == name) then			table.remove(GUI.GUI,buttonID)			return true		end	end	return falseend

havent tested it though^^

 

updated the normal v10 to a more current version

Edited by headscript
Link to comment
Share on other sites

Does anyone know how to get PLAYER.PLAYER_ID() works properly? It always returns 0. Wtf? How to get real player id? And I don't need ped id. Bcz _SET_MOVE_SPEED_MULTIPLIER() not works with ped id for example.

Link to comment
Share on other sites

Hey guys, I need help! This isn't working for me at all.

 

Here are the files that I have in D:\Program Files\SteamLibrary\steamapps\common\Grand Theft Auto V right now:

 

ScripthookV.dll

dinput8.dll (asi loader)

EnhancedNativeTrainer.asi

lua.asi

noclipv13.lua

 

In game though, all that works is the enhanced native trainer. I push F4, the enhanced trainer menu pops up, and everything works beautifully.

 

The LUA script? Not so much. What am I doing wrong?

 

I have installed

I saw some things about the scripts/addins folder. I don't have those, never saw them, can't find them anywhere on my computer. Kind of figured it didn't matter, as the EnhancedNativeTrainer worked when I just put it in the same folder as Scripthook.

Any advice peeps?

Thanks :)

Link to comment
Share on other sites

diamond-optic

the *.lua file has to be in /scripts/addins folder ..just create the folder and put it there

Add any Scripts you want into the scripts/addins folder




the enhanced native trainer works in the root directory because its an asi file, and has nothing to do with this lua plugin


*edit*

actually you probably need to redownload this plugin (the whole package, maybe you just downloaded the latest lua.asi file from github?), because you need other files that go in the scripts folder for it function

you should have:

/scripts/keys.lua
/scripts/main.lua
/scripts/utils.lua
/scripts/libs/gui.lua

and any lua scripts you download/write need to be in /scripts/addins/

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

Thanks so much Diamond-optic! You're the sh*t bro. You were right, I was missing those other files, and I needed it to be inside the addins folder.

 

Appreciate you brotha

Link to comment
Share on other sites

diamond-optic

Thanks so much Diamond-optic! You're the sh*t bro. You were right, I was missing those other files, and I needed it to be inside the addins folder.

 

Appreciate you brotha

you're welcome :-)

 

 

 

--------------------------

 

has anyone figured out how to do menus with multiple levels.. like where selecting a menu option off the initial menu, brings up another menu? do I need a seperate gui lib for each one?

 

basically trying to make a weapon menu to get individual guns (instead of ALL guns like trainers).. so i want the 1st menu to show like the weapon categories, then seperate menus for those that show the individual guns in the selected category

..I was hoping i could just do something like:

 

 

WeaponMenu.GUI_Main = Libs["WeaponMenu_GUI"]WeaponMenu.GUI_Pistols = Libs["WeaponMenu_GUI"]
and just have the Main show first, and if you select the Pistols category from that menu, it would switch to showing the Pistols menu, etc...

 

but when I add buttons to both of them, all of the buttons show on the initial menu.. like:

 

 

WeaponMenu.GUI_Main.addButton...WeaponMenu.GUI_Pistols.addButton...
and then like:

 

 

WeaponMenu.GUI_Main.hidden = false
shows any buttons added on 1 single menu Edited by diamond-optic
Link to comment
Share on other sites

Just a quick question.
Is there any chance we can get the console interface back? It was very very helpful for debugging errors.

Link to comment
Share on other sites

headscript

 

Thanks so much Diamond-optic! You're the sh*t bro. You were right, I was missing those other files, and I needed it to be inside the addins folder.

 

Appreciate you brotha

you're welcome :-)

 

 

 

--------------------------

 

has anyone figured out how to do menus with multiple levels.. like where selecting a menu option off the initial menu, brings up another menu? do I need a seperate gui lib for each one?

 

basically trying to make a weapon menu to get individual guns (instead of ALL guns like trainers).. so i want the 1st menu to show like the weapon categories, then seperate menus for those that show the individual guns in the selected category

..I was hoping i could just do something like:

 

 

WeaponMenu.GUI_Main = Libs["WeaponMenu_GUI"]WeaponMenu.GUI_Pistols = Libs["WeaponMenu_GUI"]
and just have the Main show first, and if you select the Pistols category from that menu, it would switch to showing the Pistols menu, etc...

 

but when I add buttons to both of them, all of the buttons show on the initial menu.. like:

 

 

WeaponMenu.GUI_Main.addButton...WeaponMenu.GUI_Pistols.addButton...
and then like:

 

 

WeaponMenu.GUI_Main.hidden = false
shows any buttons added on 1 single menu

My GUI lib was actually only a example of how to make libs but the more people want to use it I may gonna continue the development of it, everyone could work on it actually just modify it and make a pull request on Github

Just a quick question.

Is there any chance we can get the console interface back? It was very very helpful for debugging errors.

The Sdk version has the console
Link to comment
Share on other sites

GTAGeek123

I trying to modify a script and I'm trying to use the GET_VEHICLE_NEON_LIGHTS_COLOUR function. However, I'm getting a attempt to call field 'GET_VEHICLE_NEON_LIGHTS_COLOUR' <a nil value error>. Are the Neon functions not usable with the LUA plugin yet? I thought the nativeDB was updated every 10 minutes?

 

Here's part of the script that I'm using that has the Neon code:

 

local neonid2 = VEHICLE.GET_VEHICLE_NEON_LIGHTS_COLOUR(v, 0, 0, 0)
table.insert( vals, neonid2)

 

Note:I'm using version 10 (SDK).

Edited by GTAGeek123
Link to comment
Share on other sites

Fireboyd78

I trying to modify a script and I'm trying to use the GET_VEHICLE_NEON_LIGHTS_COLOUR function. However, I'm getting a attempt to call field 'GET_VEHICLE_NEON_LIGHTS_COLOUR' <a nil value error>. Are the Neon functions not usable with the LUA plugin yet? I thought the nativeDB was updated every 10 minutes?

 

Here's part of the script that I'm using that has the Neon code:

 

local neonid2 = VEHICLE.GET_VEHICLE_NEON_LIGHTS_COLOUR(v, 0, 0, 0)

table.insert( vals, neonid2)

 

Note:I'm using version 10 (SDK).

You're missing the underscore in front of the name because we don't know the actual name for that native yet.

Link to comment
Share on other sites

GTAGeek123

CarLuver69,

 

Would the correct script then be:

 

local neonid2 = VEHICLE._GET_VEHICLE_NEON_LIGHTS_COLOUR(v, 0, 0, 0)
table.insert( vals, neonid2)

 

?

 

Edit:NM The scripted worked with the underscore thanks!

Edited by GTAGeek123
Link to comment
Share on other sites

 

Will there be support for pointers?

E.G: Natives like http://www.dev-c.com/nativedb/func/info/c33ab876a77f8164

its supported try it just use 0 as the pointer and the return is bool, ped

 

I tried it earlier but I couldn't get it working.

If you have skype, do you mind PMing me it so you can assist me? I don't want to ask so many questions on your thread :p

Link to comment
Share on other sites

headscript

 

 

Will there be support for pointers?

E.G: Natives like http://www.dev-c.com/nativedb/func/info/c33ab876a77f8164

its supported try it just use 0 as the pointer and the return is bool, ped

 

I tried it earlier but I couldn't get it working.

If you have skype, do you mind PMing me it so you can assist me? I don't want to ask so many questions on your thread :p

 

cant pm you

Link to comment
Share on other sites

 

 

 

Will there be support for pointers?

E.G: Natives like http://www.dev-c.com/nativedb/func/info/c33ab876a77f8164

its supported try it just use 0 as the pointer and the return is bool, ped

 

I tried it earlier but I couldn't get it working.

If you have skype, do you mind PMing me it so you can assist me? I don't want to ask so many questions on your thread :p

 

cant pm you

 

Damn. I'll try get it working on my own :p

Thanks for the help.

 

One last question, are all pointers in the nativesdb supported?

http://www.dev-c.com/nativedb/func/info/cff869cbfa210d82

http://www.dev-c.com/nativedb/func/info/23f8f5fc7e8c4a6b

Link to comment
Share on other sites

headscript

 

 

 

 

Will there be support for pointers?

E.G: Natives like http://www.dev-c.com/nativedb/func/info/c33ab876a77f8164

its supported try it just use 0 as the pointer and the return is bool, ped

 

I tried it earlier but I couldn't get it working.

If you have skype, do you mind PMing me it so you can assist me? I don't want to ask so many questions on your thread :p

 

cant pm you

 

Damn. I'll try get it working on my own :p

Thanks for the help.

 

One last question, are all pointers in the nativesdb supported?

http://www.dev-c.com/nativedb/func/info/cff869cbfa210d82

http://www.dev-c.com/nativedb/func/info/23f8f5fc7e8c4a6b

 

should be but not all pointer arrays only get near vehicles and peds

Link to comment
Share on other sites

 

 

 

 

 

Will there be support for pointers?

E.G: Natives like http://www.dev-c.com/nativedb/func/info/c33ab876a77f8164

its supported try it just use 0 as the pointer and the return is bool, ped

 

I tried it earlier but I couldn't get it working.

If you have skype, do you mind PMing me it so you can assist me? I don't want to ask so many questions on your thread :p

 

cant pm you

 

Damn. I'll try get it working on my own :p

Thanks for the help.

 

One last question, are all pointers in the nativesdb supported?

http://www.dev-c.com/nativedb/func/info/cff869cbfa210d82

http://www.dev-c.com/nativedb/func/info/23f8f5fc7e8c4a6b

 

should be but not all pointer arrays only get near vehicles and peds

 

Ah, alright.

You're probably hating me for all these questions but I'll leave you alone after this last one. :p

http://www.dev-c.com/nativedb/func/info/6c4d0409ba1a2bc2

 

I used that earlier and the return value was nil if when I made sure I was using a weapon.

It also crashed my game occasionally.

 

Any ideas?

Edited by Lynxaa
Link to comment
Share on other sites

GTAGeek123

Hello,

 

I'm trying to subtract 1 from the value that is being populated from the table.insert command below and then make the next value have the result (so for example when val 55 has a vlaue of 0 I need val 56 to be -1).

 

Here's part of my current script:

 

table.insert (vals, VEHICLE.IS_VEHICLE_EXTRA_TURNED_ON(v,1)) <--This is the 55th value in the table.
table.insert (vals[55]-1)

 

However I get error:

 

attempt to perform arithmetic on field '?' (a boolean value).

 

Any Ideas?

 

 

Edit: I also tried making the value the pulled for val 55 be one less, but I get the same error. So if anyone knows a way I can get val 55 to be one less then what is pulled or val 56 to be one less then val 55 it would be most appreciated.

Edited by GTAGeek123
Link to comment
Share on other sites

You're deducting from the value, rather than the index. try putting the -1 in the brackets. vals[55-1] = val[54]

Link to comment
Share on other sites

GTAGeek123

Tiryll,

 

Its the value I'm trying to change not the index. I appreciate your input though.

Edited by GTAGeek123
Link to comment
Share on other sites

Are you doing this from index 1 all the way to end?

if(vals[key-1] == -1) then   vals[key] = 0  elseif(vals[key-1] == 0)then   vals[key] = -1  end

Would something like this work? it's checking previous index value to see if it matches and if it does it updates the current index or could skip current and get the one after (if it exists) things like this need checks though at both ends for out of index errors or whatever they're called

Link to comment
Share on other sites

boss of g-unit

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

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

Is there any way to _SET_MOVE_SPEED_MULTIPLIER() higher than 1.49 ? Or maybe somehow increase an animation speed of ped?

Edited by B-aaa
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.