C# SetPosition or SetSpawn problem


#1

Hi, i have some trouble for set a spawn location in c#

i have test 2 different method without success, player still spawn on default point

var x = float.Parse(data.spawnx, NumberStyles.Any);
var y = float.Parse(data.spawny, NumberStyles.Any);
var z = float.Parse(data.spawnz, NumberStyles.Any);

SetEntityCoords(GetPlayerPed(-1), x, y, z, true, false, false, true);

and

var x = float.Parse(data.spawnx, NumberStyles.Any);
var y = float.Parse(data.spawny, NumberStyles.Any);
var z = float.Parse(data.spawnz, NumberStyles.Any);

Game.Player.Character.Position = new Vector3(x, y, z);

If someone have an idea

Edit: Problem fixed
Strange probleme because setting mp_m_freemode_0 model without SetPedDefaultComponentVariation(GetPlayerPed(-1));
broke SetEntityCoords api