If you're going to need this frequently, then I would suggest creating a global MAX_VEHICLES array and setting the index to the playerid when he enters the vehicle. e.g.
pawn Код:
VehicleOccupied[vehicleid]= playerid;
Otherwise, just do a loop.
pawn Код:
for(new i; i < MAX_PLAYERS; i++) if(IsPlayerInVehicle(i, vehicleid))return i;