Checkpoint Creation offset - 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: Checkpoint Creation offset (
/showthread.php?tid=163280)
Checkpoint Creation offset -
iNsOmNiOuSss - 26.07.2010
Hi,
I am creating a cargo area for the Andromada, which when you enter a checkpoint you will be teleported to the interior. The checkpoint is created based on the current Andromada location, so using Dynamic locations. I need to offset the checkpoint creation to be behind the Andromada, but somehow it fails every time. Here is a snippet of my script.
Код:
if(!strcmp(cmdtext, "/open-hatch", true))
{
new currentveh;
currentveh = GetPlayerVehicleID(playerid);
new Float:vX, Float:vY, Float:vZ;
GetVehiclePos(currentveh,vX,vY,vZ);
if(GetVehicleModel(currentveh) == 592)
{
SetPlayerCheckpoint(playerid, vX, vY, vZ, 3.0);
SendClientMessage(playerid, 0xFFFFFFFF, "Andromada's Cargo Hatch is now open !");
return 1;
}
else
{
SendClientMessage(playerid, 0xFFFFFFFF, "You are not the Andromada's Pilot !");
return 1;
}
}
(identation is runined in these code tags :P)
I would like to maybe change the vX, or vY value, so that vY = vY - 4 (example so that the checkpoint appears behind the plane, and not directly underneath)
Thanks :P
Re: Checkpoint Creation offset -
Shadow™ - 26.07.2010
pawn Код:
SetPlayerCheckpoint(playerid, vX, vY-4.0, vZ, 3.0);
// Or
SetPlayerCheckpoint(playerid, vX-4.0, vY, vZ, 3.0);
Re: Checkpoint Creation offset -
iNsOmNiOuSss - 26.07.2010
Thanks a lot. I was searching all over the place