Author Topic: /c nearcar  (Read 59 times)

Matrix

  • Resigned
  • Mature Poster
  • ***
  • Posts: 110
  • Karma +0/-0
  • Simply, Matrix
  • Location: **** Hell
/c nearcar
« on: December 22, 2011, 07:57:44 am »
Code: [Select]
else if ( cmd == "CarNear" )
        {
                PrivMessage("IDs Near you: " + VehicleNear(player), player);
        }

Code: [Select]
function VehicleNear(Player, Radius)
{
local IDs = null;
local Pos1 = Player.Pos;
for ( local a = 1; FindVehicle( a ); a++ )
{
local Pos2 = FindVehicle(a).Pos;
if ( GetDistance(Pos1.x, Pos2.x, Pos1.y, Pos2.y, Pos1.z, Pos2.z) < 20 ) IDs += FindVehicle(a).ID;
}
return IDs;
}

function GetDistance(X1, X2, Y1, Y2, Z1, Z2)
{
local a = X1 - X2
local b = Y1 - Y2
local c = Z1 - Z2
local x = math.abs(a)
local y = math.abs(b)
local z = math.abs(c)

return math.sqrt((x * x + y * y + z * z))
}


Share on Bluesky Share on Facebook


MaDKiLLeR

  • Server Owner
  • Hero Member
  • **********
  • Posts: 723
  • Karma +3/-4
  • Mess with the best, Die like the rest :P
  • Location: What will you do after knowing it?
Re: /c nearcar
« Reply #1 on: December 22, 2011, 09:45:14 am »
I Reall don't thinks so we need it but /c nearplayers can be interesting.
- [VU_T]MaDKiLLeR


Death War Developer / Owner, VU Trainee, Playing VC:MP since June 2009.

~ Find me on IRC here

[TZ_T]Az33M

  • Newbie
  • *
  • Posts: 6
  • Karma +0/-0
Re: /c nearcar
« Reply #2 on: March 31, 2012, 12:49:05 pm »
Ye mad

Rathan

  • Newbie
  • *
  • Posts: 33
  • Karma +0/-0
  • I AM THE POWERFUL BEN10
  • Location: INDIA,Kerala,Kasaragod
Re: /c nearcar
« Reply #3 on: April 02, 2012, 08:55:42 pm »
man is that pawn or Squrrill