I need help with "MovePlayer"
#1

I want to make a 24/7 store checkpoint for entering the interior and exiting the interior would be the yellow marker...


So my question is,

How do i make it so if a player exits the interior, it teleports him to the specific spot i want them to go to? The problem is if someone exits an interior from a yellow marker it will place them in the original spot where the interior is located

so how can i relocate that spot?

I've searched it and found someone in the LVRCR script, but i do not understand it, Can someone explain it to me? or teach me how to do it?

Код:
public twofoursevenmoveplayer()
{
  for (new i = 0; i < MAX_PLAYERS; i++)
  {
	if(IsPlayerConnected(i) && IsSpawned[i] == 1 && GetPlayerInterior(i) == 0 && Jailed[i] == 0)
	{
	if(TimeToMoveTwoFourSeven[i] >=1 && TimeToMoveTwoFourSeven[i] <=3)
	{
	TimeToMoveTwoFourSeven[i] --;
	}
	if(TimeToMoveTwoFourSeven[i] == 0)
	{
	if(LeftTwoFourSeven[i] == 1)
	{
		SetPlayerVirtualWorld(i,0);
  	SetPlayerInterior(i,0);
  	SetPlayerPos(i,1592.2305,2214.1846,10.8203);
  	SetPlayerFacingAngle(i,187.0764);
  	SetCameraBehindPlayer(i);
  	LeftTwoFourSeven[i] =999;
  	TimeToMoveTwoFourSeven[i] =999;
  	TogglePlayerControllable(i, 1);
  	}
  if(LeftTwoFourSeven[i] == 2)
	{
  	SetPlayerVirtualWorld(i,0);
  	SetPlayerInterior(i,0);
  	SetPlayerPos(i,2191.6472,2476.4624,10.8203);
  	SetPlayerFacingAngle(i,272.7751);
  	SetCameraBehindPlayer(i);
  	LeftTwoFourSeven[i] =999;
  	TimeToMoveTwoFourSeven[i] =999;
  	TogglePlayerControllable(i, 1);
  }
  if(LeftTwoFourSeven[i] == 3)
	{
  	SetPlayerVirtualWorld(i,0);
  	SetPlayerInterior(i,0);
  	SetPlayerPos(i,2630.5876,1124.3673,10.8203);
  	SetPlayerFacingAngle(i,177.8683);
  	SetCameraBehindPlayer(i);
  	LeftTwoFourSeven[i] =999;
  	TimeToMoveTwoFourSeven[i] =999;
  	TogglePlayerControllable(i, 1);
  }
  if(LeftTwoFourSeven[i] == 4)
	{
  	SetPlayerVirtualWorld(i,0);
  	SetPlayerInterior(i,0);
  	SetPlayerPos(i,2108.0222,901.5873,10.8203);
  	SetPlayerFacingAngle(i,2.9187);
  	SetCameraBehindPlayer(i);
  	LeftTwoFourSeven[i] =999;
  	TimeToMoveTwoFourSeven[i] =999;
  	TogglePlayerControllable(i, 1);
  }
  if(LeftTwoFourSeven[i] == 5)
	{
  	SetPlayerVirtualWorld(i,0);
  	SetPlayerInterior(i,0);
  	SetPlayerPos(i,664.9492,1726.6813,6.9922);
  	SetPlayerFacingAngle(i,42.5792);
  	SetCameraBehindPlayer(i);
  	LeftTwoFourSeven[i] =999;
  	TimeToMoveTwoFourSeven[i] =999;
  	TogglePlayerControllable(i, 1);
  }
  if(LeftTwoFourSeven[i] == 6)
	{
  	SetPlayerVirtualWorld(i,0);
  	SetPlayerInterior(i,0);
  	SetPlayerPos(i,2142.6326,2739.4309,10.8203);
  	SetPlayerFacingAngle(i,5.6754);
  	SetCameraBehindPlayer(i);
  	LeftTwoFourSeven[i] =999;
  	TimeToMoveTwoFourSeven[i] =999;
  	TogglePlayerControllable(i, 1);
  }
 }
}
}
}
Reply
#2

you can either use commands or pickups
just use something like

If(PlayerToPoint,2.0,playerid , e.t.c XZY Cods)
{
SetPlayerPos(



Example and tutorial for commands

http://forum.sa-mp.com/index.php?topic=74928.0
Reply
#3

Quote:
Originally Posted by [GM
LeGenDy ]
you can either use commands or pickups
just use something like

If(PlayerToPoint,2.0,playerid , e.t.c XZY Cods)
{
SetPlayerPos(



Example and tutorial for commands

http://forum.sa-mp.com/index.php?topic=74928.0


I don't wanna use pickups though, I know theres a way to redrict the yellow marker and I'd like to know how too
Reply
#4

https://sampwiki.blast.hk/wiki/OnPlayerInteriorChange
Reply
#5

Quote:
Originally Posted by MadeMan
I've read that but i do not know how it will help me?


If someone say leaves interior 3 and that interior's exit is in LV i do not want it to exit in LV i want it to exit in LS on a speicific cords i place
Reply
#6

You can just check the interior and set new pos.

pawn Код:
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    if(oldinteriorid == 3)
    {
        SetPlayerPos(playerid, X, Y, Z); // new place in LS
    }
    return 1;
}
Or to be sure, you can also check if player was teleported to the place in LV and then set new pos

pawn Код:
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    if(oldinteriorid == 3 && IsPlayerInRangeOfPoint(playerid, 3.0, X, Y, Z)) // original place in LV
    {
        SetPlayerPos(playerid, X, Y, Z); // new place in LS
    }
    return 1;
}
Reply
#7

Thank you for that! That makes so much more sense!!!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)