^#Dream Posted July 29, 2014 Posted July 29, 2014 السلام عليكم انا عندي ذا السكربت 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, 250, 0, getPlayerOccupiedVehicle ( thePlayer ) ) end end end addCommandHandler ( "ff", toggleFlashingLights ) bindKey ( "]", "down", toggleFlashingLights ) function toggleVehicleLights ( car ) if ( getVehicleOverrideLights ( car ) ~= 2 ) then setVehicleOverrideLights ( car, 2 ) else setVehicleOverrideLights ( car, 1 ) end end انا مسوي بند كي بس مازبط اضغط د مايدق فلشر الديبق مايقول شي #
Max+ Posted July 29, 2014 Posted July 29, 2014 (edited) --- serverside , vehicles = {} function toggleFlashingLights ( thePlayer) if getPedOccupiedVehicleSeat ( thePlayer ) == 0 then if vehicles[getPedOccupiedVehicleSeat( thePlayer )] then killTimer ( vehicles[getPedOccupiedVehicle ( thePlayer )] ) vehicles[getPedOccupiedVehicle( thePlayer )] = nil else vehicles[getPedOccupiedVehicle ( thePlayer )] = setTimer ( toggleVehicleLights, 250, 0, getPedOccupiedVehicle ( thePlayer ) ) end end end addCommandHandler ( "ff", toggleFlashingLights ) bindKey(source,"]","down",toggleFlashingLights) function toggleVehicleLights ( car ) if ( getVehicleOverrideLights ( car ) ~= 2 ) then setVehicleOverrideLights ( car, 2 ) else setVehicleOverrideLights ( car, 1 ) end end Edited @ Edited July 29, 2014 by Guest
TAPL Posted July 29, 2014 Posted July 29, 2014 Server - Syntax 1 bindKey ( player thePlayer, string key, string keyState, function handlerFunction, [ var arguments, ... ] )
Max+ Posted July 29, 2014 Posted July 29, 2014 Server - Syntax 1 bindKey ( player thePlayer, string key, string keyState, function handlerFunction, [ var arguments, ... ] ) تم :]
abu5lf Posted July 29, 2014 Posted July 29, 2014 مايصلح تحطه كذا thePlayer غير معرف ابحث في الاقسام انا قد سويت طريقتين ملاحظة: أرجو منك عدم وضع الكود الا بعد تجريبة
Max+ Posted July 29, 2014 Posted July 29, 2014 مايصلح تحطه كذا thePlayer غير معرف ابحث في الاقسام انا قد سويت طريقتين ملاحظة: أرجو منك عدم وضع الكود الا بعد تجريبة غيرته الى سورس هو كان مستخدم فنكشنات قديمه . . وحولتها وماشفت شي بالكود غير كذا .
TAPL Posted July 29, 2014 Posted July 29, 2014 مايصلح تحطه كذا thePlayer غير معرف ابحث في الاقسام انا قد سويت طريقتين ملاحظة: أرجو منك عدم وضع الكود الا بعد تجريبة غيرته الى سورس هو كان مستخدم فنكشنات قديمه . . وحولتها وماشفت شي بالكود غير كذا . سورس معرف وين؟ ههههههه الأفضل تجرب كودك قبل ما تطرحه
jafar Posted July 29, 2014 Posted July 29, 2014 مايصلح تحطه كذا thePlayer غير معرف ابحث في الاقسام انا قد سويت طريقتين ملاحظة: أرجو منك عدم وضع الكود الا بعد تجريبة غيرته الى سورس هو كان مستخدم فنكشنات قديمه . . وحولتها وماشفت شي بالكود غير كذا . سورس معرف وين؟ ههههههه الأفضل تجرب كودك قبل ما تطرحه المشكلة انه مسوي الكود صح هنا --- سيرفر addEventHandler("onPlayerJoin",root, function () bindKey(source,"F1","down",showGUI) end) addEventHandler("onResourceStart",resourceRoot, function () for index, player in ipairs(getElementsByType("player")) do bindKey(player,"F1","down",showGUI) end end) function showGUI(thePlayer) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)),aclGetGroup("Admin")) then triggerClientEvent(thePlayer,"toggleGUI",thePlayer) else outputChatBox("You must be an admin",thePlayer,255,0,0) end end -- كلينت wnd = guiCreateWindow(358, 338, 299, 99, "Out/on/ jobs", false) guiWindowSetSizable(wnd, false) guiSetVisible ( wnd, false ) button1 = guiCreateButton(10, 23, 118, 66, "Start Shift", false, wnd) guiSetProperty(button1, "NormalTextColour", "FF10F40A") button2 = guiCreateButton(171, 23, 118, 66, "out Shift", false, wnd) guiSetProperty(button2, "NormalTextColour", "FF10F40A") function toggleGUI() if guiGetVisible(wnd) == true then guiSetVisible(wnd,false) showCursor(false) else guiSetVisible(wnd,true) showCursor(true) end end addEvent("toggleGUI",true) addEventHandler("toggleGUI",root,toggleGUI)
AboShanab Posted August 18, 2014 Posted August 18, 2014 Max+ : vehicles = {} function toggleVehicleLights ( car ) if ( getVehicleOverrideLights ( car ) ~= 2 ) then setVehicleOverrideLights ( car, 2 ) else setVehicleOverrideLights ( car, 1 ) end end function toggleFlashingLights ( thePlayer ) if isPedInVehicle ( thePlayer ) then if getPedOccupiedVehicleSeat ( thePlayer ) == 0 then if vehicles[getPedOccupiedVehicle ( thePlayer )] then killTimer ( vehicles[getPedOccupiedVehicle ( thePlayer )] ) vehicles[getPedOccupiedVehicle( thePlayer )] = nil else vehicles[getPedOccupiedVehicle ( thePlayer )] = setTimer ( toggleVehicleLights, 250, 0, getPedOccupiedVehicle ( thePlayer ) ) end end end end addCommandHandler ( "ff", toggleFlashingLights ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _,v in ipairs ( getElementsByType ( "player" ) ) do bindKey ( v, "]", "down", toggleFlashingLights ) end end) addEventHandler ( "onPlayerJoin", root, function ( ) bindKey ( source, "]", "down", toggleFlashingLights ) end)
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