If Player Near a specific vehicle
#1

Hello i've been working on a little script and sadely i'm in need of how to check if player near a specific vehicle. Please if you're trying to help me, do not just name some functions. i've been trying to do it.. but still cannot find a way. thanks +rep to whoever helps me.
Reply
#2

What do you mean by specific vehicle? By its unique vehicleid in server or by model ID? If you tried to do it, show us what you got.
Reply
#3

Quote:
Originally Posted by Scottas
Посмотреть сообщение
What do you mean by specific vehicle? By its unique vehicleid in server or by model ID? If you tried to do it, show us what you got.
I'm making an interior for a tropical (boat) so when i'm on the boat ( not as a driver) i type /enter and get tp'd to the interior
Reply
#4

pawn Код:
new
    Float: X, Float: Y, Float: Z, model;
GetPlayerPos(playerid, X, Y, Z);

for(new v = 1; v < MAX_VEHICLES; v++)
{
    if((model = GetVehicleModel(i)))
    {
        if(model == [boat modelid])
        {
            if(GetVehicleDistanceFromPoint(i, X, Y, Z) < 5.0)
            {
                // you are near boat
            }
        }
    }
}
Reply
#5

EDIT: The above
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)