iAxel Posted May 13, 2015 Posted May 13, 2015 Hello all! Is it possible to synchronize server-client or client-server? Server NPC = {} function NPC:Create(skin, x, y, z, rotation) local ped = createPed(skin, x, y, z, rotation) return ped end Client NPC = {} function NPC:Move(X, Y) local x, y = getElementPosition(self) setPedCameraRotation(self, math.deg(math.atan2(X - x, Y - y))) setPedControlState(self, 'forwards', true) end Please help me Thx
MTA Team botder Posted May 13, 2015 MTA Team Posted May 13, 2015 You could trigger an event everytime you create a 'NPC' ped and then add create an instance for that ped. Note: The ped might not exist clientside when the event arrives at clientside - you should mark the ped as NPC on serverside (e.g. setElementData(ped, "npc", true)) and then loop the event until the ped is valid. GitHub: Debug Console • MTA-Discord Relay Scripting: How to draw a line chart with DirectX functions? • Doppler Effect in MTA • Get the client's FPS • Customizable Blur Shader
iAxel Posted May 13, 2015 Author Posted May 13, 2015 I don't want use setElementData because I use event for Check NPC 'onClientPreRender'
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now