fivem
fivem copied to clipboard
Implement Server Setters; RPC are broken
Feature Request: Server Setters for Authority and Stability
Background
For a considerable time, many developers have been requesting Server Setters as an alternative to RPC natives. It's widely acknowledged in the FiveM community that RPC natives are often unstable or broken.
@prikolium-cfx mentioned the reliability issues of RPC natives in this pull request.
Current Issues
-
Unreliability of RPC Natives:
- Blip natives work approximately 20% of the time.
-
SetPedConfigFlag
and vehicle RPC natives frequently require workarounds. (when they work) - Developers often need to implement delays to ensure entity existence before manipulation.
-
Lack of Server Authority:
- Current methods heavily rely on client-side operations, reducing server control.
-
Code Cleanliness:
- Reliance on RPC natives often leads to complex, less maintainable code.
Proposed Solution
Implement a comprehensive set of Server Setters to complement existing server-side functions.
Current Server-Side Functions
-
CreateVehicleServerSetter
-
CreatePed
-
CreateObjectNoOffset
While these are beneficial, they are insufficient for a robust server API.
Requested Server Setters
Please note that this list is not exhaustive and is intended to provide examples of the types of setters that would be useful:
Entity Setters
-
SetEntityHeading
-
SetEntityCoords
-
SetEntityRotation
-
SetEntityVelocity
Vehicle Setters
-
SetVehicleNumberPlateText
-
SetVehicleDoorsLocked
Vehicle Modification Setters
-
GetVehicleMod
-
GetVehicleModKit
-
GetVehicleModKitType
-
GetVehicleModVariation
-
SetVehicleMod
-
SetVehicleModKit
Benefits
-
Server Authority:
- Direct server control over entity properties and behaviors.
-
Improved Stability:
- Reduction in reliance on unstable RPC natives.
-
Cleaner Code:
- Simplified server-side logic without complex client-side workarounds.
-
Better Synchronization:
- Potential for improved entity sync across clients.
Use Cases
-
Vehicle Management:
- Server can directly modify vehicle properties (e.g., locking doors, changing plates) without client intervention.
-
NPC Behavior Control:
- Precise control over NPC movements and actions from the server.
-
Anti-Cheat Measures:
- Server can validate and correct entities properties to prevent client-side manipulation.
-
Manipulating multiple entities :
- Server can orchestrate complex scenarios by manipulating multiple entities simultaneously.
Expected result
Server setters
Reproduction steps
- Use RPC natives
- See rpc natives are broken
- Use weird workaround to use them or directly use client side code
Importancy
There's a workaround
Area(s)
FiveM, FXServer, OneSync, Natives
Specific version(s)
Every version
Additional information
No response