Lock only locking.. - 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: Lock only locking.. (
/showthread.php?tid=296123)
Lock only locking.. -
Luis- - 09.11.2011
When I am inside the vehicle, how can I make it so when I am not in a vehicle it'll still lock.
Sorry I cannot give a code because I am on my phone.
Re: Lock only locking.. -
.:Kaos:. - 09.11.2011
Just check for the nearest vehicle. Here is one from an old filterscript of mine, the code isn't mine. So credit goes to whoever made it.
Код:
stockGetNearestCar(playerid, Float:radius)
{
new Float:SpielerX, Float:SpielerY, Float:SpielerZ, Float:CarX, Float:CarZ, Float:CarY;
GetPlayerPos(playerid, SpielerX, SpielerY, SpielerZ);
for(new i = 1; i < MAX_VEHICLES; i++)
{
GetVehiclePos(i, CarX, CarY, CarZ);
if((floatabs(SpielerX-CarX)<radius)&&(floatabs(SpielerY-CarY)<radius)&&(floatabs(SpielerZ-CarZ)<radius))
{
return i;
}
}
return false;
}
Re: Lock only locking.. -
Luis- - 09.11.2011
It worked, had to write it out xD, thanks mate.