client.player.position does not work

Started by Collssdew, June 07, 2025, 07:06:54 PM

Previous topic - Next topic

Collssdew

client.player does not work on the server-side you guys need to keep your wiki more up to date half the stuff on it don't even work lol, i have similar issues with some of the natives as well, i run this https://wiki.gtaconnected.com/ScriptingExamples/AddObject from you wiki on the server-side and get: You must be spawned to spawn an object! so clearly it's null for some reason, my server is 1.7.0 running on a linux machine my client is 1.7.12 for gta 4, someone else already said this months ago and got ignored... and where even are the object ids? i can't seem to find them anywhere

Vortrex

client.player is only available serverside if native MP mode is disabled

Setting the position will also not work serverside because a client is actively syncing the element (the element in your case is a player ped). The server's position is reset when the next sync packet arrives from it's syncer. You will need to use a network event to tell the syncer client to set the position.

When using native MP mode, all elements are handled clientside. The server's only role in that mode is to broker connections. It has literally NO awareness of any elements in the game. If you need to use serverside elements, disable native MP mode.