Jump to content

ابي كود زر لي سياره


baba

Recommended Posts

#client

addEventHandler("onClientGUIClick",root, 
function () 
if source == GUIEditor.button[1] then 
   triggerServerEvent ( "dd1", localPlayer) 
end 
end) 

#server

local VehicleID = { 560,} 
local car = { } 
  
  
addEvent( "dd1", true ) 
addEventHandler( "dd1", root, 
 function () 
   if isElement ( car [ source ] ) then destroyElement ( car [ source ] ) end 
      local ID =  VehicleID[ math.random( #VehicleID ) ] 
 local x,y,z = getElementPosition (source) 
      car [ source ] = createVehicle ( ID, x, y +2, z ) 
       if car [ source ] then 
          warpPedIntoVehicle ( source, car [ source ] ) 
      end 
   end ) 

Edited by Guest
Link to comment
#client
addEventHandler("onClientGUIClick",root, 
function () 
if source == GUIEditor.button[1] then 
   triggerServerEvent ( "dd1", localPlayer) 
end 
end) 

#server

local VehicleID = { 560,} 
local car = { } 
  
  
addEvent( "dd1", true ) 
addEventHandler( "dd1", root, 
 function () 
   if isElement ( car [ source ] ) then destroyElement ( car [ source ] ) end 
      local ID =  VehicleID[ math.random( #VehicleID ) ] 
 local x,y,z = getElementPosition (source) 
      car [ source ] = createVehicle ( ID, x, y +2, z ) 
       if car [ source ] then 
          warpPedIntoVehicle ( source, car [ source ] ) 
 local vx,vy,vz = getElementPosition (car [ source ]) 
      end 
   end ) 

ممكن توضح ملف سيرفر

Link to comment

كود يزن فيه إند ناقصة

local VehicleID = { 560,} -- أيدي السيارة 
local car = { } 
  
  
addEvent( "dd1", true ) 
addEventHandler( "dd1", root, 
 function () 
   if isElement ( car [ source ] ) then destroyElement ( car [ source ] ) end 
      local ID =  VehicleID[ math.random( #VehicleID ) ] 
 local x,y,z = getElementPosition (source) 
      car [ source ] = createVehicle ( ID, x, y +2, z ) -- صنع  السيارة 
       if car [ source ] then 
          warpPedIntoVehicle ( source, car [ source ] ) -- اول ما يضغط اللاعب الزر يدخل داخل السيارة فورااً 
 local vx,vy,vz = getElementPosition (car [ source ]) 
      end -- نهاية الفنكشن 
   end -- نهاية الإف 
end -- نهاية الإف 
) 

Link to comment
كود يزن فيه إند ناقصة
local VehicleID = { 560,} -- أيدي السيارة 
local car = { } 
  
  
addEvent( "dd1", true ) 
addEventHandler( "dd1", root, 
 function () 
   if isElement ( car [ source ] ) then destroyElement ( car [ source ] ) end 
      local ID =  VehicleID[ math.random( #VehicleID ) ] 
 local x,y,z = getElementPosition (source) 
      car [ source ] = createVehicle ( ID, x, y +2, z ) -- صنع  السيارة 
       if car [ source ] then 
          warpPedIntoVehicle ( source, car [ source ] ) -- اول ما يضغط اللاعب الزر يدخل داخل السيارة فورااً 
 local vx,vy,vz = getElementPosition (car [ source ]) 
      end -- نهاية الفنكشن 
   end -- نهاية الإف 
end -- نهاية الإف 
) 

وين الايند الناقص

 if isElement ( car [ source ] ) then destroyElement ( car [ source ] ) end <<<

Link to comment
local VehicleID = { 560,} 
local car = { } 
  
  
addEvent( "dd1", true ) 
addEventHandler( "dd1", root, 
 function () -- إند للفنكشن 
   if isElement ( car [ source ] ) then destroyElement ( car [ source ] ) end -- إند للإف 
      local ID =  VehicleID[ math.random( #VehicleID ) ] 
 local x,y,z = getElementPosition (source) 
      car [ source ] = createVehicle ( ID, x, y +2, z ) 
       if car [ source ] then -- الإند حقت هاذي وينها ؟ 
          warpPedIntoVehicle ( source, car [ source ] ) 
 local vx,vy,vz = getElementPosition (car [ source ]) 
      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...