RdX Posted June 22, 2013 Share Posted June 22, 2013 السلام عليكمم شباب معي كود Color Light Disco و ابيه يشتغل بزر ما ابيه يشتغل بأمر هذا الكود local discoTimer = {} local discoState = {} function Disco(player,command) local vehicle = getPedOccupiedVehicle(player) if (vehicle) then if discoState[player] == false then discoState[player] = true discoTimer[player] = setTimer( function ( playerVehicle ) setVehicleHeadLightColor( playerVehicle, math.random(0,255), math.random(0,255), math.random(0,255) ) end , 100, 0, vehicle ) outputChatBox( "!!Disco-Fever!!", player, 0, 255, 0 ) else if discoTimer[player] then killTimer( discoTimer[player] ) discoTimer[player] = nil discoState[player] = false setVehicleHeadLightColor( vehicle, 255, 255, 255 ) end end else outputChatBox( "!!You have to sit in a Car/Bike!!", player, 255, 0, 0 ) end end addCommandHandler("disco",Disco)--Disco (((())) function setStateOnStart() for _, players in ipairs( getElementsByType( "player" ) ) do discoState[players] = false end end addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ), setStateOnStart ); function setStateOnJoin() discoState[source] = false end addEventHandler( "onPlayerJoin", getRootElement(), setStateOnJoin ) function removeStateOnQuit() discoState[source] = nil end addEventHandler( "onPlayerQuit", getRootElement(), setStateOnJoin ) Link to comment
iMr.3a[Z]eF Posted June 22, 2013 Share Posted June 22, 2013 (edited) local discoTimer = {} local discoState = {} function Disco(player,command) local vehicle = getPedOccupiedVehicle(player) if (vehicle) then if discoState[player] == false then discoState[player] = true discoTimer[player] = setTimer( function ( playerVehicle ) setVehicleHeadLightColor( playerVehicle, math.random(0,255), math.random(0,255), math.random(0,255) ) end , 100, 0, vehicle ) outputChatBox( "!!Disco-Fever!!", player, 0, 255, 0 ) else if discoTimer[player] then killTimer( discoTimer[player] ) discoTimer[player] = nil discoState[player] = false setVehicleHeadLightColor( vehicle, 255, 255, 255 ) end end else outputChatBox( "!!You have to sit in a Car/Bike!!", player, 255, 0, 0 ) end end bindKey( player, "f2", "down", Disko )-Disco ((((:)))) function setStateOnStart() for _, players in ipairs( getElementsByType( "player" ) ) do discoState[players] = false end end addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ), setStateOnStart ); function setStateOnJoin() discoState[source] = false end addEventHandler( "onPlayerJoin", getRootElement(), setStateOnJoin ) function removeStateOnQuit() discoState[source] = nil end addEventHandler( "onPlayerQuit", getRootElement(), setStateOnJoin ) بدل * f2 = الزر اللي تبيه Edited June 22, 2013 by Guest Link to comment
MSHOOSH Posted June 22, 2013 Share Posted June 22, 2013 bindKey ( player, "F1", "down", Disco ) ضيفه لكودك Link to comment
iMr.3a[Z]eF Posted June 22, 2013 Share Posted June 22, 2013 (edited) bindKey ( player, "F1", "down", Disco ) ضيفه لكودك EDIT: ليه يضيفه؟ يصير عنده بيند كي وكوماند Edited June 22, 2013 by Guest Link to comment
RdX Posted June 22, 2013 Author Share Posted June 22, 2013 شباب ما اقصد زر زر اقصد Button Link to comment
iMr.3a[Z]eF Posted June 22, 2013 Share Posted June 22, 2013 شباب ما اقصد زر زر اقصد Button طيب وين اللوحة والزر؟ Link to comment
iMr.3a[Z]eF Posted June 22, 2013 Share Posted June 22, 2013 اسم البوتنDiscoLight انت حطيت هالمود كلينت ولا سيرفر؟ Link to comment
RdX Posted June 22, 2013 Author Share Posted June 22, 2013 الزر عندي لاكن انت عدل ذا الكود ذا على بتن DiscoLight اذا تقدر + كلينت موب سيرفر Link to comment
Tete omar Posted June 22, 2013 Share Posted June 22, 2013 كاتب كلل الكود ذا .. وما تعرف كيف تخليها ب زر؟ Link to comment
iMr.3a[Z]eF Posted June 22, 2013 Share Posted June 22, 2013 (edited) local discoTimer = {} local discoState = {} addEventHandler ( "onClientGUIClick", DiscoLight, function (player,command) local vehicle = getPedOccupiedVehicle(player) if (vehicle) then if discoState[player] == false then discoState[player] = true discoTimer[player] = setTimer( function ( playerVehicle ) setVehicleHeadLightColor( playerVehicle, math.random(0,255), math.random(0,255), math.random(0,255) ) end , 100, 0, vehicle ) outputChatBox( "!!Disco-Fever!!", player, 0, 255, 0 ) else if discoTimer[player] then killTimer( discoTimer[player] ) discoTimer[player] = nil discoState[player] = false setVehicleHeadLightColor( vehicle, 255, 255, 255 ) end end else outputChatBox( "!!You have to sit in a Car/Bike!!", player, 255, 0, 0 ) end end end ) function setStateOnStart() for _, players in ipairs( getElementsByType( "player" ) ) do discoState[players] = false end end addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ), setStateOnStart ); function setStateOnJoin() discoState[source] = false end addEventHandler( "onPlayerJoin", getRootElement(), setStateOnJoin ) function removeStateOnQuit() discoState[source] = nil end addEventHandler( "onPlayerQuit", getRootElement(), setStateOnJoin ) تم التعديل تفضل الكود Edited June 22, 2013 by Guest Link to comment
R50_ Posted June 22, 2013 Share Posted June 22, 2013 (edited) fail Edited June 22, 2013 by Guest Link to comment
iMr.3a[Z]eF Posted June 22, 2013 Share Posted June 22, 2013 كاتب كلل الكود ذا .. وما تعرف كيف تخليها ب زر؟ هههه صادق, Link to comment
iMr.3a[Z]eF Posted June 22, 2013 Share Posted June 22, 2013 local discoTimer = {} local discoState = {} addEventHandler ( "onClientGUIClick", btnOutput, function (player,command) local vehicle = getPedOccupiedVehicle(player) if (vehicle) then if discoState[player] == false then discoState[player] = true discoTimer[player] = setTimer( function ( playerVehicle ) setVehicleHeadLightColor( playerVehicle, math.random(0,255), math.random(0,255), math.random(0,255) ) end , 100, 0, vehicle ) outputChatBox( "!!Disco-Fever!!", player, 0, 255, 0 ) else if discoTimer[player] then killTimer( discoTimer[player] ) discoTimer[player] = nil discoState[player] = false setVehicleHeadLightColor( vehicle, 255, 255, 255 ) end end else outputChatBox( "!!You have to sit in a Car/Bike!!", player, 255, 0, 0 ) end end end ) function setStateOnStart() for _, players in ipairs( getElementsByType( "player" ) ) do discoState[players] = false end end addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ), setStateOnStart ); function setStateOnJoin() discoState[source] = false end addEventHandler( "onPlayerJoin", getRootElement(), setStateOnJoin ) function removeStateOnQuit() discoState[source] = nil end addEventHandler( "onPlayerQuit", getRootElement(), setStateOnJoin ) R50_كله سيم سيم يا Link to comment
R50_ Posted June 22, 2013 Share Posted June 22, 2013 (edited) local discoTimer = {} local discoState = {} addEventHandler ( "onClientGUIClick", btnOutput, function (player,command) local vehicle = getPedOccupiedVehicle(player) if (vehicle) then if discoState[player] == false then discoState[player] = true discoTimer[player] = setTimer( function ( playerVehicle ) setVehicleHeadLightColor( playerVehicle, math.random(0,255), math.random(0,255), math.random(0,255) ) end , 100, 0, vehicle ) outputChatBox( "!!Disco-Fever!!", player, 0, 255, 0 ) else if discoTimer[player] then killTimer( discoTimer[player] ) discoTimer[player] = nil discoState[player] = false setVehicleHeadLightColor( vehicle, 255, 255, 255 ) end end else outputChatBox( "!!You have to sit in a Car/Bike!!", player, 255, 0, 0 ) end end end ) function setStateOnStart() for _, players in ipairs( getElementsByType( "player" ) ) do discoState[players] = false end end addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ), setStateOnStart ); function setStateOnJoin() discoState[source] = false end addEventHandler( "onPlayerJoin", getRootElement(), setStateOnJoin ) function removeStateOnQuit() discoState[source] = nil end addEventHandler( "onPlayerQuit", getRootElement(), setStateOnJoin ) R50_كله سيم سيم يا ما شفت الرد حقه معليش Edited June 22, 2013 by Guest Link to comment
iMr.3a[Z]eF Posted June 22, 2013 Share Posted June 22, 2013 local discoTimer = {} local discoState = {} addEventHandler ( "onClientGUIClick", btnOutput, function (player,command) local vehicle = getPedOccupiedVehicle(player) if (vehicle) then if discoState[player] == false then discoState[player] = true discoTimer[player] = setTimer( function ( playerVehicle ) setVehicleHeadLightColor( playerVehicle, math.random(0,255), math.random(0,255), math.random(0,255) ) end , 100, 0, vehicle ) outputChatBox( "!!Disco-Fever!!", player, 0, 255, 0 ) else if discoTimer[player] then killTimer( discoTimer[player] ) discoTimer[player] = nil discoState[player] = false setVehicleHeadLightColor( vehicle, 255, 255, 255 ) end end else outputChatBox( "!!You have to sit in a Car/Bike!!", player, 255, 0, 0 ) end end end ) function setStateOnStart() for _, players in ipairs( getElementsByType( "player" ) ) do discoState[players] = false end end addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ), setStateOnStart ); function setStateOnJoin() discoState[source] = false end addEventHandler( "onPlayerJoin", getRootElement(), setStateOnJoin ) function removeStateOnQuit() discoState[source] = nil end addEventHandler( "onPlayerQuit", getRootElement(), setStateOnJoin ) R50_كله سيم سيم يا ما شفته الرد حقه معليش عادي Link to comment
RdX Posted June 22, 2013 Author Share Posted June 22, 2013 يا اخ عازف كودك ما شتغل و كود الاخ R50 اشتغل Link to comment
iMr.3a[Z]eF Posted June 22, 2013 Share Posted June 22, 2013 توني عدلت الكود نسيت أحط أسم الزر حقك المهم الحمدلله أنه كود الأخ أشتغل Link to comment
RdX Posted June 22, 2013 Author Share Posted June 22, 2013 مشكور عازف عازف ممكن اطلب طلب ثاني 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