Amine#TN Posted April 14, 2017 Share Posted April 14, 2017 Hello, I Need Some Help At this Script ! Error Message : Bad argument @ 'getPlayerWantedLevel' [Expected player at argument 1, got nil ] Bad argument @ 'getElementData' [Expected element at argument 1, got nil] .. Thanks ---- Script ---- 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 setTimer ( autoJail , 1000, 0) Link to comment
Mr.Loki Posted April 14, 2017 Share Posted April 14, 2017 Source isn't defined in your function use a loop to get each player in the server with getElementsByType Link to comment
Amine#TN Posted April 14, 2017 Author Share Posted April 14, 2017 thanx for your help but the problem was in the timer that fonction need an EventHandler 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