EssentialsSpawn
#1
EssentialsSpawn is a plugin to protect MCServer server's spawn.
It's basically a highly modified version of SpawnProtect/SpawnPlus, so I want to give credits to bearbin.

Features
-Protect your spawn and keep your players safe when they're inside it.
-Use your own spawn enter/left messages (config.lua)

What can you disable in spawn?

-Block placing

-Block breacking

-Right click (interaction with buttons, levers, chests, etc)

-PVP

-Mob Spawning

-Explosions

-Fall damage

All is configurable (just go to config.lua)

Permissions

espawn.bypass For admins who whant to be allowed to build in spawn.

Why is this plugin coming out before Essentials? Huh
...

Github: https://github.com/tonibm19/EssentialsSpawn
Zip download: https://github.com/tonibm19/EssentialsSp...master.zip
Reply
Thanks given by:
#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:
#3
Done, thanks.
Reply
Thanks given by:
#4
I would like to change the default spawnprotection radius from 10 to 100... i tried this by simply changing the value in the main.lua file from 10 to 100... but everytime i try to set the spawnarea my server crashes...

[Image: cROdWa7.png]
Reply
Thanks given by:
#5
You've to change it in world.ini
Please don't touch main.lua, only config.lua.
Reply
Thanks given by:
#6
I have this errors in the log after going to the nether:

[16:25:11] Error in plugin EssentialsSpawn calling function <callback>()
[16:25:11] LUA: Plugins/EssentialsSpawn/main.lua:60: attempt to compare number with nil
[16:25:11] Stack trace:
[16:25:11] Plugins/EssentialsSpawn/main.lua(60): IsInSpawn
[16:25:11] Plugins/EssentialsSpawn/hooks.lua(55): (no name)
[16:25:11] Stack trace end
[16:25:11] Error in plugin EssentialsSpawn calling function <callback>()
[16:25:11] LUA: Plugins/EssentialsSpawn/main.lua:60: attempt to compare number with nil
[16:25:11] Stack trace:
[16:25:11] Plugins/EssentialsSpawn/main.lua(60): IsInSpawn
[16:25:11] Plugins/EssentialsSpawn/hooks.lua(55): (no name)
[16:25:11] Stack trace end
[16:25:11] Error in plugin EssentialsSpawn calling function <callback>()
[16:25:11] Lua engine: attempting to push a plain pointer, pushing nil instead.
[16:25:11] This indicates an unimplemented part of MCS bindings
[16:25:11] Stack trace:
[16:25:11] Stack trace end
[16:25:11] LUA: Plugins/EssentialsSpawn/main.lua:60: attempt to compare number with nil
[16:25:11] Stack trace:
[16:25:11] Plugins/EssentialsSpawn/main.lua(60): IsInSpawn
[16:25:11] Plugins/EssentialsSpawn/hooks.lua(45): (no name)
[16:25:11] Stack trace end
[16:25:11] Error in plugin EssentialsSpawn calling function <callback>()
[16:25:11] LUA: Plugins/EssentialsSpawn/main.lua:60: attempt to compare number with nil
[16:25:11] Stack trace:
[16:25:11] Plugins/EssentialsSpawn/main.lua(60): IsInSpawn
[16:25:11] Plugins/EssentialsSpawn/hooks.lua(79): (no name)
[16:25:11] Stack trace end
[16:25:11] Error in plugin EssentialsSpawn calling function <callback>()
[16:25:11] LUA: Plugins/EssentialsSpawn/main.lua:60: attempt to compare number with nil
[16:25:11] Stack trace:
[16:25:11] Plugins/EssentialsSpawn/main.lua(60): IsInSpawn
[16:25:11] Plugins/EssentialsSpawn/hooks.lua(95): (no name)
[16:25:11] Stack trace end
[16:25:11] Error in plugin EssentialsSpawn calling function <callback>()
[16:25:12] LUA: Plugins/EssentialsSpawn/main.lua:60: attempt to compare number with nil
[16:25:12] Stack trace:
[16:25:12] Plugins/EssentialsSpawn/main.lua(60): IsInSpawn
[16:25:12] Plugins/EssentialsSpawn/hooks.lua(79): (no name)
[16:25:12] Stack trace end
[16:25:12] Error in plugin EssentialsSpawn calling function <callback>()
[16:25:13] LUA: Plugins/EssentialsSpawn/main.lua:60: attempt to compare number with nil
[16:25:13] Stack trace:
[16:25:13] Plugins/EssentialsSpawn/main.lua(60): IsInSpawn
[16:25:13] Plugins/EssentialsSpawn/hooks.lua(79): (no name)
[16:25:13] Stack trace end
[16:25:13] Error in plugin EssentialsSpawn calling function <callback>()
[16:25:14] Lua engine: attempting to push a plain pointer, pushing nil instead.
[16:25:14] This indicates an unimplemented part of MCS bindings
[16:25:14] Stack trace:
[16:25:14] Stack trace end
[16:25:14] LUA: Plugins/EssentialsSpawn/main.lua:60: attempt to compare number with nil
[16:25:14] Stack trace:
[16:25:14] Plugins/EssentialsSpawn/main.lua(60): IsInSpawn
[16:25:14] Plugins/EssentialsSpawn/hooks.lua(45): (no name)
[16:25:14] Stack trace end
[16:25:14] Error in plugin EssentialsSpawn calling function <callback>()
[16:25:14] LUA: Plugins/EssentialsSpawn/main.lua:60: attempt to compare number with nil
[16:25:14] Stack trace:
[16:25:14] Plugins/EssentialsSpawn/main.lua(60): IsInSpawn
[16:25:14] Plugins/EssentialsSpawn/hooks.lua(79): (no name)
[16:25:14] Stack trace end
[16:25:14] Error in plugin EssentialsSpawn calling function <callback>()
[16:25:15] LUA: Plugins/EssentialsSpawn/main.lua:60: attempt to compare number with nil


I post it here for you to know in case you have the time to check it.
I will open an issue in github too.
Thanks.
Reply
Thanks given by:
#7
Any commands?
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)