is exist like my writen code? isplayernearvehicle(playerid) and return vehicle id which playeris near but if not any near vehicle return -1 i thinking about 3 hours and don't have idea how to make code working properly so any ideas how to make this code?
pawn Code:
stock IsPlayerNearVehicle(playerid, vehicleid, Float:range)
{
if(!GetVehicleModel(vehicleid)) return 0;
new Float:x, Float:y, Float:z;
GetVehiclePos(vehicleid, x, y, z);
return IsPlayerInRangeOfPoint(playerid, range, x, y, z);
}