SkatCh Posted August 24, 2014 Share Posted August 24, 2014 hi guys please i need some help i'm trying to create a speed control system but i think that i have some thing wrong. just a part from my script : function speedCam( thePlayer ) local level = getPlayerWantedLevel ( thePlayer ) <--- this line local veh = getPlayerOccupiedVehicle( thePlayer ) <--- and this local fine = math.random(50,100) if (getElementSpeed(veh,"kph") > 140) and (getPlayerMoney( thePlayer ) > (fine)) then takePlayerMoney(thePlayer,fine) outputChatBox("A Speed Cam has captured you driving on "..(math.floor(getElementSpeed(veh))).."KM/H, A fine of $"..fine.." has been taken from you.(LIMIT:140KM/H)",thePlayer,255,255,255) warnings : bad argument @ 'getPlayerWantedLevel' [Expected player at argument 1, got marker] bad argument@ 'getPlayerOccupiedVehicle' [Expected ped at argument 1 , got vehicle] Link to comment
bandi94 Posted August 24, 2014 Share Posted August 24, 2014 Well it say's clear that "thePlayer" argument it's a marker / vehicle and not a Ped / Player. Post the full code , the error is in the line where you call speedCam() function. Link to comment
Et-win Posted August 24, 2014 Share Posted August 24, 2014 Change event 'onMarkerHit' to 'onPlayerMarkerHit'. Then, change all 'thePlayer''s to 'source'. 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