Learn how to write optimized code!
table.insert
use tableName[#tableName+1] = data
if something ~= nil
use if something then
. This method checks for nil and/or false at the same timeGetPlayerPed(-1)
with PlayerPedId()
GetDistanceBetweenCoords
with lua math aka #(vector3 - vector3)
femga/rdr3_discoveries: Some interesting things from Red Dead Redemption 2.
Halen84/RDR3-Native-Flags-And-Enums: Contains flags and enums for natives
If you do have to create a thread that includes a “while” loop, always avoid using “while true do” if able. If you have to use this, follow the next tip, and it won’t impact performance as much
Control your thread times by using a variable that changes the wait time retroactively. So, you can set the thread wait time to say 1000ms which checks for your if statement every second and if it makes it into the statement, you can lower the wait time by just changing the variable value. Wait(sleep)
A surplus amount of security in a code is not a bad thing. Don’t be afraid to add in multiple if checks or create random variables to pass through your events
Never do any type of transaction with the player regarding money or items on the client side of a resource
Learn how to write optimized code!
table.insert
use tableName[#tableName+1] = data
if something ~= nil
use if something then
. This method checks for nil and/or false at the same timeGetPlayerPed(-1)
with PlayerPedId()
GetDistanceBetweenCoords
with lua math aka #(vector3 - vector3)
femga/rdr3_discoveries: Some interesting things from Red Dead Redemption 2.
Halen84/RDR3-Native-Flags-And-Enums: Contains flags and enums for natives
If you do have to create a thread that includes a “while” loop, always avoid using “while true do” if able. If you have to use this, follow the next tip, and it won’t impact performance as much
Control your thread times by using a variable that changes the wait time retroactively. So, you can set the thread wait time to say 1000ms which checks for your if statement every second and if it makes it into the statement, you can lower the wait time by just changing the variable value. Wait(sleep)
A surplus amount of security in a code is not a bad thing. Don’t be afraid to add in multiple if checks or create random variables to pass through your events
Never do any type of transaction with the player regarding money or items on the client side of a resource