Hi,
resource_manifest_version '05cfa83c-a124-4cfa-a768-c24a5811d8f9
RegisterCommand("test", function(source, args, rawCommand) {
const entity = NetworkGetEntityFromNetworkId(source);
if (DoesEntityExist(entity)) {
console.log(GetEntityCoords(entity));
}
}, false);
No result return, entity not exist.
Version : 1354 on windows 10
d0p3t
June 21, 2019, 9:03am
2
See my old OneSync testing repo to see how to get an entity position using OneSync server side
/*
Notes:
Bug - @citizenfx/server typings doesn't return <int> for CreateVehicle() so use @citizenfx/client
*/
import * as util from "./utils";
var toggle = false;
RegisterCommand(
"mypos",
(source: number) => {
let ped = GetPlayerPed(source);
let c = util.EntityCoordsWithHeading(ped);
console.log(`Pos of [${source}] is [${c[0]},${c[1]},${c[2]}, ${c[3]}]`);
},
false
);
This file has been truncated. show original
d0p3t
June 21, 2019, 11:11am
4
It’s another file in that repository. This is written in typescript/JavaScript but the natives are exact same.
TLDR: use GetPlayerPed(Source) instead of what you were doing with the network stuff
thx, “GetEntityHeading” return only 0
d0p3t
June 21, 2019, 7:42pm
6
That’s correct. It’s not synced due to some internal issues. I don’t remember exactly what. No priority. But you can SetEntityHeading if I’m not mistaken