[Help]Teleporting with Cars... - 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: [Help]Teleporting with Cars... (
/showthread.php?tid=102513)
[Help]Teleporting with Cars... -
Tigerbeast11 - 15.10.2009
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?
Re: [Help]Teleporting with Cars... -
saiberfun - 15.10.2009
GetPlayerVehicleID()
SetVehiclePos()
have a look at the wiki for more infos about these functions.
Saiberfun
Re: [Help]Teleporting with Cars... -
Peter_Corneile - 15.10.2009
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;
}
Re: [Help]Teleporting with Cars... -
Tigerbeast11 - 16.10.2009
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!
Re: [Help]Teleporting with Cars... -
Peter_Corneile - 16.10.2009
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
Re: [Help]Teleporting with Cars... -
BMUK - 16.10.2009
You dont need to do
pawn Код:
new car = GetPlayerVehicle...
Simply:
pawn Код:
SetVehiclePos(GetPlayerVehicleID(playerid),X,Y,Z);
Re: [Help]Teleporting with Cars... -
Peter_Corneile - 16.10.2009
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
Re: [Help]Teleporting with Cars... -
BMUK - 16.10.2009
You think wrong then :P
Re: [Help]Teleporting with Cars... -
Peter_Corneile - 16.10.2009
Quote:
Originally Posted by BMUK
You think wrong then :P
|
lol
Re: [Help]Teleporting with Cars... -
Tigerbeast11 - 16.10.2009
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