Jump to content

[help]eventwarp.


Chronos

Recommended Posts

hello i need help when i start this resource,i can't use it IG i mean command doean't work.

    function event(source) 
        if (isElement(theMarker)) then 
            destroyElement(theMarker) 
            local nombre2 = getPlayerName(source) 
            outputChatBox("#FF0000[Event]#00FF00 Event is full", getRootElement(), 255, 255, 255, true) 
            removeCommandHandler("eventwarp") 
        else 
            local x,y,z = getElementPosition(source) 
            theMarker = createMarker ( x, y, z, "checkpoint", 2, 255, 255, 255, 100 ) 
            local nombre = getPlayerName(source) 
            outputChatBox("#FF0000[Event]#00FF00 A event has been created, #00FF00Use #FF0000/eventwarp #00FF00for participe!", getRootElement(), 255, 255, 255, true) 
            addCommandHandler("eventwarp", eventowarp) 
        end 
    end 
    addCommandHandler("ev", evento) 
      
    function eventowarp(thePlayer) 
        if isElement(theMarker) then 
            local x, y, z = getElementPosition(theMarker) 
            setElementPosition(thePlayer, x, y, z) 
        end 
    end 
      
    function warpToEvent (thePlayer) 
            if (not getElementData (thePlayer,"inEvent?")) then 
                    maxPlayers = maxPlayers + 1 
                    detectP () 
                    local capacity = getElementData (root,"capacity") 
                    if maxPlayers <= capacity then 
                            if (not getElementData (thePlayer,"inEvent?")) then 
                                    local xm,ym,zm = getElementPosition (markerEvent) 
                                    setElementPosition ( thePlayer, xm, ym, zm + 2.5 ) 
                                    setElementDimension ( thePlayer, tonumber(getElementData(root,"dimension"))) 
                                    setElementData (thePlayer,"inEvent?", "yes") 
                            end 
                    else 
                            outputChatBox ("The event is full", thePlayer, 255, 0, 0) 
                    end 
            end 
    end 
      
    function playersLeft (thePlayer) 
            outputChatBox("Player left to full event "..(tonumber(getElementData (root,"capacity")) - tonumber(maxPlayers)).."", thePlayer, 0, 255, 0) 
    end 
    addCommandHandler ("playersleft", playersLeft) 
      
    function cancelEvent (thePlayer) 
            if getPlayerTeam (thePlayer) == getTeamFromName ("Staff") then 
                    outputChatBox ("Event has been cancelled", getRootElement(), 255, 0, 0) 
                    destroyElement(markerEvent) 
                    local players = getElementsByType("player") 
                    for index,pie in ipairs(players) do 
                            if getElementData (pie,"inEvent?") == "yes" then 
                                    setElementPosition ( pie, 0, 0, 3 ) 
                                    setElementDimension ( pie, 0 ) 
                                    removeCommandHandler ("eventwarp", warpToEvent) 
                                    removeCommandHandler ("leaveevent", leftEvent) 
                            end 
                    end 
            end 
    end 
    addCommandHandler ("cancelevent", cancelEvent) 
      
    function cancelEvent (thePlayer) 
            if getPlayerTeam (thePlayer) == getTeamFromName ("Staff") then 
                    outputChatBox ("Event has been cancelled", getRootElement(), 255, 0, 0) 
                    destroyElement(markerEvent) 
                    local players = getElementsByType("player") 
                    for index,pie in ipairs(players) do 
                            if getElementData (pie,"inEvent?") == "yes" then 
                                    setElementPosition ( pie, 0, 0, 3 ) 
                                    setElementDimension ( pie, 0 ) 
                                    removeElementData (pie,"inEvent?") 
                                    removeCommandHandler ("eventwarp", warpToEvent) 

Link to comment
hello i need help when i start this resource,i can't use it IG i mean command doean't work.
    function event(source) 
        if (isElement(theMarker)) then 
            destroyElement(theMarker) 
            local nombre2 = getPlayerName(source) 
            outputChatBox("#FF0000[Event]#00FF00 Event is full", getRootElement(), 255, 255, 255, true) 
            removeCommandHandler("eventwarp") 
        else 
            local x,y,z = getElementPosition(source) 
            theMarker = createMarker ( x, y, z, "checkpoint", 2, 255, 255, 255, 100 ) 
            local nombre = getPlayerName(source) 
            outputChatBox("#FF0000[Event]#00FF00 A event has been created, #00FF00Use #FF0000/eventwarp #00FF00for participe!", getRootElement(), 255, 255, 255, true) 
            addCommandHandler("eventwarp", eventowarp) 
        end 
    end 
    addCommandHandler("ev", evento) 
      
    function eventowarp(thePlayer) 
        if isElement(theMarker) then 
            local x, y, z = getElementPosition(theMarker) 
            setElementPosition(thePlayer, x, y, z) 
        end 
    end 
      
    function warpToEvent (thePlayer) 
            if (not getElementData (thePlayer,"inEvent?")) then 
                    maxPlayers = maxPlayers + 1 
                    detectP () 
                    local capacity = getElementData (root,"capacity") 
                    if maxPlayers <= capacity then 
                            if (not getElementData (thePlayer,"inEvent?")) then 
                                    local xm,ym,zm = getElementPosition (markerEvent) 
                                    setElementPosition ( thePlayer, xm, ym, zm + 2.5 ) 
                                    setElementDimension ( thePlayer, tonumber(getElementData(root,"dimension"))) 
                                    setElementData (thePlayer,"inEvent?", "yes") 
                            end 
                    else 
                            outputChatBox ("The event is full", thePlayer, 255, 0, 0) 
                    end 
            end 
    end 
      
    function playersLeft (thePlayer) 
            outputChatBox("Player left to full event "..(tonumber(getElementData (root,"capacity")) - tonumber(maxPlayers)).."", thePlayer, 0, 255, 0) 
    end 
    addCommandHandler ("playersleft", playersLeft) 
      
    function cancelEvent (thePlayer) 
            if getPlayerTeam (thePlayer) == getTeamFromName ("Staff") then 
                    outputChatBox ("Event has been cancelled", getRootElement(), 255, 0, 0) 
                    destroyElement(markerEvent) 
                    local players = getElementsByType("player") 
                    for index,pie in ipairs(players) do 
                            if getElementData (pie,"inEvent?") == "yes" then 
                                    setElementPosition ( pie, 0, 0, 3 ) 
                                    setElementDimension ( pie, 0 ) 
                                    removeCommandHandler ("eventwarp", warpToEvent) 
                                    removeCommandHandler ("leaveevent", leftEvent) 
                            end 
                    end 
            end 
    end 
    addCommandHandler ("cancelevent", cancelEvent) 
      
    function cancelEvent (thePlayer) 
            if getPlayerTeam (thePlayer) == getTeamFromName ("Staff") then 
                    outputChatBox ("Event has been cancelled", getRootElement(), 255, 0, 0) 
                    destroyElement(markerEvent) 
                    local players = getElementsByType("player") 
                    for index,pie in ipairs(players) do 
                            if getElementData (pie,"inEvent?") == "yes" then 
                                    setElementPosition ( pie, 0, 0, 3 ) 
                                    setElementDimension ( pie, 0 ) 
                                    removeElementData (pie,"inEvent?") 
                                    removeCommandHandler ("eventwarp", warpToEvent) 

read carefully

Link to comment
hello i need help when i start this resource,i can't use it IG i mean command doean't work.
    function event(source) 
        if (isElement(theMarker)) then 
            destroyElement(theMarker) 
            local nombre2 = getPlayerName(source) 
            outputChatBox("#FF0000[Event]#00FF00 Event is full", getRootElement(), 255, 255, 255, true) 
            removeCommandHandler("eventwarp") 
        else 
            local x,y,z = getElementPosition(source) 
            theMarker = createMarker ( x, y, z, "checkpoint", 2, 255, 255, 255, 100 ) 
            local nombre = getPlayerName(source) 
            outputChatBox("#FF0000[Event]#00FF00 A event has been created, #00FF00Use #FF0000/eventwarp #00FF00for participe!", getRootElement(), 255, 255, 255, true) 
            addCommandHandler("eventwarp", eventowarp) 
        end 
    end 
    addCommandHandler("ev", evento) 
      
    function eventowarp(thePlayer) 
        if isElement(theMarker) then 
            local x, y, z = getElementPosition(theMarker) 
            setElementPosition(thePlayer, x, y, z) 
        end 
    end 
      
    function warpToEvent (thePlayer) 
            if (not getElementData (thePlayer,"inEvent?")) then 
                    maxPlayers = maxPlayers + 1 
                    detectP () 
                    local capacity = getElementData (root,"capacity") 
                    if maxPlayers <= capacity then 
                            if (not getElementData (thePlayer,"inEvent?")) then 
                                    local xm,ym,zm = getElementPosition (markerEvent) 
                                    setElementPosition ( thePlayer, xm, ym, zm + 2.5 ) 
                                    setElementDimension ( thePlayer, tonumber(getElementData(root,"dimension"))) 
                                    setElementData (thePlayer,"inEvent?", "yes") 
                            end 
                    else 
                            outputChatBox ("The event is full", thePlayer, 255, 0, 0) 
                    end 
            end 
    end 
      
    function playersLeft (thePlayer) 
            outputChatBox("Player left to full event "..(tonumber(getElementData (root,"capacity")) - tonumber(maxPlayers)).."", thePlayer, 0, 255, 0) 
    end 
    addCommandHandler ("playersleft", playersLeft) 
      
    function cancelEvent (thePlayer) 
            if getPlayerTeam (thePlayer) == getTeamFromName ("Staff") then 
                    outputChatBox ("Event has been cancelled", getRootElement(), 255, 0, 0) 
                    destroyElement(markerEvent) 
                    local players = getElementsByType("player") 
                    for index,pie in ipairs(players) do 
                            if getElementData (pie,"inEvent?") == "yes" then 
                                    setElementPosition ( pie, 0, 0, 3 ) 
                                    setElementDimension ( pie, 0 ) 
                                    removeCommandHandler ("eventwarp", warpToEvent) 
                                    removeCommandHandler ("leaveevent", leftEvent) 
                            end 
                    end 
            end 
    end 
    addCommandHandler ("cancelevent", cancelEvent) 
      
    function cancelEvent (thePlayer) 
            if getPlayerTeam (thePlayer) == getTeamFromName ("Staff") then 
                    outputChatBox ("Event has been cancelled", getRootElement(), 255, 0, 0) 
                    destroyElement(markerEvent) 
                    local players = getElementsByType("player") 
                    for index,pie in ipairs(players) do 
                            if getElementData (pie,"inEvent?") == "yes" then 
                                    setElementPosition ( pie, 0, 0, 3 ) 
                                    setElementDimension ( pie, 0 ) 
                                    removeElementData (pie,"inEvent?") 
                                    removeCommandHandler ("eventwarp", warpToEvent) 

read carefully

read carefully wiki for removeCommandHandler

+

his command he using with addCommandHandler it's addCommandHandler("eventwarp", ..........) ok ?

and in his Code There are no Command Name "Warp"

and wiki said :

This function removes a command handler, that is one that has been added using addCommandHandler. This function can only remove command handlers that were added by the resource that it is called in.

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