02-20-2014, 05:14 AM
02-20-2014, 05:17 AM
Please be more precise.
02-20-2014, 05:19 AM
spawn a creeper
a cow
a entity
........
a cow
a entity
........
02-20-2014, 05:23 AM
Commands? Parameters? Config?
02-20-2014, 05:25 AM
I don't know
maybye a copy of
essential plugin ? this command is /spawnmob
help ?????
maybye a copy of
essential plugin ? this command is /spawnmob
help ?????
02-20-2014, 05:35 AM
Try this code:
I have not tested this so it might not work!
Woooow calm down. It's not like we snap our fingers and the code just magically appears.
PLUGIN = nil
function Initialize(Plugin)
PLUGIN = Plugin
Plugin:SetName("SpawnMob")
Plugin:SetVersion(1)
local PluginManager = cPluginManager:Get()
PluginManager:BindCommand("/spawnmob", "spawnmob.spawnmob", HandleSpawnMobCommand, " ~ [MobType] Spawns a mob at the place you're looking at.")
return true
end
function HandleSpawnMobCommand(Split, Player)
if Split[2] == nil then
Player:SendMessage(cChatColor.Rose .. "Usage: /spawnmob [Mob]")
return true
end
local MobType = StringToMobType(Split[2])
if MobType == cMonster.mtInvalidType then
Player:SendMessage(cChatColor.Rose .. "Invalid mob type.")
return true
end
local BlockX, BlockY, BlockZ
local World = Player:GetWorld()
local Callbacks = {
OnNextBlock = function(X, Y, Z, BlockType, BlockMeta)
if BlockType ~= E_BLOCK_AIR then
BlockX, BlockY, BlockZ = X, Y, Z
return true
end
end
};
local EyePos = Player:GetEyePosition()
local LookVector = Player:GetLookVector()
LookVector:Normalize()
local Start = EyePos
local End = EyePos + LookVector * 150
cLineBlockTracer.Trace(World, Callbacks, Start.x, Start.y, Start.z, End.x, End.y, End.z)
World:SpawnMob(BlockX, BlockY, BlockZ, MobType
Player:SendMessage(cChatColor.LightGreen .. "A " .. Split[2] .. " was spawned at " .. BlockX .. " " .. BlockY .. " " .. BlockZ)
return true
end
I have not tested this so it might not work!
(02-20-2014, 05:25 AM)louisgg Wrote: [ -> ]help ?????
Woooow calm down. It's not like we snap our fingers and the code just magically appears.
