Felipe Viedma Posted January 31, 2013 Share Posted January 31, 2013 hi all today I come to see if you can give me a help ... eh good at this time been working on a script style CIT eventwarp ... and I have almost finished I only need the most important part that when people write the command / eventwarp marker were fenced to believe in my position that hopefully help me with a function to be used to complement the script..... : --server side-- function consoleCreateMarker ( thePlayer, commandName ) if hasObjectPermissionTo ( thePlayer, "command.mute" ) then local x, y, z = getElementPosition ( thePlayer ) if ( theMarker ) then if isElement(theMarker) then destroyElement(theMarker) theMarker = nil end if isElement(blip) then destroyElement(blip) blip = nil end outputChatBox ( "event disabled", thePlayer ) else theMarker = createMarker ( x + 2, y + 2, z - 1, "cylinder", 1.5, 255, 255, 0, 170 ) blip = createBlipAttachedTo ( theMarker, 49, 1 ) dim = getElementDimension ( thePlayer ) int = getElementInterior(thePlayer) setElementDimension ( theMarker, dim ) setElementInterior ( theMarker, int) outputChatBox ( "#00FF00An event has just been created use #FF0000/eventwarp #00FF00now!", getRootElement(), 255, 255, 255, true ) end end end addCommandHandler ( "evento", consoleCreateMarker ) thanks in advance Link to comment
DNL291 Posted January 31, 2013 Share Posted January 31, 2013 Try this function consoleCreateMarker ( thePlayer, commandName ) if hasObjectPermissionTo ( thePlayer, "command.mute" ) then px, py, pz = getElementPosition ( thePlayer ) if ( theMarker ) then if isElement(theMarker) then destroyElement(theMarker) theMarker = nil end if isElement(blip) then destroyElement(blip) blip = nil end outputChatBox ( "event disabled", thePlayer ) else theMarker = createMarker ( px + 2, py + 2, pz - 1, "cylinder", 1.5, 255, 255, 0, 170 ) blip = createBlipAttachedTo ( theMarker, 49, 1 ) dim = getElementDimension ( thePlayer ) int = getElementInterior(thePlayer) setElementDimension ( theMarker, dim ) setElementInterior ( theMarker, int) outputChatBox ( "#00FF00An event has just been created use #FF0000/eventwarp #00FF00now!", getRootElement(), 255, 255, 255, true ) addCommandHandler( "eventwarp", function(playerSource) if isElement(theMarker) then setElementPosition(playerSource, pz, py, py) end end ) end end end addCommandHandler ( "evento", consoleCreateMarker ) Link to comment
Felipe Viedma Posted January 31, 2013 Author Share Posted January 31, 2013 mmm .... transports me elsewhere Link to comment
DNL291 Posted February 1, 2013 Share Posted February 1, 2013 Do you want the player teleport to the marker or player who typed the command "event"? Link to comment
Felipe Viedma Posted February 1, 2013 Author Share Posted February 1, 2013 hey thanks only had a single problem but is now ready I leave here and what was missing ---- the wrong : setElementPosition(playerSource, pz, py, py) the good : setElementPosition(playerSource, px, py, pz) ------x , y ,z setElementPosition thanks Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now