Teleport with vehicle
#1

i know how to code a teleport poin like this

Код:
	else if (PlayerToPointStripped(1.5, playerid,****.****,-***.****,*****, cx,cy,cz))//--islandx
	{
	  //--islandx
	  SetPlayerPos(playerid, 1479.4783,-1739.2612,13.5469);
	  GameTextForPlayer(playerid, "~w~Welcome back!",5000,1);
	  SetPlayerInterior(playerid,0);
		PlayerInfo[playerid][pInt] = 0;
	}
	return 1;
but it works only without vehicle oO

i need this code but i want to take my vehicle with me

any idea?
Reply
#2

Quote:
Originally Posted by r9x
i know how to code a teleport poin like this

Код:
	else if (PlayerToPointStripped(1.5, playerid,****.****,-***.****,*****, cx,cy,cz))//--islandx
	{
	  //--islandx
	  SetPlayerPos(playerid, 1479.4783,-1739.2612,13.5469);
	  GameTextForPlayer(playerid, "~w~Welcome back!",5000,1);
	  SetPlayerInterior(playerid,0);
		PlayerInfo[playerid][pInt] = 0;
	}
	return 1;
but it works only without vehicle oO

i need this code but i want to take my vehicle with me

any idea?
try:
pawn Код:
else if (PlayerToPointStripped(1.5, playerid,****.****,-***.****,*****, cx,cy,cz))//--islandx
    {
      //--islandx
      if(IsPlayerInAnyVehicle(playerid)){
        new vid = GetPlayerVehicleID(playerid);
        SetVehiclePos(vid, 1479.4783,-1739.2612,13.5469);
        LinkVehicleToInterior(vid,0);
        SetPlayerInterior(playerid,0);
      }else{
        SetPlayerPos(playerid, 1479.4783,-1739.2612,13.5469);
        SetPlayerInterior(playerid,0);
      }
      GameTextForPlayer(playerid, "~w~Welcome back!",5000,1);
        PlayerInfo[playerid][pInt] = 0;
    }
    return 1;
Reply
#3

ok thnx i ll try this =)
Reply
#4

uhm with vehicle it dont works oO
Reply
#5

uhm.. now i tryed this:

Код:
	    else if (PlayerToPointStripped(3.5, playerid,2781.3186,-2494.4221,13.3880, cx,cy,cz))//--deathrace
	{
	  //--deathrace
				if (GetPlayerState(playerid) == 2)
				{
					new tmpcar = GetPlayerVehicleID(playerid);
					SetVehiclePos(tmpcar, 1875.3357,2546.0020,13.8687);
					TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
				}
				else
				{
					SetPlayerPos(playerid, 1875.3357,2546.0020,13.8687);
				}
	  GameTextForPlayer(playerid, "~w~Welcome to Deathrace!",5000,1);
		PlayerInfo[playerid][pInt] = 0;
	}
	return 1;
but it still dont teleports me.. only if i walk to the point without vehicle -.-
Reply
#6

This is a weird problem, it should work, if it teleports the player, then it should teleport the vehicle.

We need more information. Like what interior ID are you using and where is this under?

Try this

Код:
else if (PlayerToPointStripped(3.5, playerid,2781.3186,-2494.4221,13.3880, cx,cy,cz))//--deathrace
{
	//--deathrace
	if (IsPlayerInAnyVehicle(playerid))
	{
		SetVehiclePos(GetPlayerVehicleID(playerid), 1875.3357,2546.0020,13.8687);
 		TelePos[playerid][0] = 0.0;
		TelePos[playerid][1] = 0.0;
	}
	else if(!IsPlayerInAnyVehicle(playerid))
	{
		SetPlayerPos(playerid, 1875.3357,2546.0020,13.8687);
	}
	GameTextForPlayer(playerid, "~w~Welcome to Deathrace!",5000,1);
	PlayerInfo[playerid][pInt] = 0;
}
return 1;
Reply
#7

well i dont want to teleport ibn a virworld or interior so that should be 0

its only from a postion outside

to another position outside oO

ill try you code and report back thnx


ok i used your code 1:1 but it teleports still only me..

if im in vehicle it does nothing oO

im realy confused

the code says that it should teleport the vehicle with me.. but its not working.. hmm dammed
Reply
#8

Quote:
Originally Posted by r9x
well i dont want to teleport ibn a virworld or interior so that should be 0

its only from a postion outside

to another position outside oO

ill try you code and report back thnx


ok i used your code 1:1 but it teleports still only me..

if im in vehicle it does nothing oO

im realy confused

the code says that it should teleport the vehicle with me.. but its not working.. hmm dammed
Show this "PlayerToPointStripped" function please.
Reply
#9

its not playertopointstripped anymore

its like this:

Код:
	if(strcmp(cmd, "/deathrace", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			if(IsPlayerInRangeOfPoint(playerid, 8, *********************))
			{
				if (GetPlayerState(playerid) == 2)
				{
					new tmpcar = GetPlayerVehicleID(playerid);
					SetVehiclePos(tmpcar, *********************);
					TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
				}
				else
				{
					SetPlayerPos(playerid, ********************);
				}
				SendClientMessage(playerid, COLOR_GRAD1, "  You entered DeathRace !");
				SetPlayerInterior(playerid,0);
				PlayerInfo[playerid][pInt] = 0;
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "  Wrong place to enter /deathrace !");
			}
		}
		return 1;
		}
Reply
#10

Yeah but only problem is that you have to enter the command instead of just walking into the checkpoint thing
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)