Jump to content

I do not know whats the problem? [HELP]


Recommended Posts

try this:

local playerMarker = createMarker(254,78,1003,"cylinder",1,255,0,0,255)
setElementDimension(playerMarker,50)
function handlePlayerMarker(hitElement)
    local elementType = getElementType(hitElement)
    outputChatBox("type /dutyonr",hitElement)
    outputChatBox("type /dutyoffr",hitElement)
end
addEventHandler("onMarkerHit",playerMarker,handlePlayerMarker)

-- local kapcsolat = exports["mysql"]:getConnection()
function Duty1(thePlayer)
    local theTeam = getPlayerTeam(thePlayer)
    if not theTeam or not getTeamName(theTeam) == "ORFK" then
        outputChatBox("error",thePlayer)
        return
    end
    setElementModel(thePlayer,266)
    outputChatBox("you are duty now",thePlayer)
    giveWeapon(thePlayer,31,200)
    giveWeapon(thePlayer,3,200)
    giveWeapon(thePlayer,22,200)
end
addCommandHandler("dutyonr",Duty1)

function Duty2(thePlayer)
    local theTeam = getPlayerTeam(thePlayer)
    if not theTeam or not getTeamName(theTeam) == "ORFK" then
        outputChatBox("error",thePlayer)
        return
    end
    setElementModel(thePlayer,1)
    takeAllWeapons(thePlayer)
    outputChatBox("you are not duty now",thePlayer)
end
addCommandHandler("dutyoffr",Duty2)

you can use /debugscript 3 for show errors and you had problem in outputChatbox and you can check what changed in this code....

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