Jump to content

Jail System


SkiZo

Recommended Posts

function policeJob ( attacker, attackerweapon, bodypart, loss )
 if attacker and getElementType(attacker) == "player" then
        theTeam = getPlayerTeam ( attacker )
     local id = getElementModel ( attacker )
        theWL = getPlayerWantedLevel ( source )
        if (attackerweapon == 3 ) and (loss > 2 ) and (theWL > 0 and theWL < 6) then
            if  getTeamName( theTeam ) == "Police" then
        if id == 280 or id == 281 or id == 282 or id == 283 then
        setPedArmor ( source, 25 )
                setElementPosition (source, 265.8837890625, 77.138664245605, 1001, true)
        setElementInterior (source, 6)
        setElementDimension (source, 2)
        setTimer ( fadeCamera, (1000*59), 1, source, false)
        setTimer ( toggleControl, (1000*11), 1, source, 'fire', false) 
                theName = getPlayerName ( source )
                theCop = getPlayerName ( attacker )  
                outputChatBox ( ""..theName.. " #FF0000Was Jailed For #00FF001 Min. #FF0000by the #0000FFPolice "..theCop.. " #FF0000[Reason]~>#00FF00D.M", root,255,255,255,true )
                local playeraccount = getPlayerAccount ( attacker )
                givePlayerMoney (attacker, 1500)
                setTimer ( setElementPosition, (1000*60), 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439)
        setTimer ( setElementInterior, (1000*60), 1, source, 0)
        setTimer ( setElementDimension, (1000*60), 1, source, 0)  
        setTimer ( outputChatBox, (1000*60), 1, ""..theName.. " #00FF00Finished his Jail Sentence; Is Released !", root,255,255,255,true )  
        setTimer ( fadeCamera, (1000*60), 1, source, true)
        setTimer ( toggleControl, (1000*60), 1, source, 'fire', true) 
        setPedAnimation (source,false) 
                setPlayerWantedLevel (source, 0)
                end
            end
        end
    end
end
    addEventHandler ("onPlayerDamage", getRootElement(), policeJob)

I Asking if there is a solution to put time for Criminal ! 
60Sec ... Not In Chat !
Thanks :) 

And If Player Quit Save time and Resume When He Join Again :$ 
Well Timer as begin is good

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