I see you’re used to toxic criticism which helps me understand why you think its ok to be this way with other people.
LIke I said to Roda: Go drum up drama on someone else’s post.
I see you’re used to toxic criticism which helps me understand why you think its ok to be this way with other people.
LIke I said to Roda: Go drum up drama on someone else’s post.
Also, if its that much of an issue, you can always just delete the passing of xPlayer from server to client…
I account for a nil value on the backend just incase xPlayer isn’t passed accordingly so we can log cheater. Perhaps this could be refactored a bit to make it cleaner, but the script will still work w/o networking xPlayer if desired…
May I have an example how someone can abuse this? To my knowledge, there are two things cheaters have access to:
A logger will document code that the cheater can retrigger, I haven’t thought of a way to combat that effectively yet.
Cheaters with access to triggers can only trigger server events called from the Client (in regards to server events only)
I’m unaware if they can SEE all of the code, 99% of menu users are caught with this auth system I’ve implemented. The other 1% are spawning tugboats at legion and get insta banned anyway.
The cheater would need to know exactly the parameters being used on the back end, which in this case is only the identifier.
in addition to that, they would need to know the key value the server uses and how data is stored in the back sql to actually abuse this.
Most of the xPlayer data is used to provide a log to the discord via webhook.
Like I said, I’m all for improving. I never said I was a perfect dev, I just said I made something for free because I think paying $5 for 150 lines isn’t worth, and people shouldn’t have that as their only option.
How bad it is to mess with the team of recreators… this will end very well _
Im not gonna comment everything you just blamed - my posts is not point of your code.
No one wants to be toxic here, but posting script on forum (in my opinion) should be thinked twice, every one can use your resource right?
First of all, you should close your script into server-side only, its safest option here - no one can abuse it. To do so, you can make a vehicle properties table on server and after esx:playerLoaded with newPlayer specified, add vehicle to player (some SELECT before doing it will advisable to check if he already got his vehicle), then if needed - spawn car to client.
If you really want to keep doing client sided, there is also better security check. I will provide example for you below, do like you want
local GivenVehicles = {}
AddEventHandler('esx:playerLoaded', function(playerId, xPlayer, isNew)
if isNew then
GivenVehicles[playerId] = true
TriggerClientEvent('CreateCarData', xPlayer.source, xPlayer)
end
end)
RegisterServerEvent('InsertCarToDb', function(vehData)
local source <const> = source
if not GivenVehicles[source] then
print('ban here')
return
end
GivenVehicles[source] = false
-- rest
end)
GivenVehicles is logic here, SELECT for owned_vehicles like i said before should be also implemented here.
About that you sending xPlayer object from server to client and again to server, it doesnt make any sense, cheater can overwrite xPlayer object functions and do whatever he wants. You can get xPlayer again from server like you have done here
xPlayer = ESX.GetPlayerFromId(src)
Also posibble infinite loop here
while xPlayer == nil do Wait(10) end
RegisterNetEvent named InsertCarToDb should be replaced with RegisterServerEvent (flow control)
Ask me if you have any other questions
This is the constructive criticism I expect from the forums, thank you. People need to understand we are a community, and if we don’t work together, there will be no positive progression.
You’re welcome to fork it on github and do a PR if you feel so inclined, otherwise, I’ll get to this when I can. I fulltime my own project, so, fixing issues from other well-established developers is eating into all of my time at the moment.
The truth is that the script works fine for me and I received support right away with a small error that I had
any way to trigger it after character creation get error that im to far away
You’re welcome to rewrite it to use a trigger event or an event listener.
I didn’t really take into account the variety of multicharacter resources available. I did only take into consideration ESX events. If the multicharacter isn’t using those events, then you might simply be able to change the event handler to listen to a different event.