Jade Posted February 23, 2014 Share Posted February 23, 2014 function basla() zaman1 = setTimer(isik21,1000,0) zaman2 = setTimer(isik22,2000,0) zaman3 = setTimer(isik23,3000,0) zaman4 = setTimer(isik23,4000,0) end function isik() playerVehicle = getPedOccupiedVehicle ( getLocalPlayer() ) if ( playerVehicle ) then setVehicleOverrideLights ( playerVehicle, 1 ) killTimer(zaman1) killTimer(zaman2) killTimer(zaman3) killTimer(zaman4) end end debugscript; WARNING: as\C.lua:12: Bad argument @ 'killTimer' [Expected lua-timer at argument 1] WARNING: as\C.lua:13: Bad argument @ 'killTimer' [Expected lua-timer at argument 1] WARNING: as\C.lua:14: Bad argument @ 'killTimer' [Expected lua-timer at argument 1] WARNING: as\C.lua:15: Bad argument @ 'killTimer' [Expected lua-timer at argument 1] Link to comment
Jade Posted February 23, 2014 Author Share Posted February 23, 2014 buton1 = guiCreateButton(20,60,70,40,"Kırmızı",false,pencere) addEventHandler("onClientGUIClick",buton1,basla) and how press button 1 times i press x3 'function isik ()' start x3 sorry my bad english Link to comment
Moderators Citizen Posted February 23, 2014 Moderators Share Posted February 23, 2014 Like this ? function basla() setTimer(isik, 1000, 3) --will execute isik each 1000 milliseconds but only 3 times end function isik() local playerVehicle = getPedOccupiedVehicle ( getLocalPlayer() ) if ( playerVehicle ) then setVehicleOverrideLights ( playerVehicle, 1 ) end end Link to comment
Jade Posted February 24, 2014 Author Share Posted February 24, 2014 nope.my code why bad argument ? Link to comment
Moderators Citizen Posted February 24, 2014 Moderators Share Posted February 24, 2014 Two reasons: 1 - You didn't created the timers yet. 2 - They already have been killed (so you probably killing them twice). and I would suggest you to use google translate. It would probably help us to understand you better. Link to comment
Jade Posted February 24, 2014 Author Share Posted February 24, 2014 I figured out my problem and solved.Thanks dude 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