Hello Guys I Want To Create New Settings For heal If A Player is on ROAD and typing /heal Then He Cannot heal Himself An A message will go to the player you must be at HOSPITAL Or Drug Store To Heal Yourself And When He Goes To Hospital Or Drug Store Then He Can Heal HELP ME THANKS IN ADVANCE
use Distance thing
function Distance(x1, y1, x2, y2)
{
local dist = sqrt(((x2 - x1)*(x2 - x1)) + ((y2 - y1)*(y2 - y1)));
return dist;
}
after , the cmd
if(cmd=="heal")
{
local hospital = Distance(player.Pos.x, player.Pos.y, Hospital.x, Hospital.y)
if (hospital < 5 )
player.Health = 100
MessagePlayer("You healed",player)
}
and god damnit stop using big font size, you dont need to scream. if you scream like that, no one is gonna help u.
or use Pos1.Distance(Pos2) to caluculate distance between 2 Vectors in 3d.
Bros Where To Add Distance Function? THANKS Waiting...
in Distance.nut
same as the command, but u need to add it to onPlayerCommand(player,cmd,text) fuction
Which Server Are you Using 0.4 OR 0.3?
0.4
Can You Please Give Me A Full Video Tutorial About That PLEASE?
laziness
@razacharan Add Distance function in your main.nut after function onscriptload
And add command to function onPlayerCommand
DistanceFromPoint is better.
Quote from: Xmair on Jul 23, 2016, 05:20 PMDistanceFromPoint is better.
Vector.Distance is
alot better.