Teleporting
#1

Hi all , i'm here because i have an problem with a teleport command.
When i'm in vehicle as passenger and I want to teleport the caracter disappear from vehicle and I receive an crash what are kick me from game...

http://pastebin.com/mBurEjG6
Reply
#2

Your code is full of redundant checks, why bother checking if they are in a vehicle if you are checking if they are a passenger or a driver? That means they must be in a vehicle! Take a look at my example of this command which will have the same effect:

pawn Код:
if(strcmp(cmd,"/bstunt1",true) == 0)
{
    TogglePlayerControllable(playerid,0);
    SetTimerEx("LoadObjects",3000,false,"i",playerid);
    SetPlayerInterior(playerid,0);
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        SetVehiclePos(GetPlayerVehicleID(playerid),530.6929,-1012.7028,1773.1597);
        SetVehicleZAngle(GetPlayerVehicleID(playerid),270.9936);
        return 1;
    }
    SetPlayerPos(playerid,530.6929,-1012.7028,1773.1597);
    SetPlayerFacingAngle(playerid,270.9936);
    return 1;
}
Do you see what I did there? Additionally when teleporting a player out of a car, you do not need to use RemovePlayerFromVehicle first.
Reply
#3

Doesn't work, game still crashes...
On GamersX I tried to teleport when i passenger(without vehicle) but it's working.
Reply
#4

Then it must be a problem with your LoadObjects callback or the Streamer that you're using, if any.
Reply
#5

I using Icognito's streamer (the best).
Reply
#6

Anyone can help me ... ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)