SA-MP Forums Archive
teleport not working - 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: teleport not working (/showthread.php?tid=180123)



teleport not working - doo2002 - 30.09.2010

Im trying to create a teleport so when you walk up to a door it teleports you to another location that I created. But its not working, here is what I got.

Код:
public MyTeleportToInterior(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 2737.0888671875, -2799.9736328125, 23.703699111938))
    {
    SetPlayerPos(playerid, 2738.8181152344, -2875.5883789063, 308.98538208008);
    return 1;
	}
if(IsPlayerInRangeOfPoint(playerid, 3.0, 2738.8181152344, -2871.5883789063, 308.98538208008))
	{
	SetPlayerPos(playerid, 2737.0888671875, -2805.9736328125, 23.703699111938);
	return 1;
	}
return 1;
}



Re: teleport not working - Cameltoe - 30.09.2010

how are you calling it?


Re: teleport not working - samgreen - 30.09.2010

Quote:
Originally Posted by doo2002
Посмотреть сообщение
Im trying to create a teleport so when you walk up to a door it teleports you to another location that I created. But its not working, here is what I got.
Cleaned your code up and put it on pastebin. Are you calling this public function on a timer?


Re: teleport not working - willsuckformoney - 30.09.2010

pawn Код:
public MyTeleportToInterior(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 2737.0888671875, -2799.9736328125, 23.703699111938))
    {
    SetPlayerPos(playerid, 2738.8181152344, -2875.5883789063, 308.98538208008);
    SetPlayerInterior(playerid,ID); //Change ID to the interior ID
    }
else if(IsPlayerInRangeOfPoint(playerid, 3.0, 2738.8181152344, -2871.5883789063, 308.98538208008))
    {
    SetPlayerPos(playerid, 2737.0888671875, -2805.9736328125, 23.703699111938);
        SetPlayerInterior(playerid,ID); //Change ID to the interior ID
    }
return 1;
}



Re: teleport not working - doo2002 - 30.09.2010

I dont have an interior ID, all I get was take an ammuniation interior, stuck it up in the sky and put things there, all I wanted was to walk up to the door and teleport to that location in the sky.


Re: teleport not working - Cameltoe - 30.09.2010

Still an interior.


Re: teleport not working - willsuckformoney - 30.09.2010

SA:MP InteriorIDs - Weedar.wikidot.com


Re: teleport not working - doo2002 - 30.09.2010

ok i must be doing something wrong cause its still not working.


Re: teleport not working - doo2002 - 30.09.2010

Ok like I said it isn't working, I pasted my whole script in pastebin, maybe there is something I am forgetting.

http://pastebin.com/jRsyQgqJ


Re: teleport not working - MadeMan - 30.09.2010

pawn Код:
new TeleportTimer[MAX_PLAYERS];
OnPlayerConnect
pawn Код:
TeleportTimer[playerid] = SetTimerEx("MyTeleportToInterior", 1000, true, "d", playerid);
OnPlayerDisconnect
pawn Код:
KillTimer(TeleportTimer[playerid]);