New Heal Settings

Started by W3aPoN^, Jul 23, 2016, 01:25 PM

Previous topic - Next topic

W3aPoN^

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

Kewun

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.

vito

or use Pos1.Distance(Pos2) to caluculate distance between 2 Vectors in 3d.

W3aPoN^

Bros Where To Add Distance Function? THANKS Waiting...

Kewun

in Distance.nut
same as the command, but u need to add it to onPlayerCommand(player,cmd,text) fuction

W3aPoN^

Which Server Are you Using 0.4 OR 0.3?

Kewun


W3aPoN^

Can You Please Give Me A Full Video Tutorial About That PLEASE?

Kewun


Finch Real

@razacharan Add Distance function in your main.nut after function onscriptload
And add command to function onPlayerCommand
My Snipet Showroom

http://pastebin.com/5KKuU5cg

Xmair

DistanceFromPoint is better.

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

DizzasTeR

Quote from: Xmair on Jul 23, 2016, 05:20 PMDistanceFromPoint is better.

Vector.Distance is alot better.