Posts: 1,767
Threads: 124
Joined: Mar 2010
Okey so i helped alot people so maybe now someone help me?
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?
Posts: 2,593
Threads: 34
Joined: Dec 2007
Posts: 1,767
Threads: 124
Joined: Mar 2010
Wow, wow, wow! chill all! i fixed it already
pawn Код:
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;
}
Posts: 2,593
Threads: 34
Joined: Dec 2007
You can use that
pawn Код:
native Float:GetVehicleDistanceFromPoint(vehicleid, Float:X, Float:Y, Float:Z);
Quote:
Originally Posted by AustinJ
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;
}
|
simply
pawn Код:
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);
}