Essentials for MCServer (2)
#31
If you're using any cMonster.mtXXX constants, rewrite them to mtXXX only, that should do the trick.
Reply
Thanks given by:
#32
(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()
Reply
Thanks given by:
#33
(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
Reply
Thanks given by:
#34
Right, it's a problem in the server, then. The StringToMobType function, to be more specific. I'll fix that momentarily.
Reply
Thanks given by:
#35
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.
Reply
Thanks given by: tonibm19
#36
Weird problem but it is only spawning pigs..
Reply
Thanks given by:
#37
Stage 1 of pig takeover.
Reply
Thanks given by:




Users browsing this thread: 5 Guest(s)