I did this
function consoleCreateMarker ( thePlayer, commandName )
if ( thePlayer ) then
local x, y, z = getElementPosition ( thePlayer ) -- get the player's position
-- create a cylindrical marker next to the player:
local marker1 = createMarker ( x, y, z - 1, "cylinder", 1.5, 255, 255, 0, 170 )
if ( theMarker ) then -- check if the marker was created successfully
outputConsole ( "El marcador se ha creado correctamente", thePlayer )
else
outputConsole ( "Failed to create marker", thePlayer )
end
end
end
addCommandHandler ( "createma", consoleCreateMarker )
function marker11 ( marker11 )
if isElementWithinMarker(thePlayer) then -- checking if player is in a marker
destroyElement ( marker )
end
end
addCommandHandler("deletema", marker11 )
(I'm new in scripting)
but this gives me this:
Bad argument @ 'isElementWithinMarker' [Expected element at argument 1, got nil]