[Help]Teleporting with Cars...
#1

I need help, normally when i teleport, it is...

SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, blah blah);

but what if i want to teleport my vehicle too? then what do i do?
Reply
#2

GetPlayerVehicleID()
SetVehiclePos()

have a look at the wiki for more infos about these functions.

Saiberfun
Reply
#3

pawn Код:
if (strcmp("/teleport", cmdtext, true, 9) == 0)
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
     {
     new car;
     car = GetPlayerVehicleID(playerid);
     SetVehiclePos(car,X,Y,Z);
     }
     else
     {
     SetPlayerPos(playerid,X,Y,Z);
     }
 return 1;
}
Reply
#4

Quote:
Originally Posted by ►Peter Corneile◄ [hugu-hosting.co.uk
]
pawn Код:
if (strcmp("/teleport", cmdtext, true, 9) == 0)
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
    new car;
    car = GetPlayerVehicleID(playerid);
    SetVehiclePos(car,X,Y,Z);
    }
    else
    {
     SetPlayerPos(playerid,X,Y,Z);
    }
 return 1;
}
Cheers, this is what i wanted!
Reply
#5

Quote:
Originally Posted by Tigerbeast11
Quote:
Originally Posted by ►Peter Corneile◄ [hugu-hosting.co.uk
]
pawn Код:
if (strcmp("/teleport", cmdtext, true, 9) == 0)
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
    new car;
    car = GetPlayerVehicleID(playerid);
    SetVehiclePos(car,X,Y,Z);
    }
    else
    {
     SetPlayerPos(playerid,X,Y,Z);
    }
 return 1;
}
Cheers, this is what i wanted!
lol
Reply
#6

You dont need to do

pawn Код:
new car = GetPlayerVehicle...
Simply:
pawn Код:
SetVehiclePos(GetPlayerVehicleID(playerid),X,Y,Z);
Reply
#7

Quote:
Originally Posted by BMUK
You dont need to do

pawn Код:
new car = GetPlayerVehicle...
Simply:
pawn Код:
SetVehiclePos(GetPlayerVehicleID(playerid),X,Y,Z);
I think it will crash the game
Reply
#8

You think wrong then :P
Reply
#9

Quote:
Originally Posted by BMUK
You think wrong then :P
lol
Reply
#10

Quote:
Originally Posted by ►Peter Corneile◄ [hugu-hosting.co.uk
]
Quote:
Originally Posted by BMUK
You think wrong then :P
lol
I like ur idea BMXUK, but can u explain a bit more plz
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)