Does anyone know..
#4

I have two usefull stocks for you:

pawn Код:
stock GetPlayerDistanceToVehicle(playerid, tovehicleid, &Float:Distance)
{
    new Float:pX, Float:pY, Float:pZ, Float:vX, Float:vY, Float:vZ;
    GetPlayerPos(playerid,pX,pY,pZ);
    GetVehiclePos(tovehicleid,vX,vY,vZ);
    Distance = floatsqroot((vX-pX)*(vX-pX)+(vY-pY)*(vY-pY)+(vZ-pZ)*(vZ-pZ));
}
and

pawn Код:
stock IsPlayerInRangeOfVehicle(playerid, tovehicleid, Float:Range)
{
    new Float:vX, Float:vY, Float:vZ;
    GetPlayerPos(playerid,pX,pY,pZ);
    GetVehiclePos(tovehicleid,vX,vY,vZ);
    if(IsPlayerInRangeOfPoint(playerid,Range,vX,vY,vZ)) return true;
    return false;
}
Reply


Messages In This Thread
Does anyone know.. - by bartje01 - 01.07.2011, 15:45
AW: Does anyone know.. - by Nero_3D - 01.07.2011, 15:51
Re: Does anyone know.. - by bartje01 - 01.07.2011, 15:53
Re: Does anyone know.. - by BigETI - 01.07.2011, 16:03
Re: Does anyone know.. - by bartje01 - 01.07.2011, 16:27
Re: Does anyone know.. - by rjjj - 01.07.2011, 16:53
Re: Does anyone know.. - by bartje01 - 01.07.2011, 17:35

Forum Jump:


Users browsing this thread: 4 Guest(s)