Joker_Mta Posted October 16, 2012 Share Posted October 16, 2012 بسم الله السلام عليكم عندي خطأ بهدا الكود bindKey ( "q" , "down" , function() local theVehicle = getPedOccupiedVehicle ( getLocalPlayer() ) if (theVehicle) then local state = getVehicleEngineState ( theVehicle ) setVehicleEngineState(theVehicle,false) else setVehicleEngineState(theVehicle,true) end end) المقصود لما شخص يضغط q تطفي السياره ولو ضغطه مره ثانيه تشتغل مشكورين ياريت تصلحونه بأقرب وقت Link to comment
|Mr|-Talal07-| Posted October 16, 2012 Share Posted October 16, 2012 جرب ذا -- Client Side -- function car() local theVehicle = getPedOccupiedVehicle (localPlayer) local state = getVehicleEngineState (theVehicle) setVehicleEngineState(theVehicle,not state) end bindKey("q","down",car) Link to comment
Joker_Mta Posted October 16, 2012 Author Share Posted October 16, 2012 جرب ذا-- Client Side -- function car() local theVehicle = getPedOccupiedVehicle (localPlayer) local state = getVehicleEngineState (theVehicle) setVehicleEngineState(theVehicle,not state) end bindKey("q","down",car) × في × مايشتغل ذا ناقله من الويكي شكلك Link to comment
abu5lf Posted October 16, 2012 Share Posted October 16, 2012 addEventHandler ( 'onResourceStart', resourceRoot, function ( ) for k, v in ipairs ( getElementsByType ( 'player' ) ) do if ( v ) then bindKey ( v, 'q', 'down', EngineState ) end end end ) addEventHandler ( 'onPlayerJoin', getRootElement( ), function ( ) bindKey ( source, 'q', 'down', EngineState ) end ) function EngineState( player ) if ( isPedInVehicle ( player ) ) then setVehicleEngineState ( getPedOccupiedVehicle ( player ), not getVehicleEngineState ( getPedOccupiedVehicle ( player ) ) ) end end getVehicleEngineState في الويكي لونها أصفر والله مدري Link to comment
Joker_Mta Posted October 16, 2012 Author Share Posted October 16, 2012 تسلم على الرد جربت سيرفر وكلينت مانفع شي لذي الدرجه الكود يعقد؟ Link to comment
abu5lf Posted October 16, 2012 Share Posted October 16, 2012 تسلم على الرد جربت سيرفر وكلينت مانفع شي لذي الدرجه الكود يعقد؟ لا بس الويكي حاطين لون الكود اصفر وكاتبين Client and Server function على فكرة كودي شغال على فكرة الكود سيرفر Link to comment
|Mr|-Talal07-| Posted October 16, 2012 Share Posted October 16, 2012 addEventHandler ( 'onResourceStart', resourceRoot, function ( ) for k, v in ipairs ( getElementsByType ( 'player' ) ) do if ( v ) then bindKey ( v, 'q', 'down', EngineState ) end end end ) addEventHandler ( 'onPlayerJoin', getRootElement( ), function ( ) bindKey ( source, 'q', 'down', EngineState ) end ) function EngineState( player ) if ( isPedInVehicle ( player ) ) then setVehicleEngineState ( getPedOccupiedVehicle ( player ), not getVehicleEngineState ( getPedOccupiedVehicle ( player ) ) ) end end getVehicleEngineState في الويكي لونها أصفر والله مدري انا سويت مثلك لاني شفت في الويكي اصفر بعدين مسحتها عشان هنا زرقا Link to comment
Joker_Mta Posted October 16, 2012 Author Share Posted October 16, 2012 على فكره الويكي غبي على فكره الكود مو شغال على فكره مجربه انا على فكره انا جربته اضغط q q q q q q q q q مايصير شي على فكره تأكد بنفسك على فكره أنتضرك Link to comment
abu5lf Posted October 16, 2012 Share Posted October 16, 2012 هههههههههع ماقلت كلامي والى انا مجرب الكود تأكد ي بطل انك حاط الكود سيرفر ثم تركب السيارة وتضغط الزر مرة وحدة وتطفي فهمت ي بطل لو ماشتغل حط meta.xml Link to comment
./BlackBird# Posted October 16, 2012 Share Posted October 16, 2012 هههههههههعماقلت كلامي والى انا مجرب الكود تأكد ي بطل انك حاط الكود سيرفر ثم تركب السيارة وتضغط الزر مرة وحدة وتطفي فهمت ي بطل لو ماشتغل حط meta.xml المود شغال انا جربته Link to comment
MR.S3D Posted October 16, 2012 Share Posted October 16, 2012 توني مسويه لك حط الكود ذا سيرفر ---------------------------------- --Server --------------------------------- function s3d() local players = getElementsByType ( "player" ) for k,p in ipairs(players) do bindKey ( p, "q", "down", Toggle ) end end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), s3d) function Join() bindKey ( source, "q", "down", Toggle ) end addEventHandler ( "onPlayerJoin", getRootElement(), Join) local state = false function Toggle(player) state = not state local car = getPedOccupiedVehicle(player) if ( car ) then if ( state ) then setVehicleEngineState(car, true) else setVehicleEngineState(car, false) end outputChatBox ( "Your Car Now "..(state and "On" or "OFF"), player,255, 255, 0,true ) end end 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