SetVehPos? - 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)
+--- Thread: SetVehPos? (
/showthread.php?tid=305223)
SetVehPos? -
SnG.Scot_MisCuDI - 21.12.2011
Im trying to make a command where you do /up and it brings the player up 50 feet (or what ever its measured in) but when i try to do SetVehPos(vehid,X, Y , Z+50) it crashes my pawn. Here is the script working. But if ur in a car it just brings you up 50 feet without car.
pawn Код:
iif (strcmp("/up", cmdtext, true, 8 ) == 0)
{
new Float:X, Float:Y, Float:Z;
new vehicleid = GetPlayerVehicleID(playerid);
GetPlayerPos(playerid, X, Y, Z);
SetPlayerPos(playerid,X, Y, Z+50);
SetVehiclePos(vehicleid, X, Y, Z+50);
return 1;
}
return 1;
}
Re: SetVehPos? -
Jakku - 21.12.2011
https://sampwiki.blast.hk/wiki/SetVehiclePos
Re: SetVehPos? -
SnG.Scot_MisCuDI - 21.12.2011
Quote:
Originally Posted by Jakku
|
It still teleports the player without car
Re: SetVehPos? -
Eric - 21.12.2011
pawn Код:
if (strcmp("/up", cmdtext, true, 8 ) == 0)
{
new Float:X, Float:Y, Float:Z;
new vehicleid = GetPlayerVehicleID(playerid);
GetPlayerPos(playerid, X, Y, Z);
if(IsPlayerInAnyVehicle(playerid)) {
SetVehiclePos(vehicleid, X, Y, Z+50);
}
else {
SetPlayerPos(playerid,X, Y, Z+50);
}
return 1;
}
Try that.
Re: SetVehPos? -
Tee - 21.12.2011
pawn Код:
if (strcmp("/up", cmdtext, true, 8 ) == 0)
{
new Float:X, Float:Y, Float:Z;
new vehicleid = GetPlayerVehicleID(playerid);
GetPlayerPos(playerid, X, Y, Z);
if(vehicleid == 0)
{
SetPlayerPos(playerid, X, Y, Z+50.0);
}
else
{
GetVehiclePos(vehicleid, X, Y, Z);
SetVehiclePos(vehicleid,X, Y, Z+50);
PutPlayerInVehicle(playerid,vehicleid,0);
}
return 1;
}
Re: SetVehPos? -
SnG.Scot_MisCuDI - 21.12.2011
thanks Tee
Re: SetVehPos? -
Tee - 21.12.2011
No Problem.