Quited Posted June 16, 2013 Share Posted June 16, 2013 جرب function lockcar(thePlayer) playervehicle=getPlayerOccupiedVehicle(thePlayer); if(playervehicle) then if(isVehicleLocked(playervehicle)) then setVehicleLocked(playervehicle,false); outputChatBox("#006400Vehicle Unlocked",thePlayer,255,0,0); else setVehicleLocked(playervehicle,true); outputChatBox("#FF0000Vehicle Locked",thePlayer,255,0,0); end end end function exit(player,seat,jacked) if(isVehicleLocked(source)) then setVehicleLocked(source,false); outputChatBox("Vehicle Unlocked",player,255,0,0); end end bindKey ( "l", "down", lockcar ); addEventHandler("onVehicleExit",getRootElement(),exit); Link to comment
Quited Posted June 16, 2013 Author Share Posted June 16, 2013 شكرااااا جدااا جربه ممكن مايشتغل انا مو متأكد Link to comment
SaydOo Posted June 16, 2013 Share Posted June 16, 2013 (edited) function lockcar(thePlayer) playervehicle=getPlayerOccupiedVehicle(thePlayer); if(playervehicle) then if(isVehicleLocked(playervehicle)) then setVehicleLocked(playervehicle,false); outputChatBox("* Vehicle Unlocked",thePlayer,0,0,255); else setVehicleLocked(playervehicle,true); outputChatBox("* Vehicle Locked",thePlayer,255,0,0); end end end function exit(player,seat,jacked) if(isVehicleLocked(source)) then setVehicleLocked(source,false); outputChatBox("* Vehicle Unlocked",player,0,0,255); end end function bindKey("l","down",lockcar) end ) addEventHandler("onVehicleExit",getRootElement(),exit); لم يتم التجربة Edited June 16, 2013 by Guest Link to comment
Quited Posted June 16, 2013 Author Share Posted June 16, 2013 ماشتغل مااتوقع فيه اخطاء ركبه زين وتأكد انه سيرفر + تأكد من الميتا انه سيرفر وتأكد من الميتا لا يكون فيه اخطاء واسم المود لا يكون عربي او فيه مسافات وحروف غير انجليزية Link to comment
iPrestege Posted June 16, 2013 Share Posted June 16, 2013 الاكواد خطأ الكود سيرفر و الـ : bindKey : bindKey ( player thePlayer, string key, string keyState, function handlerFunction, [ var arguments, ... ] ) فـ الكود يصير كذآ : -- # Server Side ~ addEventHandler('onResourceStart',resourceRoot, function ( ) for _,v in ipairs ( getElementsByType ( 'player' ) ) do bindKey ( v,'l','down',aLockHandler ) end end ) addEventHandler('onPlayerJoin',root, function ( ) bindKey ( source,'l','down',aLockHandler ) end ) function aLockHandler ( player ) if isElement ( player ) then if getPlayerOccupiedVehicle ( player ) then if not isVehicleLocked ( getPlayerOccupiedVehicle ( player ) ) then setVehicleLocked ( getPlayerOccupiedVehicle ( player ),true ) outputChatBox ( 'Vehicle Locked',player,0,255,0 ) else setVehicleLocked ( getPlayerOccupiedVehicle ( player ),false ) outputChatBox ( 'Vehicle UnLocked',player,255,0,0 ) end else outputChatBox ( 'You Must Be With a Vehicle',player,255,0,0 ) end end end function aUnLockHandler ( ) if isVehicleLocked ( source ) then setVehicleLocked ( source,false ) end end addEventHandler('onVehicleExit',root,aUnLockHandler) .. عموما لم يتم التجربة المفترض يشتغل بـ اذن الله .. Link to comment
Quited Posted June 16, 2013 Author Share Posted June 16, 2013 الاكواد خطأ الكود سيرفر و الـ :bindKey : bindKey ( player thePlayer, string key, string keyState, function handlerFunction, [ var arguments, ... ] ) فـ الكود يصير كذآ : -- # Server Side ~ addEventHandler('onResourceStart',resourceRoot, function ( ) for _,v in ipairs ( getElementsByType ( 'player' ) ) do bindKey ( v,'l','down',aLockHandler ) end end ) addEventHandler('onPlayerJoin',root, function ( ) bindKey ( source,'l','down',aLockHandler ) end ) function aLockHandler ( player ) if isElement ( player ) then if getPlayerOccupiedVehicle ( player ) then if not isVehicleLocked ( getPlayerOccupiedVehicle ( player ) ) then setVehicleLocked ( getPlayerOccupiedVehicle ( player ),true ) outputChatBox ( 'Vehicle Locked',player,0,255,0 ) else setVehicleLocked ( getPlayerOccupiedVehicle ( player ),false ) outputChatBox ( 'Vehicle UnLocked',player,255,0,0 ) end else outputChatBox ( 'You Must Be With a Vehicle',player,255,0,0 ) end end end function aUnLockHandler ( ) if isVehicleLocked ( source ) then setVehicleLocked ( source,false ) end end addEventHandler('onVehicleExit',root,aUnLockHandler) .. عموما لم يتم التجربة المفترض يشتغل بـ اذن الله .. لقد اتى الخبير Link to comment
iPrestege Posted June 16, 2013 Share Posted June 16, 2013 شكرا برستيج لما اشوف اكوادك استريح نفسينا والله العظيم مشكلة لما اخليه مغلق كل واحد يركب مايتغلق لانة يوم ينزل اي لاعب من السيارة بدون مآينزل مع الباب بـ حدث ستارت ينفتح القفل Link to comment
Quited Posted June 16, 2013 Author Share Posted June 16, 2013 الكود اشتغل ؟ باين من كلامه من اكوادك استريح نفسينا والله العظيم فـ 99% انه اشتغل Link to comment
iPrestege Posted June 16, 2013 Share Posted June 16, 2013 function aUnLockHandler ( ) if isVehicleLocked ( source ) then setVehicleLocked ( source,false ) end end addEventHandler('onVehicleExit',root,aUnLockHandler) شل هالجزء وجرب Link to comment
Quited Posted June 16, 2013 Author Share Posted June 16, 2013 شكرا برستيج لما اشوف اكوادك استريح نفسينا والله العظيم مشكلة لما اخليه مغلق كل واحد يركب مايتغلق جرب هذا -- # Server Side ~ addEventHandler('onResourceStart',resourceRoot, function ( ) for _,v in ipairs ( getElementsByType ( 'player' ) ) do bindKey ( v,'l','down',aLockHandler ) end end ) addEventHandler('onPlayerJoin',root, function ( ) bindKey ( source,'l','down',aLockHandler ) end ) function aLockHandler ( player ) if isElement ( player ) then if getPlayerOccupiedVehicle ( player ) then if not isVehicleLocked ( getPlayerOccupiedVehicle ( player ) ) then setVehicleLocked ( getPlayerOccupiedVehicle ( player ),true ) outputChatBox ( 'Vehicle Locked',player,0,255,0 ) else setVehicleLocked ( getPlayerOccupiedVehicle ( player ),false ) outputChatBox ( 'Vehicle UnLocked',player,255,0,0 ) end else outputChatBox ( 'You Must Be With a Vehicle',player,255,0,0 ) end end end function aUnLockHandler ( ) if isVehicleLocked ( source ) then setVehicleLocked ( source,false ) end end addEventHandler('onVehicleExit',root,aUnLockHandler) addEventHandler('onVehicleEnter',root,aUnLockHandler) Link to comment
iPrestege Posted June 16, 2013 Share Posted June 16, 2013 -- # Server Side ~ addEventHandler('onResourceStart',resourceRoot, function ( ) for _,v in ipairs ( getElementsByType ( 'player' ) ) do bindKey ( v,'l','down',aLockHandler ) end end ) addEventHandler('onPlayerJoin',root, function ( ) bindKey ( source,'l','down',aLockHandler ) end ) function aLockHandler ( player ) if isElement ( player ) then if getPlayerOccupiedVehicle ( player ) then if not isVehicleLocked ( getPlayerOccupiedVehicle ( player ) ) then setVehicleLocked ( getPlayerOccupiedVehicle ( player ),true ) outputChatBox ( 'Vehicle Locked',player,0,255,0 ) else setVehicleLocked ( getPlayerOccupiedVehicle ( player ),false ) outputChatBox ( 'Vehicle UnLocked',player,255,0,0 ) end else outputChatBox ( 'You Must Be With a Vehicle',player,255,0,0 ) end 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