09.07.2013, 23:10
Im trying to do some commands, but only make them work if the player is in range of a vehicle, I got a lot on my mind with whatever, and cant seem to think straight. Can someone please help me??(Will +rep anyone who comments anything helpful ofc)
This is what I got
This is what I got
pawn Код:
stock GetPlayerClosestVehicle(playerid)
{
new vehicleid;
Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
foreach (new i : vehicleid)
{
GetVehicleDistanceFromPoint(vehicleid, X, Y, Z);
return 1;
}
}
stock IsPlayerInRangeOfClosestVehicle(playerid)
{
new veh = GetPlayerClosestVehicle(playerid);
new Float:X, Float:Y, Float:Z;
GetVehiclePos(veh, X, Y, Z);
if(IsPlayerInRangeOfPoint(playerid, 2.0, X, Y, Z);