#STZ Posted September 24, 2016 Share Posted September 24, 2016 السلام عليكم سويت مود زر يعطي سيارة لاكن لما اضغط السيارة القديمة ما تنحذف -- Client Side addEventHandler("onClientGUIClick",root,function ( ) if source == GUIEditor.button[1] then triggerServerEvent("Acc:My:Car",localPlayer,503) end end ) --Server Side Cars = {} addEvent("Acc:My:Car",true) addEventHandler("Acc:My:Car",root,function ( ID ) if ( isElement(Cars[source]) ) then destroyElement(Cars[source]) end local x,y,z = getElementPosition(source) Cars[source] = createVehicle(ID,x,y,z) warpPlayerIntoVehicle ( source,Cars[source] ) end) Link to comment
Ahmed Eka Posted September 24, 2016 Share Posted September 24, 2016 12 hours ago, MR.NaiF-MTA said: السلام عليكم سويت مود زر يعطي سيارة لاكن لما اضغط السيارة القديمة ما تنحذف -- Client SideaddEventHandler("onClientGUIClick",root,function ( ) if source == GUIEditor.button[1] then triggerServerEvent("Acc:My:Car",localPlayer,503) end end ) --Server SideCars = {} addEvent("Acc:My:Car",true) addEventHandler("Acc:My:Car",root,function ( ID ) if ( isElement(Cars[source]) ) then destroyElement(Cars[source]) end local x,y,z = getElementPosition(source) Cars[source] = createVehicle(ID,x,y,z) warpPlayerIntoVehicle ( source,Cars[source] ) end) اخوي حوله خليه كذا if Cars[source] then destroyElement(Cars[source]) end Link to comment
` Allawi Posted September 24, 2016 Share Posted September 24, 2016 الكود سليم اللي طرحته تاكد من الكوادت الباقيه اذا كان في كودات غيره Link to comment
#STZ Posted September 24, 2016 Author Share Posted September 24, 2016 للاسف ما ظبط معي + انا ابي لما اكون انا في سيارة و اضغط الزر يعطيني السيارة الجديدة و يحذف القديمة Link to comment
iPrestege Posted September 24, 2016 Share Posted September 24, 2016 -- # Server Side Cars = { } addEvent ( "Acc:My:Car",true ) addEventHandler ( "Acc:My:Car",root, function ( ID ) local vehicle = getPedOccupiedVehicle( source ) if vehicle then destroyElement( vehicle ) end if isElement ( Cars [ source ] ) then destroyElement ( Cars [ source ] ) end local x,y,z = getElementPosition ( source ) Cars [source] = createVehicle ( ID,x,y,z ) warpPedIntoVehicle( source,Cars [source] ) end ) addEventHandler( 'onPlayerQuit',root, function ( ) if isElement ( Cars [ source ] ) then destroyElement( Cars [ source ] ) Cars [ source ] = nil 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