Check vehicle id
#1

I've been searching for a relevant post but couldn't find it so I decided to post my own.

I'm trying to check whether the nearest vehicle to me is a particular model ID. How do I go about doing this?

For example:

If there is a LSPD car or a LVPD car infront of me it'll allow me to enter however if it is a LSFD vehicle then it'll send me a error message.
Reply
#2

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new i = GetVehicleModel(vehicleid);
    switch(i)
    {
        case /*list car's not allowed to enter*/: // Eject player and send error message.
        default: // Allow entry.
    }
    return 1;
}
Reply
#3

@Crayder - You forgot to include a method that does not require that as well.

You can take a look here.
https://sampforum.blast.hk/showthread.php?tid=486060
Код:
GetNearestVehicle(playerid)
Then simply check the modelid.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)