Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: VK.Jona83Killer on Jun 21, 2018, 03:26 PM

Title: What is the error on this?
Post by: VK.Jona83Killer on Jun 21, 2018, 03:26 PM
else if (!DistanceFromPoint(Cosa.x,Cosa.y,player.Pos.x,player.Pos.y) < 10);
cause this error:
comparison between 'bool' and '10'

how to fix?
Title: Re: What is the error on this?
Post by: NicusorN5 on Jun 21, 2018, 04:27 PM
Fixed:
else if (!(DistanceFromPoint(Cosa.x,Cosa.y,player.Pos.x,player.Pos.y) < 10))
Title: Re: What is the error on this?
Post by: VK.Jona83Killer on Jun 21, 2018, 05:01 PM
Solved
Title: Re: What is the error on this?
Post by: [KM]Helathien on Jun 21, 2018, 05:04 PM
Just do it like this
local InPlace = DistanceFromPoint(Cosa.x,Cosa.y,player.Pos.x,player.Pos.y) < 10
else if ( !InPlace )

Title: Re: What is the error on this?
Post by: kennedyarz on Jun 22, 2018, 03:28 AM
Quote from: [KM]Helathien on Jun 21, 2018, 05:04 PMJust do it like this
local InPlace = DistanceFromPoint(Cosa.x,Cosa.y,player.Pos.x,player.Pos.y) < 10
else if ( !InPlace )

local InPlace = DistanceFromPoint(Cosa.Pos.x, Cosa.Pos.y, player.Pos.x, player.Pos.y) < 10
else if ( !InPlace )

adding Pos to Cosa