Teleporting - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Teleporting (
/showthread.php?tid=233501)
Teleporting -
k3nw00d_kri5ty - 01.03.2011
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
Re: Teleporting -
JaTochNietDan - 01.03.2011
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.
Re: Teleporting -
k3nw00d_kri5ty - 02.03.2011
Doesn't work, game still crashes...
On GamersX I tried to teleport when i passenger(without vehicle) but it's working.
Re: Teleporting -
JaTochNietDan - 02.03.2011
Then it must be a problem with your LoadObjects callback or the Streamer that you're using, if any.
Re: Teleporting -
k3nw00d_kri5ty - 02.03.2011
I using Icognito's streamer (the best).
Re: Teleporting -
k3nw00d_kri5ty - 06.03.2011
Anyone can help me ... ?