Lock only locking..
#1

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.
Reply
#2

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;
}
Reply
#3

It worked, had to write it out xD, thanks mate.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)