[Problem] GetPlayerPos / SetPlayerPos

Započeo Shemaa, Maj 09, 2020, 23:01:25 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Problem(error/warning): E ovako imam NPC Bus System na svom modu , kad igrac udje u bus teleportuje u interrior od busa , onda ima cmd da pogleda napolje da vidi gde je stigao bus i kad to uradi seta mu kameru ko da on vozi bus tacnije da vidi gde se nalazi bus (PlayerSpectateVehicle) i sve to traje 5 sec onda treba da ga vrati u enterijer a umesto u enetrijer vrati ga na spawn ...
Dio skripte: [pawn]YCMD:pogledajnapolje(playerid, params[], help)
   {
      if(!IsPlayerInRangeOfPoint(playerid, 10, 2021.9390,2241.9487,2103.9536)) return SendClientMessage(playerid, BELA, "{FF0000}[GRESKA]: {FFFFFF}Nisi u nijedan BUS !");
        GetPlayerPos(playerid, Playerx[playerid], Playery[playerid], Playerz[playerid]);
      GetPlayerFacingAngle(playerid, Playera[playerid]);
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 0);
        TogglePlayerSpectating(playerid, 1);
      if(BusID[playerid] == 1)
      {
            PlayerSpectateVehicle(playerid, NPCBlueBus);
        }
        else
        {
            PlayerSpectateVehicle(playerid, NPCBlackBus);
        }
        SetTimerEx("ResetView", 5000, 0, "d", playerid);
      return 1;
   }
public ResetView(playerid)
{
   TogglePlayerSpectating(playerid, 0);
    SetPlayerInterior(playerid, 1);
    SetPlayerPos(playerid, Playerx[playerid], Playery[playerid], Playerz[playerid]);
    SetPlayerFacingAngle(playerid, Playera[playerid]);
    SetCameraBehindPlayer(playerid);
    if(PlayerSitting[playerid] == 1)
    {
        ApplyAnimation(playerid,"PED","SEAT_idle",30.0,1,0,0,0,0);
    }
    if(BusID[playerid] == 1)
    {
        SetPlayerVirtualWorld(playerid, 2);
    }
    else
    {
        SetPlayerVirtualWorld(playerid, 3);
    }
    Playerx[playerid] = 0;
}[/pawn]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): //
Slika/video ingame problema(obavezno ako je ingame problem): //

When spectator mode is disabled, OnPlayerSpawn will automatically be called, if you wish to restore player to state before spectating, you will have to handle that in OnPlayerSpawn.

Na wikiju pise: kada ugasis spec mod pozove se funkcija OnPlayerSpawn, znaci variablu stavis da je u busu i pod OnPlayerSpawn ako je u busu samo da ga porta nazad u bus

My Bike KTM 450 SXF 2008