You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By having an event that fires when a player's GTA position changes by a significant distance that can't be traveled on foot or vehicle, it is possible to utilize additional script security (servers can check if a certain teleport is legitimate, by tracking legitimate uses of setElementPosition for players until the teleport is done)
Naming it onPlayerChangePosition would be misleading, as we can't make true to firing the event at literally every movement, such as walking or driving a car, because it would be super spammy. So, if we're doing this, we need to implement a limit to filter relevant position changes, like again: a significant distance that can't be traveled on foot or vehicle or rather, when the new player position is one that wasn't streamed in to them before. In case there's no way to check this server-side, this can be a simple number of typical streaming distance in GTA, after all the goal is approximation of what is to be seen as a significant distance travelled.
To convey that's what it is, and avoid a misleading event name, we may use something like onPlayerTeleport (open for suggestions)
By extension, it may be considered to add an event for all elements changing position, instead of just players. Or if it's better, one event for players and one event for vehicles.
Additional context
Note: im aware that there's ways to achieve it already, like using timers (or timers with coroutines) that store and check all player's positions. But it's not good for performance as well as unnecesarily complex to get it right, if we could just add an event for the purpose.
The text was updated successfully, but these errors were encountered:
We shouldn't trust clientsided functions. We should see if the server has changed the game speed tho. Same for the handlings since now they can be changed clientside as well.
By having an event that fires when a player's GTA position changes by a significant distance that can't be traveled on foot or vehicle, it is possible to utilize additional script security (servers can check if a certain teleport is legitimate, by tracking legitimate uses of setElementPosition for players until the teleport is done)
Naming it
onPlayerChangePosition
would be misleading, as we can't make true to firing the event at literally every movement, such as walking or driving a car, because it would be super spammy. So, if we're doing this, we need to implement a limit to filter relevant position changes, like again: a significant distance that can't be traveled on foot or vehicle or rather, when the new player position is one that wasn't streamed in to them before. In case there's no way to check this server-side, this can be a simple number of typical streaming distance in GTA, after all the goal is approximation of what is to be seen as a significant distance travelled.To convey that's what it is, and avoid a misleading event name, we may use something like
onPlayerTeleport
(open for suggestions)By extension, it may be considered to add an event for all elements changing position, instead of just players. Or if it's better, one event for players and one event for vehicles.
Additional context
Note: im aware that there's ways to achieve it already, like using timers (or timers with coroutines) that store and check all player's positions. But it's not good for performance as well as unnecesarily complex to get it right, if we could just add an event for the purpose.
The text was updated successfully, but these errors were encountered: