iMr.RAy][!][yAN Posted April 26, 2015 Share Posted April 26, 2015 السلآم عليكم ورحمةة الله وبركآتههء == Client == addEventHandler("onClientGUIClick",getRootElement(), function ( ) if ( source == Flasher ) then triggerServerEvent ( "fl", localPlayer ) end end) == Server == vehicles = {} function toggleFlashingLights ( thePlayer, key, keyState ) if getPlayerOccupiedVehicleSeat ( thePlayer ) == 0 then if vehicles[getPlayerOccupiedVehicle ( thePlayer )] then killTimer ( vehicles[getPlayerOccupiedVehicle ( thePlayer )] ) vehicles[getPlayerOccupiedVehicle ( thePlayer )] = nil else vehicles[getPlayerOccupiedVehicle ( thePlayer )] = setTimer ( toggleVehicleLights, 150, 0, getPlayerOccupiedVehicle ( thePlayer ) ) end end end addEvent( "fl", true ) addEventHandler( "fl", root, toggleFlashingLights ) function toggleVehicleLights ( car ) if ( getVehicleOverrideLights ( car ) ~= 2 ) then setVehicleOverrideLights ( car, 2 ) else setVehicleOverrideLights ( car, 1 ) end end المشكلة هي : إن الفلاشر ما يشتغل لمن أضغط ع الزر وش الحللل ؟؟؟؟ Link to comment
TAPL Posted April 26, 2015 Share Posted April 26, 2015 على اي اساس حاط ذولا انت؟ thePlayer, key, keyState Link to comment
yazan Posted April 26, 2015 Share Posted April 26, 2015 (edited) server# هذي زر كيبورد function led1(player) if isPedInVehicle(player) then local vehicle = getPedOccupiedVehicle(player) if ( vehicle ) then if isTimer ( f ) then killTimer ( f ) else f = setTimer(function() if ( getVehicleOverrideLights ( vehicle ) ~= 2 ) then setVehicleOverrideLights ( vehicle, 2 ) else setVehicleOverrideLights ( vehicle, 1 ) end end, 300,0) end end end end addEventHandler ("onResourceStart", resourceRoot, function () for _,v in ipairs (getElementsByType ("player")) do bindKey (v, "k", "down", led1) end end) زر لوحه كلنت addEventHandler("onClientGUIClick",getRootElement(), function ( ) if ( source == Flasher ) then triggerServerEvent ( "fl", localPlayer ) end end) سيرفر function led1() for _,v in ipairs (getElementsByType ("player")) do if isPedInVehicle(v) then local vehicle = getPedOccupiedVehicle(v) if ( vehicle ) then if isTimer ( f ) then killTimer ( f ) else f = setTimer(function() if ( getVehicleOverrideLights ( vehicle ) ~= 2 ) then setVehicleOverrideLights ( vehicle, 2 ) else setVehicleOverrideLights ( vehicle, 1 ) end end, 300,0) end end end end end addEvent( "fl", true ) addEventHandler( "fl", root, led1 ) Edited April 26, 2015 by Guest Link to comment
iMr.RAy][!][yAN Posted April 26, 2015 Author Share Posted April 26, 2015 server#هذي زر كيبورد function led1(player) if isPedInVehicle(player) then local vehicle = getPedOccupiedVehicle(player) if ( vehicle ) then if isTimer ( f ) then killTimer ( f ) else f = setTimer(function() if ( getVehicleOverrideLights ( vehicle ) ~= 2 ) then setVehicleOverrideLights ( vehicle, 2 ) else setVehicleOverrideLights ( vehicle, 1 ) end end, 300,0) end end end end addEventHandler ("onResourceStart", resourceRoot, function () for _,v in ipairs (getElementsByType ("player")) do bindKey (v, "k", "down", led1) end end) زر لوحه كلنت addEventHandler("onClientGUIClick",getRootElement(), function ( ) if ( source == Flasher ) then triggerServerEvent ( "fl", localPlayer ) end end) سيرفر function led1(player) for _,v in ipairs (getElementsByType ("player")) do if isPedInVehicle(player) then local vehicle = getPedOccupiedVehicle(player) if ( vehicle ) then if isTimer ( f ) then killTimer ( f ) else f = setTimer(function() if ( getVehicleOverrideLights ( vehicle ) ~= 2 ) then setVehicleOverrideLights ( vehicle, 2 ) else setVehicleOverrideLights ( vehicle, 1 ) end end, 300,0) end end end end end addEvent( "fl", true ) addEventHandler( "fl", root, led1 ) ما اشتغل ؟؟ Link to comment
iMr.RAy][!][yAN Posted April 26, 2015 Author Share Posted April 26, 2015 وش يطلع بديبوق ما طلعلي شي ؟ Link to comment
yazan Posted April 26, 2015 Share Posted April 26, 2015 انتظر بجربه عندي بنسبه لكود زر الكيبورد متاكد انه شغال 100% بس حق لوحه مو متاكد منه يمكن في غلط به Link to comment
yazan Posted April 26, 2015 Share Posted April 26, 2015 وش يطلع بديبوق ما طلعلي شي ؟ تم تعديل فوق Link to comment
iMr.RAy][!][yAN Posted April 26, 2015 Author Share Posted April 26, 2015 وش يطلع بديبوق ما طلعلي شي ؟ تم تعديل فوق شكرآآآ 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