Jump to content

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


Recommended Posts

headscript

 

@headscript. I am new member, and have searched earnestly for a way to PM you a request, but have found no method to PM on this site. Can you please covert to independent ASI for this LUA script please??

 

https://www.gta5-mods.com/scripts/another-bank-job(need converted to ASI)

 

LUA scripts do not work on my PC.

 

ASI: Loading "C:\Program Files (x86)\Steam\steamapps\common\Grand Theft Auto V\LUA.asi"

"LUA.asi" failed to load

That won't fix the issue itself, but this issue should be fixed in the next version when u don't need any redist, for now just reinstall the visual Studio 2013 x64 redist

I have a little problem with Lua scripts lately. Few days ago I tried a script for GTA V with key bindings for X-Box gamepad. Up to that moment all 5 Lua scripts worked perfectly with keyboard. Script somehow changed page code or some settings and now I can use only gamepad. Keyboard in Lua don't work. Any Idea, how to repair that. I used SDK version of Lua. Is it saving something somewhere, in the registry perhaps. Is it possible to return the functions to keyboard?

headscript

I have a little problem with Lua scripts lately. Few days ago I tried a script for GTA V with key bindings for X-Box gamepad. Up to that moment all 5 Lua scripts worked perfectly with keyboard. Script somehow changed page code or some settings and now I can use only gamepad. Keyboard in Lua don't work. Any Idea, how to repair that. I used SDK version of Lua. Is it saving something somewhere, in the registry perhaps. Is it possible to return the functions to keyboard?

its not really the fault of my plugin its GetAsyncKeyState from Windows which somehow makes problems with some users systems, sorry i dont know much about the internals of windows

boss of g-unit

headscript can you add the xbox key codes to the key list here's the list :

A - 18
B - 45
X - 22
Y - 23
LB - 37
RB - 44
L2 - 10
R2 - 11
L3 - 28
R3 - 29
Select - 0
D-Pad:
Left - 15
Right - 74
Up - 27
Down - 19
Left-Stick:
Left - 34
Right - 9
Up - 32
Down - 8
Right-Stick:
Left - 5
Right - 1
Up - 3
Down - 2
to be used with the :
CONTROLS.IS_CONTROL_PRESSED(2,"Code From above")
zeairmouse

How do you use the function PLAYER._GET_AIMED_ENTITY ?

 

UOUoh8A.png

 

On the native functions it receives a player and a pointer to an entity that it will fill, then returns a boolean indicating if it found an entity or not.

 

But the lua binding function still takes 2 arguments and returns a boolean, how do I get the entity it was supposed to fill? Obviously there are no pointers in lua or output args.

 

Any help?

headscript

How do you use the function PLAYER._GET_AIMED_ENTITY ?

 

UOUoh8A.png

 

On the native functions it receives a player and a pointer to an entity that it will fill, then returns a boolean indicating if it found an entity or not.

 

But the lua binding function still takes 2 arguments and returns a boolean, how do I get the entity it was supposed to fill? Obviously there are no pointers in lua or output args.

 

Any help?

it returns 2 values^^ the bool and the pointer

headscript

is there a way for adding more then 1 menu in a script ?

not with the gui library i wrote(which is just a example), but you can change it though

 

 

is there a way for adding more then 1 menu in a script ?

i'd like to know this as well

 

see above

 

Is it possible to read some configuration values from an .ini file ?

https://github.com/Dynodzzo/Lua_INI_Parser

use something like that

  • Like 2

 

is there a way for adding more then 1 menu in a script ?

not with the gui library i wrote(which is just a example), but you can change it though

 

 

is there a way for adding more then 1 menu in a script ?

i'd like to know this as well

 

see above

 

Is it possible to read some configuration values from an .ini file ?

https://github.com/Dynodzzo/Lua_INI_Parser

use something like that

 

can you please make one ?

because its hard for me making this :|

Edited by yossi2000
  • Like 1

Can somebody tell me why this doesn't work?

 

 

local shockwave = {}local keyPressed = falselocal force = 60function shockwave.unload()endfunction shockwave.init()endfunction applyForce(playerCoord, entity)local coord=ENTITY.GET_ENTITY_COORDS(entity,true)local dx=coord.x - playerCoord.xlocal dy=coord.y - playerCoord.ylocal dz=coord.z - playerCoord.zlocal distance=math.sqrt(dx*dx+dy*dy+dz*dz)local distanceRate=(force/distance)*math.pow(1.04,1-distance)ENTITY.APPLY_FORCE_TO_ENTITY(entity, true, distanceRate*dx,distanceRate*dy,distanceRate*dz, math.random()*math.random(-1,1),math.random()*math.random(-1,1),math.random()*math.random(-1,1), true, false, true, true, true, true)endfunction shockwave.tick()if (get_key_pressed(Keys.Add)) thenkeyPressed = trueelseif keyPressed thenkeyPressed = falselocal player = PLAYER.PLAYER_PED_ID()local playerCoord=ENTITY.GET_ENTITY_COORDS(player,true) local Table,Count = PED.GET_PED_NEARBY_VEHICLES(player, 1)local playerVehicle = PLAYER.GET_PLAYERS_LAST_VEHICLE()local inVehicle=PED.IS_PED_IN_VEHICLE(player,playerVehicle,true)for k,v in ipairs(Table) doif(not inVehicle or playerVehicle ~= v) then-- ENTITY.SET_ENTITY_CAN_BE_DAMAGED(v,true)-- VEHICLE.DISABLE_VEHICLE_IMPACT_EXPLOSION_ACTIVATION(v,true)applyForce(playerCoord, v)endendTable,Count = PED.GET_PED_NEARBY_PEDS(player, 1,1)for k,v in ipairs(Table) doPED.SET_PED_RAGDOLL_ON_COLLISION(v,true)PED.SET_PED_RAGDOLL_FORCE_FALL(v)applyForce(playerCoord, v)endendendreturn shockwave

@headscript

So recently I have been playing around with some scripts and I did the following:

local targetpos = p:GetPosition()pedo = natives.PED.CREATE_RANDOM_PED(targetpos.x, targetpos.y, targetpos.z)natives.ENTITY.SET_ENTITY_COORDS_NO_OFFSET(pedo,targetpos.x+1,targetpos.y+6,targetpos.z,false,false,true)WeebyMenu3:Wait(30)natives.PED.SET_PED_MAX_HEALTH(pedo,2)WeebyMenu3:Wait(30)natives.PED.REMOVE_PED_ELEGANTLY(pedo)
I have no clue what is wrong but I cannot figure out how to delete the ped model. Please help me!!
headscript

 

@headscript

So recently I have been playing around with some scripts and I did the following:

local targetpos = p:GetPosition()pedo = natives.PED.CREATE_RANDOM_PED(targetpos.x, targetpos.y, targetpos.z)natives.ENTITY.SET_ENTITY_COORDS_NO_OFFSET(pedo,targetpos.x+1,targetpos.y+6,targetpos.z,false,false,true)WeebyMenu3:Wait(30)natives.PED.SET_PED_MAX_HEALTH(pedo,2)WeebyMenu3:Wait(30)natives.PED.REMOVE_PED_ELEGANTLY(pedo)
I have no clue what is wrong but I cannot figure out how to delete the ped model. Please help me!!

 

that is not part of my lua plugin

Craigsters

the previous LUA Plugin for Script Hook V worked fine with my USB Xbox 360 controller for windows , but the latest some how doesn't, it doesn't seem to work with windows 8.1, my USB xbox 360 controller for windows was remapped and when I'd press the start button on my game controller I'd be taken to the start menu for windows 8.1 instead of the games menu

 

I removed LUA the other day and at the time when I had the xbox menu issue the only other script mods in my GTA V game directory where [VWIPBETA] Replace Character Vehicles by Driftall and [VWIP] Single Player Garage and [VREL] Ped Money [LUA] and finally ScriptHookVDotNet, I removed them all after that game controller issue!..

 

 

Right now the only thing in my GTA V game directory is [VREL] Script Hook V by Alexander Blade and [iVREL] Simple Trainer for GTA V by sjaak327 I'm doing a 100% game completion on this game play playthrough

 

 

I thought dirt level were integer...

Anyway, I'm going to implement plate text and also dirt level in the future... plate text is trivial, it was working before they screwed with the nativedb, but the dirt level has the problem that most people don't want to keep re-saving their vehicles, so I'd need to make it so when the player leaves any saved vehicle the dirt level is updated, what's going to take some time and tinkering :).

 

At the moment there's still a color that I've only saw in one airplane that won't save, it's a 'tertiary' colour but there's nothing 'tertiary' on the nativedb. Other than that, the plate text and the dirt level, everything else is saving so the mod is progressing (although slowly cause I don't have the time and I'm developing yet another mod atm).

 

 

Nope definitely float. I had added dirt level and custom plates to your script back when lua plugin was version 8, The last time I played (last week) dirt level was working again but the plates, were broken. I've been too busy playing other things though to keep up. I'm sure it will have all setlled down when I come back to it :)

Well this work with build 1.0.372.2 --- 06/10/2015 Update 1.27

 

the previous LUA Plugin had issues with the Gruppe Sechs security vans and I ended up using the previous LUA Plugin from a month earlier with LUA ped money in order to get the brief case instead of empty money bundles the last LUA Plugin caused or current

Well this work with build 1.0.372.2 --- 06/10/2015 Update 1.27

 

the previous LUA Plugin had issues with the Gruppe Sechs security vans and I ended up using the previous LUA Plugin from a month earlier with LUA ped money in order to get the brief case instead of empty money bundles the last LUA Plugin caused or current

try it with the newest scripthook

 

Well this work with build 1.0.372.2 --- 06/10/2015 Update 1.27

 

the previous LUA Plugin had issues with the Gruppe Sechs security vans and I ended up using the previous LUA Plugin from a month earlier with LUA ped money in order to get the brief case instead of empty money bundles the last LUA Plugin caused or current

try it with the newest scripthook

 

I PM'd diamond-optic to ask if Ped Money [LUA] by diamond-optic was being updated for the latest patch and I'm waiting on a response or update of Ped Money LUA

Edited by Craigsters

@headscript
please help, convert this simple LUA code to independent ASI file

local quickfix ={}function quickfix.tick()	local playerPed = PLAYER.PLAYER_PED_ID()		local player = PLAYER.GET_PLAYER_PED(playerPed)			local playerExists = ENTITY.DOES_ENTITY_EXIST(playerPed)				if(playerExists) then					if(PED.IS_PED_IN_ANY_VEHICLE(playerPed, false)) then						local veh = PED.GET_VEHICLE_PED_IS_IN(playerPed,true)							if(get_key_pressed(99))then								VEHICLE.SET_VEHICLE_FIXED(veh)								VEHICLE.SET_VEHICLE_DIRT_LEVEL(veh, 0)							end					end				endendreturn quickfix

thank you :)

diamond-optic

I PM'd diamond-optic to ask if Ped Money %5BLUA%5D by diamond-optic was being updated for the latest patch and I'm waiting on a response or update of Ped Money LUA

 

I got your PM but it says "deleted" and doesnt give me an option to reply... but I dont see anything that would require my Ped Money script to be updated. I'm completely overwhelmed with trying to put all my mods back into the update folder but I did just go ingame and the ped money script seems to still be working just fine

 

I PM'd diamond-optic to ask if Ped Money %5BLUA%5D by diamond-optic was being updated for the latest patch and I'm waiting on a response or update of Ped Money LUA

 

I got your PM but it says "deleted" and doesnt give me an option to reply... but I dont see anything that would require my Ped Money script to be updated. I'm completely overwhelmed with trying to put all my mods back into the update folder but I did just go ingame and the ped money script seems to still be working just fine

 

the latest ped money and lates LUA Plugin worked smoothly together and I blew up the security van with a rail gun and the brief case fell out with $6800 in it, see spoiler tags for images

 

DqAsQcF.jpg

P85OeWR.jpg

 

Edited by Craigsters

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.