Question for SetPlayerPosEx
#1

hello, i creating SetPlayerPosEx(playerid, x,y,z,vw);

and i have problem, code:

pawn Код:
stock SetPlayerPosEx(playerid, Float:x ,Float:y,Float:z,vw = 0)
{
    new cartype = GetPlayerVehicleID(playerid);
    new State=GetPlayerState(playerid);
    if(State!=PLAYER_STATE_DRIVER)
    {
        SetPlayerPos(playerid, x, y ,z);
        SetPlayerVirtualWorld(playerid, vw);
    }
    else if(IsPlayerInVehicle(playerid, cartype) == 1)
    {
        SetVehiclePos(cartype,x,y,z);
        SetVehicleVirtualWorld(cartype, vw);
        SetVehicleZAngle(cartype,91);
    }
    else
    {
        SetPlayerPos(playerid,x,y,z);
        SetPlayerVirtualWorld(playerid, vw);
    }
    return 1;
}
and when i first time teleport to sanfierro (virtualworld 0) its teleport with no vehicle, and in second time when teleport, then teleport with vehicle, and third time when i teleport in stunt (virtualworld 2) then teleport in 0 virtualworld ( and in this time teleport only vehicle in those virtualworld) and fourth time when teleport in stunt (vw 2) teleport in virtualworld, and i can see the vehicle when teleported in third time, help, where it's a bug?

sorry for bad english.
Reply
#2

Set the virtual worlds manually to make it work i guess it should work.
Reply
#3

yes, it works. but how to do in stock without having to write every time?

YSI, can you give example for no bugs?

Edit: Problem fixed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)