Cuberite Forum
Essentials for MCServer (2) - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html)
+--- Thread: Essentials for MCServer (2) (/thread-1457.html)

Pages: 1 2 3 4


RE: Essentials for MCServer (2) - xoft - 10-06-2014

If you're using any cMonster.mtXXX constants, rewrite them to mtXXX only, that should do the trick.


RE: Essentials for MCServer (2) - Howaner - 10-06-2014

(10-06-2014, 04:30 AM)xoft Wrote: If you're using any cMonster.mtXXX constants, rewrite them to mtXXX only, that should do the trick.

He use StringToMobType()


RE: Essentials for MCServer (2) - StevasaurousREX - 10-06-2014

(10-06-2014, 04:30 AM)xoft Wrote: If you're using any cMonster.mtXXX constants, rewrite them to mtXXX only, that should do the trick.

Not sure what you mean so ill show you my command,
function HandleSpawnMobCommand(Split, Player)

	-- Make sure there are a correct number of arguments.
	if ((#Split ~= 2) and (#Split ~=3)) then
		Player:SendMessage( Player, "Usage: /spawnmob <mobname> [number]" )
		return true
	end

    -- Mob name as typed in by the player
    local MobName = Split[2]
    -- Mob Type based
    local MobType = StringToMobType(Split[2])
    if Split[3] ~= nil then
        -- Don't allow more then 10 mobs to be spawned at once.
        local ammount = tonumber(Split[3])
        if ammount > 10 then
            Player:SendMessage(Player, "Max mob spawn is 10.")
            ammount = 10
        end
        for i=0,ammount do
            Player:GetWorld():SpawnMob(Player:GetPosX(), Player:GetPosY(), Player:GetPosZ(), MobType)
        end
            Player:SendMessage(Player, "Spawned " .. ammount .. " " .. MobName .. "s")
        return true
    else
        Player:GetWorld():SpawnMob(Player:GetPosX(), Player:GetPosY(), Player:GetPosZ(), MobType)
        Player:SendMessage(Player, "Spawned 1 " .. MobName)
    end
		return true;
end



RE: Essentials for MCServer (2) - xoft - 10-06-2014

Right, it's a problem in the server, then. The StringToMobType function, to be more specific. I'll fix that momentarily.


RE: Essentials for MCServer (2) - xoft - 10-06-2014

Fix committed. You should change your StringToMobType() to cMonster:StringToMobType(); it will continue working for now but will emit a log message about being deprecated.


RE: Essentials for MCServer (2) - StevasaurousREX - 10-06-2014

Weird problem but it is only spawning pigs..


RE: Essentials for MCServer (2) - tigerw - 10-07-2014

Stage 1 of pig takeover.