IsPlayerNearVehicle(playerid, vehicleid, Float:distance)
#1

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?
Reply
#2

try this..
pawn Код:
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;
}
not tested it yet though
Reply
#3

http://forum.sa-mp.com/search.php?searchid=2852162
Reply
#4

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;
}
Reply
#5

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;
}
Reply
#6

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);
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)