Jump to content

wanted Level marker


Recommended Posts

How can I make player who hit LSJob_in with (wanted > 5) will not warp in

        setElementPosition(player, 1727, -1640.53, 20.2) 

instead they will spawn on my desired location.

LSJob_in = createMarker(1727, -1637, 20.5, "arrow", 1, 0, 255, 0, 255) 
LSJob_out = createMarker (1727, -1637.7, 20.5, "arrow", 1, 0, 255, 0, 255) 
  
function LSJobWarp(player) 
    if (source == LSJob_in and getElementType(player) == "player") then 
        setElementPosition(player, 1727, -1640.53, 20.2) 
        setElementFrozen(player, false) 
        setTimer(setElementFrozen, 1000, 1, player, false) 
    elseif (source == LSJob_out and getElementType(player) == "player") then 
        setElementPosition(player, 1727, -1635, 20.2) 
        setTimer(setElementFrozen, 2500, 1, player, true) 
        outputChatBox("Come back again!", 0, 255, 0) 
    end 
end 
addEventHandler("onMarkerHit", root, LSJobWarp) 
  

Link to comment

Try this

local LSJob_in = createMarker(1727, -1637, 20.5, "arrow", 1, 0, 255, 0, 255) 
local LSJob_out = createMarker (1727, -1637.7, 20.5, "arrow", 1, 0, 255, 0, 255) 
  
function LSJobWarp(player) 
    if (player and isElement(player) and getElementType(player) == "player") then 
        if (source == LSJob_in) then  
            local watedLevel = getPlayerWantedLevel (player) 
            if watedLevel > 5 then return end  
            setElementPosition(player, 1727, -1640.53, 20.2) 
            setElementFrozen(player, false) 
            setTimer(setElementFrozen, 1000, 1, player, false) 
        elseif (source == LSJob_out) then 
            setElementPosition(player, 1727, -1635, 20.2) 
            setTimer(setElementFrozen, 2500, 1, player, true) 
            outputChatBox("Come back again!", 0, 255, 0) 
        end  
    end 
end 
addEventHandler("onMarkerHit", root, LSJobWarp) 

Link to comment
function LSJobWarp(player) 
    if (player and isElement(player) and getElementType(player) == "player") then 
        if (source == LSJob_in) then 
            local watedLevel = getPlayerWantedLevel (player) 
            if watedLevel > 5 then  
            outputChatBox("You have been caught escaping, you are jailed!", 255, 0, 0) return end 
            setElementPosition(player, 1727, -1640.53, 20.2) 
            setElementInterior(player, 18) 
            setTimer(setElementFrozen, 3000, 1, player, false) 
        elseif (source == LSJob_out) then 
            setElementPosition(player, 1727, -1635, 20.2) 
            setElementInterior(player,0) 
            setTimer(setElementFrozen, 3000, 1, player, false) 
            outputChatBox("Come back again!", 0, 255, 0) 
        end 
    end 
end 
addEventHandler("onMarkerHit", root, LSJobWarp) 

Why is that I added outputChatBox after wantedLevel > 5 it doesnt work

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