Jump to content

Need Some Help :/


joao1234

Recommended Posts

Posted

No.. the function markerON

its to prevent the player of create more than 1 event at the same time :/ so when he type /event and another marker is created he cant create another marker..

Posted (edited)

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
Posted

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 ) 

Posted

oh i didn't know that a vehicle or object or even an marker can type the command :o

if ( getElementType(thePlayer) == "player" ) then 

Posted

Is there any way to set the limit of players that can go into a marker?

cuz i want to make the /event command have another argument /event [limitOFplayersINevent]

Posted

Create a variable, then change the value when you use the command "event" to the value you set.

Then you should have a table with all the players in the event, everytime someone joins, check if the limit has been reached.

Posted (edited)

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

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