Jump to content

x[ مساعدة بكود ]x زر اعطاء سيارة


#STZ

Recommended Posts

السلام عليكم

سويت مود زر يعطي سيارة

لاكن لما اضغط السيارة القديمة ما تنحذف

-- 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
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
-- # 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...