SA-MP Forums Archive
is exist? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: is exist? (/showthread.php?tid=452922)



is exist? - speed258 - 23.07.2013

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?


Re: is exist? - JimmyCh - 23.07.2013

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);
}
You mean this?
You can use IsPlayerNearVehicle now..