Jump to content

Need Some Help :/


joao1234

Recommended Posts

Well i joined the two functions but now there are no errors and nothing happens :/

  
function marker ( thePlayer, commandName ) 
    if ( getElementType(thePlayer) == "player" ) then 
          local team = getPlayerTeam (thePlayer) 
      if ( team and getTeamName ( team ) == "Staff" ) then 
            local x, y, z = getElementPosition ( thePlayer ) 
            markerevento = createMarker ( x + 2, y + 2, z - 1, "cylinder", 1.5, 255, 0, 0, 170 ) 
            blip = createBlipAttachedTo ( markerevento, 49, 1 ) 
            dim = getElementDimension ( thePlayer )          
            int = getElementInterior( thePlayer )  
            setElementDimension ( markerevento, dim ) 
            setElementInterior ( markerevento, int ) 
            outputChatBox ( "#00FF00An event has just been created use #FF0000/eventwarp #00FF00now!", getRootElement(), 255, 255, 255, true ) 
        else 
            if ( markerevento ) then 
                if isElement( markerevento ) then 
                    outputChatBox ( "An event is created, you can't create another one..", thePlayer, 255, 255, 255, true ) 
                end 
            end 
        end 
    end 
end 
addCommandHandler ( "event", marker ) 
  
function markerOFF () 
    if ( markerevento ) then 
        if isElement( markerevento ) then 
            destroyElement( markerevento ) markerevento = nil 
            end 
            if isElement(blip) then  
                destroyElement(blip) blip = nil  
            end          
        outputChatBox ( "Event is closed.", thePlayer, 255, 255, 255, true ) 
    end 
end 
addCommandHandler ( "eventclose", markerOFF ) 
  

Edited by Guest
Link to comment

Try this

function marker ( thePlayer, commandName ) 
    if ( getElementType(thePlayer) == "player" ) then 
        local team = getPlayerTeam (thePlayer) 
        if ( team and getTeamName ( team ) == "Staff" ) then 
            if isElement ( markerevento ) then 
                outputChatBox ( "An event is created, you can't create another one..", thePlayer, 255, 255, 255, true ) 
            else 
                local x, y, z = getElementPosition ( thePlayer ) 
                markerevento = createMarker ( x + 2, y + 2, z - 1, "cylinder", 1.5, 255, 0, 0, 170 ) 
                blip = createBlipAttachedTo ( markerevento, 49, 1 ) 
                dim = getElementDimension ( thePlayer )         
                int = getElementInterior( thePlayer ) 
                setElementDimension ( markerevento, dim ) 
                setElementInterior ( markerevento, int ) 
                outputChatBox ( "#00FF00An event has just been created use #FF0000/eventwarp #00FF00now!", getRootElement(), 255, 255, 255, true ) 
            end 
        end 
    end 
end 
addCommandHandler ( "event", marker ) 
  
function markerOFF () 
    if ( markerevento ) then 
        if isElement( markerevento ) then 
            destroyElement( markerevento ) markerevento = nil 
            end 
            if isElement(blip) then 
                destroyElement(blip) blip = nil 
            end         
        outputChatBox ( "Event is closed.", thePlayer, 255, 255, 255, true ) 
    end 
end 
addCommandHandler ( "eventclose", markerOFF ) 

Link to comment

but how to do that variable?

its:

  
--################### 
--## Variables 
--################### 
  
local limit = tonumber(limit) 
  
--################### 
--## Event create... 
--################### 
  
function marker ( thePlayer, commandName ) 
    if ( getElementType(thePlayer) == "player" ) then 
        local team = getPlayerTeam (thePlayer) 
        if ( team and getTeamName ( team ) == "Staff" ) then 
            if isElement ( markerevento ) then 
                outputChatBox ( "An event is created, you can't create another one..", thePlayer, 255, 255, 255, true ) 
            else 
                local x, y, z = getElementPosition ( thePlayer ) 
                markerevento = createMarker ( x + 2, y + 2, z - 1, "cylinder", 1.5, 255, 0, 0, 170 ) 
                blip = createBlipAttachedTo ( markerevento, 49, 1 ) 
                dim = getElementDimension ( thePlayer )         
                int = getElementInterior( thePlayer ) 
                setElementDimension ( markerevento, dim ) 
                setElementInterior ( markerevento, int ) 
                outputChatBox ( "#00FF00An event has just been created, type /eventwarp to be warped to the event ( limit:" ..limit.. " )", getRootElement(), 255, 255, 255, true ) 
            end 
        end 
    end 
end 
addCommandHandler ( "event", marker ) 
  

Edited by Guest
Link to comment

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...