Alright, how would i be able to make something so that when a player comes into close contact with a frozen ai ped that they can press e to interact and that would triggerEvent.
Hey !
You will have to find by yourself to code in lua, nobody will fully do it for you ! ^^
Try with natives here : Native Reference - Cfx.re Docs
I give you some natives to start :
Step 1 :
Create a new thread, get the Player ped, and the position in a while loop
Step 2
CreatePed
FreezeEntityPosition
Step 3 :
Compare the two positions (#(player position - AI position) < 2.0) for example
if this is true, wait for a click from the user (IsControlJustPressed)
Trigger your event if pressed
And there you go,
If you took a look at the code for a resource like esx_jobs, you’d see a loop that does exactly what you need it to do.
alright, ive got the distance and stuff working, can you tell me how to get something like this to show up though?
Use this !
function hintToDisplay(text, bool)
BeginTextCommandDisplayHelp(“STRING”)
AddTextComponentString(text)
DisplayHelpTextFromStringLabel(0, 0, bool, -1)
end
hintToDisplay('Press ~INPUT_CONTEXT~ to open the menu, false)
thank you so much, youve helped me so much.
There is no problem mate,
Have a great day !
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.