AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How many feet in origin (https://forums.alliedmods.net/showthread.php?t=62984)

travo 11-09-2007 01:31

How many feet in origin
 
does anyone know how many origin points are in a foot?

example: origin (1200,100,800) and origin2 (1200,100,600)
how many actual feet are between the two origins?

thanks

Alka 11-09-2007 01:44

Re: How many feet in origin
 
Calculate the distance..."get_distance(...)", is in units, then convert it to "meters" then to "feets" :s I will give you an e.g when i get home.

travo 11-09-2007 03:29

Re: How many feet in origin
 
k got it
new distance = get_distance(origin1,origin2);
new feet = floatround(distance/35.0);
new meter = floatround(distance/32.00);
for future reference

Alka 11-09-2007 07:59

Re: How many feet in origin
 
I've maded a stock! Transform units(game distance) in feets.

Code:

stock Float:units_to_feets(num)
{
 new Float:Feets = (num * 0.0254) * 3.2;
 
 return Feets;
}

No. You'r formula is wrong.

[ --<-@ ] Black Rose 11-09-2007 08:06

Re: How many feet in origin
 
I though origin was in feet?

Alka 11-09-2007 08:37

Re: How many feet in origin
 
Hmmm, dunno shure, maybe -.-'

Orangutanz 11-09-2007 11:50

Re: How many feet in origin
 
Might as well include this data as well Alka:
Code:
public Float:Native_get_real_distance() {     new Float:vOrigin1[3], Float:vOrigin2[3]     get_array_f(1, vOrigin1, 3)     get_array_f(2, vOrigin2, 3)         new Float:hlunits = get_distance_f(vOrigin1, vOrigin2)     new Float:units = hlunits * 0.0254 // meter     new convert = get_param(3)     switch (convert)     {         case 0: units *= 39.3701    // inch         case 1: units *= 3.2808 // foot         case 2: units *= 1.0936 // yard         case 3: units *= 0.001  // kilometer         case 4: units *= 0.0006 // mile     }     return units }
Native from SHPUN which has been discontinued.

Alka 11-09-2007 15:01

Re: How many feet in origin
 
@orangutanz - Nice thing :D

Emp` 11-09-2007 17:22

Re: How many feet in origin
 
Code:

#define UnitsToMeters(%1)        (%1*0.0254)
#define UnitsToInches(%1)        (%1*1.00000054)
#define UnitsToFeet(%1)                (%1*0.08333232)
#define UnitsToYards(%1)        (%1*0.02777744)
#define UnitsToKM(%1)                (%1*0.0000254)
#define UnitsToMiles(%1)        (%1*0.00001524)



All times are GMT -4. The time now is 01:13.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.