Olб galera queria saber se existe alguma funзao para ver se o player estб perto de algum veiculo!
Se estiver pesso q me ajudem pfv. Desde jб obg! |
native IsValidVehicle(vehicleid);
forward Float:GetPlayerDistanceFromVehicle(playerid, vehicleid);
stock Float:GetPlayerDistanceFromVehicle(playerid, vehicleid) {
if(!IsPlayerConnected(playerid) || !IsValidVehicle(vehicleid)) return -1.0;
new Float:P[6];
GetPlayerPos(playerid, P[0], P[1], P[2]); GetVehiclePos(vehicleid, P[3], P[4], P[5]);
return VectorSize((P[0] - P[3]), (P[1] - P[4]), (P[2] - P[5]));
}