Hallo leute ich habe ein kleines problem und zwar wenn ich /hide mache passiert folgendes:
Es kommt im chat You're not longer hidden! obwohl das kommen soll man man erst beim 2ten mal /hide macht und wenn ich danach noch mal /hide mache wird das Object attached und es steht im chat
You're now hidden danach will ich wieder /hide eingeben damit sich das object zerstört aber dann kommt wieder You're now hidden und es sind 2Objecte an mir attached.
Dann hab ich noch ne kleine frage und zwar kann man das nicht irgendwie so machen dass wenn ich /hide mache gucke ich ein bisschen höher weil wenn ich /hide mache spawnt das object in mir und ich sehe nix.
Code:
Lua
ids = {1215, 1300, 2977}
local hide = 0
function verstecken ( source, commandName )
if (hide == 1) then
if getTeamName(getPlayerTeam(source)) == "Verstecker" then
local x, y, z = getElementPosition ( source )
local hide = createObject(ids[math.random(1,3)], x, y, z-0.5)
attachElements(hide, source)
setElementAlpha(source, 0)
outputChatBox("You're hidden", source)
hide = 0
else
outputChatBox("You're not allowed to use this command!", source)
end
else
if getTeamName(getPlayerTeam(source)) == "Verstecker" then
destroyElement(hide)
outputChatBox("You're not longer hidden!", source)
hide = 1
else
outputChatBox("You're not allowed to use this command!", source)
end
end
end
addCommandHandler ( "hide", verstecken )
Alles anzeigen