[Help]Pickup Teleport
#10

Quote:
Originally Posted by Ihabou
Посмотреть сообщение
I already Do that But It Teleport Me over and Over You know what i mean
ok... i just noticed this, you teleport the player at the exact same position where your exit pickup is!

public OnGameModeInit()
{

CreateDynamicPickup(19132, 1, 1402.6344, -1697.8345, 13.5533);//this will get pickupid 1, e.g CLK_BELL_ENTER
CreateDynamicPickup(19132, 1, 1299.14, -794.77, 1084.00);//this 2 and so on...
return 1;
}

public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
switch(pickupid) //'switching' through all the id's, better than if-if else
{
case LSB_ENTER://our enter pickup
{
//actually moving the player inside...
SetPlayerInterior(playerid, 9);
SetPlayerVirtualWorld(playerid,6);
SetPlayerPos(playerid, 1299.14, -794.77, 1084.00);
SetPlayerFacingAngle(playerid,357.55);
}
case LSB_EXIT://and the exit one
{
//aaaand outside
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
SetPlayerFacingAngle(playerid,90.0);
SetPlayerPos(playerid, 1402.6344, -1697.8345, 13.5533);
}
}
return 1;

}


and what happens then is that the code for the exit pickup gets executed and you teleport the player
at the exact position of the enter pickup..... you created a "teleport-loop" :P

to fix this, simply teleport to another location, do not use the coords of your exit/enter pickup
but rather like maybe 5ft in front of it
Reply


Messages In This Thread
[Help]Pickup Teleport - by Ihabou - 05.01.2017, 11:08
Re: [Help]Pickup Teleport - by CutX - 05.01.2017, 11:46
Re: [Help]Pickup Teleport - by Ihabou - 05.01.2017, 12:13
Re: [Help]Pickup Teleport - by Ihabou - 05.01.2017, 14:14
Re: [Help]Pickup Teleport - by CutX - 05.01.2017, 14:19
Re: [Help]Pickup Teleport - by Ihabou - 05.01.2017, 15:25
Re: [Help]Pickup Teleport - by RyderX - 05.01.2017, 15:28
Re: [Help]Pickup Teleport - by Ihabou - 05.01.2017, 15:34
Re: [Help]Pickup Teleport - by Ihabou - 05.01.2017, 16:08
Re: [Help]Pickup Teleport - by CutX - 05.01.2017, 16:28

Forum Jump:


Users browsing this thread: 6 Guest(s)