I need to make a function what i wrote above. IsPlayerNearVehicle(playerid, vehicleid, Float:distance). I made alot of this functions but it doesn't works because vehicle is not streamed. How to stream them in OnVehicleStreamIn?
stock IsPlayerNearVehicle(playerid, vehicleid, Float:distance)
{
new m = GetVehicleModel(vehicleid);
if(m == 0) return 0;
new Float:x, Float:y, Float:z;
GetVehiclePos(vehicleid, x, y, z);
if(!IsPlayerInRangeOfPoint(playerid, distance, x, y, z)) return 0;
return 1;
}
stock IsPlayerNearVehicle(playerid, vehicleid, Float:range)
{
new Float:x, Float:y, Float:z;
GetVehiclePos(vehicleid, x, y, z);
if(IsPlayerInRangeOfPoint(playerid, range, x, y, z))
{
return 1;
}
return 0;
}

stock IsPlayerNearVehicle(playerid, vehicleid, Float:range)
{
new Float:X, Float:Y, Float:Z;
GetVehiclePos(vehicleid, X, Y, Z);
if(IsPlayerInRangeOfPoint(playerid, range, X, Y, Z))return true;
else return false;
}
native Float:GetVehicleDistanceFromPoint(vehicleid, Float:X, Float:Y, Float:Z);
|
Should be as simple as this shouldn't it?
Код:
stock IsPlayerNearVehicle(playerid, vehicleid, Float:range)
{
new Float:x, Float:y, Float:z;
GetVehiclePos(vehicleid, x, y, z);
if(IsPlayerInRangeOfPoint(playerid, range, x, y, z))
{
return 1;
}
return 0;
}
|
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);
}