Amine#TN Posted April 20, 2017 Share Posted April 20, 2017 i have that jail systeme function autoJail () if getElementData( source,"bag") and getElementData( source,"bag") == true then cancelEvent() else theWL = getPlayerWantedLevel ( source ) if (theWL == 6 ) then if isPedInVehicle ( source ) then removePedFromVehicle ( source ) end setTimer ( toggleControl, (1000*11), 1, source, 'fire', false) setElementPosition ( source, -2174,1861,0.6, true) theName = getPlayerName ( source ) outputChatBox ( ""..theName.. " #FF0000Was Jailed For #00FF001 Min. #FF0000by the #00FF00Server#FF0000[Reason]~>#00FF006******", root,255,255,255,true ) setTimer ( setElementPosition, (1000*60*2), 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) setTimer ( outputChatBox, (1000*60*2), 1, ""..theName.. " #00FF00Finished his Jail Sentence; Is Released !", root,255,255,255,true ) setTimer ( setElementInterior, (1000*60*2), 1, source, 0) setTimer ( setElementDimension, (1000*60*2), 1, source, 0) setTimer ( fadeCamera, (1000*59*2), 1, source, false) setTimer ( fadeCamera, (1000*60*2), 1, source, true) setTimer ( toggleControl, (1000*60*2), 1, source, 'fire', true) setPedAnimation ( source, false) setPlayerWantedLevel (source, 0) end end end addEventHandler ("onElementDataChange", getRootElement(), autoJail) but that script have a warning Bad argument @ 'getPlayerWantedLevel'[Expected player at argument 1, got ped] sorry about posting here but i did not find the solution Link to comment
undefined Posted April 20, 2017 Share Posted April 20, 2017 function autoJail () if type(source) ~= "player" then return end if getElementData( source,"bag") and ... Link to comment
Amine#TN Posted April 20, 2017 Author Share Posted April 20, 2017 Bad argument @ 'getPlayerWantedLevel'[Expected element at argument 1, got boolean] this warning and it is not working now Link to comment
Amine#TN Posted April 20, 2017 Author Share Posted April 20, 2017 function autoJail () if type(source) ~= "player" then return end if getElementData( source,"bag") and getElementData( source,"bag") == true then cancelEvent() else theWL = getPlayerWantedLevel ( source ) if (theWL == 6 ) then if isPedInVehicle ( source ) then removePedFromVehicle ( source ) end setTimer ( toggleControl, (1000*11), 1, source, 'fire', false) setElementPosition ( source, -2174,1861,0.6, true) theName = getPlayerName ( source ) outputChatBox ( ""..theName.. " #FF0000Was Jailed For #00FF001 Min. #FF0000by the #00FF00Server#FF0000[Reason]~>#00FF006******", root,255,255,255,true ) setTimer ( setElementPosition, (1000*60*2), 1, source, 1544.4332275391, - 1674.7698974609, 13.688399200439) setTimer ( outputChatBox, (1000*60*2), 1, ""..theName.. " #00FF00Finished his Jail Sentence; Is Released !", root,255,255,255,true ) setTimer ( setElementInterior, (1000*60*2), 1, source, 0) setTimer ( setElementDimension, (1000*60*2), 1, source, 0) setTimer ( fadeCamera, (1000*59*2), 1, source, false) setTimer ( fadeCamera, (1000*60*2), 1, source, true) setTimer ( toggleControl, (1000*60*2), 1, source, 'fire', true) setPedAnimation ( source, false) setPlayerWantedLevel (source, 0) end end end addEventHandler ("onElementDataChange", getRootElement(), autoJail) Link to comment
undefined Posted April 20, 2017 Share Posted April 20, 2017 Sorry, change type to getElementType Link to comment
NeXuS™ Posted April 20, 2017 Share Posted April 20, 2017 function autoJail () if getElementData( source,"bag") and getElementData( source,"bag") == true then cancelEvent() elseif getElementType(source) == "player" then theWL = getPlayerWantedLevel ( source ) if (theWL == 6 ) then if isPedInVehicle ( source ) then removePedFromVehicle ( source ) end setTimer ( toggleControl, (1000*11), 1, source, 'fire', false) setElementPosition ( source, -2174,1861,0.6, true) theName = getPlayerName ( source ) outputChatBox ( ""..theName.. " #FF0000Was Jailed For #00FF001 Min. #FF0000by the #00FF00Server#FF0000[Reason]~>#00FF006******", root,255,255,255,true ) setTimer ( setElementPosition, (1000*60*2), 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) setTimer ( outputChatBox, (1000*60*2), 1, ""..theName.. " #00FF00Finished his Jail Sentence; Is Released !", root,255,255,255,true ) setTimer ( setElementInterior, (1000*60*2), 1, source, 0) setTimer ( setElementDimension, (1000*60*2), 1, source, 0) setTimer ( fadeCamera, (1000*59*2), 1, source, false) setTimer ( fadeCamera, (1000*60*2), 1, source, true) setTimer ( toggleControl, (1000*60*2), 1, source, 'fire', true) setPedAnimation ( source, false) setPlayerWantedLevel (source, 0) end end end end addEventHandler ("onElementDataChange", getRootElement(), autoJail) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now