EssentialsSpawn
#2
You have a very long IsInSpawn() function.

I think this is enough, isn't it?
function IsInSpawn(X, Y, Z, WorldName)
	local World = cRoot:Get():GetWorld(WorldName)
	local SpawnLoc = Vector3d(World:GetSpawnX(), World:GetSpawnY(), World:GetSpawnZ())
	local PlayerLoc = Vector3d(X, Y, Z)
	
	-- Get protection radius for the world.
	local protectRadius = GetSpawnProtection(WorldName)
	
	if (protectRadius == -1) then
		-- There is no spawn for this world, so the player can\'t be in it.
		return false
	end

	if ((SpawnLoc - PlayerLoc):Length() <= protectRadius) then
		return true
	end
	return false
end
Reply
Thanks given by:


Messages In This Thread
EssentialsSpawn - by tonibm19 - 07-25-2014, 07:19 PM
RE: EssentialsSpawn - by Howaner - 08-09-2014, 11:46 PM
RE: EssentialsSpawn - by tonibm19 - 08-16-2014, 04:18 AM
RE: EssentialsSpawn - by donvdp - 12-04-2014, 05:51 AM
RE: EssentialsSpawn - by tonibm19 - 12-04-2014, 06:21 AM
RE: EssentialsSpawn - by Rekuen - 12-18-2015, 02:29 AM
RE: EssentialsSpawn - by XSeries553 - 11-06-2023, 11:46 AM



Users browsing this thread: 1 Guest(s)