22.02.2018, 07:10
It's because of your order in your code...
You set his spawninfo before you got his position as was stated above.
I would also look at your use of the weaponid/weapon in the spawn info, that's something different, and shouldn't need to be set multiple times. You could use 0,0,0,0 for the last parameters instead of repeating variables.
PHP код:
SetSpawnInfo(playerid,0,playerskin,x,y,z,weaponid, weapon,weaponid,weapon,weaponid,weapon,weaponid);
GetPlayerPos(playerid, x,y,z) && SetPlayerPos(playerid,x,y,z);
PHP код:
CMD:sync(playerid, params[])
{
new Float:health, Float:armour, Float:x, Float:y, Float:z, weaponid, weapon, playerskin;
GetPlayerHealth(playerid, health);
GetPlayerArmour(playerid, armour);
playerskin = GetPlayerSkin(playerid);
weaponid = GetPlayerAmmo(playerid);
weapon = GetPlayerWeapon(playerid);
GetPlayerPos(playerid, x,y,z)
SetSpawnInfo(playerid,0,playerskin,x,y,z,weaponid, weapon,weaponid,weapon,weaponid,weapon,weaponid);
SpawnPlayer(playerid);
SetPlayerArmour(playerid, armour);
SetPlayerHealth(playerid, health);
//Won't be needed.
//SetPlayerSkin(playerid, playerskin);
//SetPlayerPos(playerid,x,y,z);
return 1;
}