Essentials for MCServer (2)
#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:


Messages In This Thread
Essentials for MCServer (2) - by tonibm19 - 04-21-2014, 07:22 PM
RE: CommandBook for MCServer - by bearbin - 04-21-2014, 07:46 PM
RE: CommandBook for MCServer - by tonibm19 - 04-24-2014, 04:53 AM
RE: Essentials for MCServer (2) - by LO1ZB - 04-24-2014, 05:26 AM
RE: Essentials for MCServer (2) - by tonibm19 - 04-24-2014, 11:42 PM
RE: Essentials for MCServer (2) - by tonibm19 - 04-25-2014, 12:32 AM
RE: Essentials for MCServer (2) - by tigerw - 04-25-2014, 03:52 AM
RE: Essentials for MCServer (2) - by tonibm19 - 04-25-2014, 04:14 AM
RE: Essentials for MCServer (2) - by tonibm19 - 04-27-2014, 11:48 PM
RE: Essentials for MCServer (2) - by pikachu784 - 04-28-2014, 08:25 AM
RE: Essentials for MCServer (2) - by tonibm19 - 04-28-2014, 03:02 PM
RE: Essentials for MCServer (2) - by xoft - 04-28-2014, 08:42 PM
RE: Essentials for MCServer (2) - by LO1ZB - 04-28-2014, 10:46 PM
RE: Essentials for MCServer (2) - by tonibm19 - 04-29-2014, 12:00 AM
RE: Essentials for MCServer (2) - by xoft - 04-29-2014, 04:01 AM
RE: Essentials for MCServer (2) - by tonibm19 - 04-29-2014, 04:18 AM
RE: Essentials for MCServer (2) - by NiLSPACE - 04-29-2014, 04:42 AM
RE: Essentials for MCServer (2) - by xoft - 04-29-2014, 05:02 AM
RE: Essentials for MCServer (2) - by tonibm19 - 05-03-2014, 05:53 AM
RE: Essentials for MCServer (2) - by xoft - 05-03-2014, 06:14 AM
RE: Essentials for MCServer (2) - by tonibm19 - 05-03-2014, 06:23 AM
RE: Essentials for MCServer (2) - by xoft - 05-03-2014, 08:11 AM
RE: Essentials for MCServer (2) - by tonibm19 - 08-09-2014, 07:21 PM
RE: Essentials for MCServer (2) - by tonibm19 - 10-02-2014, 03:13 PM
RE: Essentials for MCServer (2) - by tonibm19 - 10-05-2014, 11:15 PM
RE: Essentials for MCServer (2) - by xoft - 10-06-2014, 01:27 AM
RE: Essentials for MCServer (2) - by tonibm19 - 10-06-2014, 04:14 AM
RE: Essentials for MCServer (2) - by xoft - 10-06-2014, 04:30 AM
RE: Essentials for MCServer (2) - by Howaner - 10-06-2014, 04:38 AM
RE: Essentials for MCServer (2) - by StevasaurousREX - 10-06-2014, 04:40 AM
RE: Essentials for MCServer (2) - by xoft - 10-06-2014, 05:54 AM
RE: Essentials for MCServer (2) - by xoft - 10-06-2014, 06:12 AM
RE: Essentials for MCServer (2) - by tigerw - 10-07-2014, 05:36 AM



Users browsing this thread: 10 Guest(s)