Jump to content

[Help]event


Felipe Viedma

Recommended Posts

Posted

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 :D

Posted

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 ) 
  

Please do not PM me with scripting related question nor support, use the forums instead.

Posted

Do you want the player teleport to the marker or player who typed the command "event"?

Please do not PM me with scripting related question nor support, use the forums instead.

Posted

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 :D

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...