Jump to content

DMV wont work in my server?! and handbrake bug


twitch97

Recommended Posts

DMV wont work in my server?! There are no DMV cars i dont know how do to get them up. Does anyone know the id for them or what? And the Handbreak system keeps screwing up. I do /handbreak and it says handbreak released but then i doesnt work. It only happens on civilian vehicles. Someone please help

function cmdHandbrake(sourcePlayer) 
    if isPedInVehicle ( sourcePlayer ) and (getElementData(sourcePlayer,"realinvehicle") == 1)then 
        local playerVehicle = getPedOccupiedVehicle ( sourcePlayer ) 
        if (getVehicleOccupant(playerVehicle, 0) == sourcePlayer) then 
            local handbrake = getElementData(playerVehicle, "handbrake") 
            if (handbrake == 0) then 
                if isVehicleOnGround(playerVehicle) or getVehicleType(playerVehicle) == "Boat" then 
                    exports['anticheat-system']:changeProtectedElementDataEx(playerVehicle, "handbrake", 1, false) 
                    setElementFrozen(playerVehicle, true) 
                    outputChatBox("Handbrake has been applied.", sourcePlayer) 
                else 
                    outputChatBox("You can only apply the handbrake when your vehicle is on the ground.", sourcePlayer) 
                end 
            else 
                exports['anticheat-system']:changeProtectedElementDataEx(playerVehicle, "handbrake", 0, false) 
                setElementFrozen(playerVehicle, false)  
                outputChatBox("Handbrake has been released.", sourcePlayer) 
            end 
        else 
            outputChatBox("You need to be an driver to control the handbrake...", sourcePlayer, 255, 0, 0) 
        end 
    else 
        outputChatBox("Ahum, how would you apply a handbrake without a vehicle...", sourcePlayer, 255, 0, 0) 
    end 
end 
addCommandHandler("handbrake", cmdHandbrake) 

Is there anything wrong with that 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...