/sync
#9

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
It's because of your order in your code...

PHP код:
   SetSpawnInfo(playerid,0,playerskin,x,y,z,weaponidweapon,weaponid,weapon,weaponid,weapon,weaponid);
   
GetPlayerPos(playeridx,y,z) && SetPlayerPos(playerid,x,y,z); 
You set his spawninfo before you got his position as was stated above.

PHP код:
CMD:sync(playeridparams[])
{
   new 
Float:healthFloat:armourFloat:xFloat:yFloat:zweaponidweaponplayerskin;
   
GetPlayerHealth(playeridhealth);
   
GetPlayerArmour(playeridarmour);
   
playerskin  GetPlayerSkin(playerid);
   
weaponid GetPlayerAmmo(playerid);
   
weapon GetPlayerWeapon(playerid);
   
GetPlayerPos(playeridx,y,z)
   
SetSpawnInfo(playerid,0,playerskin,x,y,z,weaponidweapon,weaponid,weapon,weaponid,weapon,weaponid);
   
SpawnPlayer(playerid);
   
SetPlayerArmour(playeridarmour);
   
SetPlayerHealth(playeridhealth);
   
//Won't be needed.
   //SetPlayerSkin(playerid, playerskin);
   //SetPlayerPos(playerid,x,y,z);
   
return 1;

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.
It respawns me to another place, (since I have randomspawns), so it just calls them
Reply


Messages In This Thread
/sync - by ivndosos - 22.02.2018, 06:05
Re: /sync - by andrejc999 - 22.02.2018, 06:17
Re: /sync - by ivndosos - 22.02.2018, 06:21
Re: /sync - by Sew_Sumi - 22.02.2018, 06:48
Re: /sync - by ivndosos - 22.02.2018, 06:58
Re: /sync - by Sew_Sumi - 22.02.2018, 07:02
Re: /sync - by ivndosos - 22.02.2018, 07:03
Re: /sync - by Sew_Sumi - 22.02.2018, 07:10
Re: /sync - by ivndosos - 22.02.2018, 07:26
Re: /sync - by Sew_Sumi - 22.02.2018, 08:05

Forum Jump:


Users browsing this thread: 3 Guest(s)