What's is wrong here ?
Server:
iv = 0
function toggleInvis( source )
if iv == 0 then
iv = 1
setPlayerNametagShowing(source, false)
setElementAlpha(source, 0)
destroyBlipAttachedTo(source)
else
iv = 0
setPlayerNametagShowing(source, true)
setElementAlpha(source, 255)
end
end
function destroyBlipAttachedTo(player)
for id, attachedElement in ipairs(getAttachedElements(player)) do
if getElementType(attachedElement) == "blip" then
destroyElement(attachedElement)
else
myPlayer = getRandomPlayer ()
-- Create a radar blip in the middle of the map
myBlip = createBlip ( 0, 0, 0 )
-- Make the player the parent of the blip, so that the blip follows the player around
setElementParent ( myBlip, myPlayer )
end
end
end
addCommandHandler ( "invisible", toggleInvis)