Jump to content

طلب كود اعطاء سيارة ويكون شغال


Recommended Posts

جـرب *

# Client Side

addEventHandler("onClientGUIClick", Button, 
function () 
    triggerServerEvent("onVehicleHit", localPlayer) 
  end 
) 

# Server Side

local vehicle = {} 
  
addEvent("onVehicleHit", true) 
addEventHandler("onVehicleHit", root, 
function (player) 
    if isElement ( vehicle[source] ) then destroyElement ( vehicle[source] ) end 
    x, y, z = getElementPosition( source ) 
    vehicle[source] = createVehicle( id, x, y, z ) 
    warpPedIntoVehicle  ( player، Vehicles )  
     
  end 
) 
Edited by Guest
Link to comment
جـرب *

# Client Side

addEventHandler("onClientGUIClick", Button, 
function () 
    triggerServerEvent("onVehicleHit", localPlayer) 
  end 
) 

# Server Side

local vehicle = {} 
  
addEvent("onVehicleHit", true) 
addEventHandler("onVehicleHit", root, 
function () 
    if isElement ( vehicle[source] ) then destoryElement ( vehicle[source] ) end 
    vehicle[source] = createVehicle( id, x, y, z ) 
    warpPedIntoVehicle  ( vehicle[source]، Vehicles )  
    x, y, z = getElementPosition( Vehicles ) 
  end 
) 

سطر 6

destoryElement > destroyElement 

سطر 8 عاكس الارقمنت

warpPedIntoVehicle  ( vehicle[source]، Vehicles )  

خله كذا

warpPedIntoVehicle  ( Player , Vehicles ) 

وسطر 9 المفروض يكون فوق الكود هذا

vehicle[source] = createVehicle( id, x, y, z ) 

ويكون كذا

 x, y, z = getElementPosition(source) 

:roll:

Edited by Guest
Link to comment
جـرب *

# Client Side

addEventHandler("onClientGUIClick", Button, 
function () 
    triggerServerEvent("onVehicleHit", localPlayer) 
  end 
) 

# Server Side

local vehicle = {} 
  
addEvent("onVehicleHit", true) 
addEventHandler("onVehicleHit", root, 
function () 
    if isElement ( vehicle[source] ) then destoryElement ( vehicle[source] ) end 
    vehicle[source] = createVehicle( id, x, y, z ) 
    warpPedIntoVehicle  ( vehicle[source]، Vehicles )  
    x, y, z = getElementPosition( Vehicles ) 
  end 
) 

سطر 6

destoryElement > destroyElement 

سطر 8 عاكس الارقمنت

warpPedIntoVehicle  ( vehicle[source]، Vehicles )  

خله كذا

warpPedIntoVehicle  ( Player , Vehicles ) 

وسطر 9 المفروض يكون فوق الكود هذا

vehicle[source] = createVehicle( id, x, y, z ) 

ويكون كذا

 x, y, z = getElementPosition(source) 

:roll:

تم التعديل اسفين بس مستعجل بالكتابة

Link to comment
جـرب *

# Client Side

addEventHandler("onClientGUIClick", Button, 
function () 
    triggerServerEvent("onVehicleHit", localPlayer) 
  end 
) 

# Server Side

local vehicle = {} 
  
addEvent("onVehicleHit", true) 
addEventHandler("onVehicleHit", root, 
function (player) 
    if isElement ( vehicle[source] ) then destroyElement ( vehicle[source] ) end 
    x, y, z = getElementPosition( source ) 
    vehicle[source] = createVehicle( id, x, y, z ) 
    warpPedIntoVehicle  ( player، Vehicles )  
     
  end 
) 

سطر 5 خلي الفنكشن فاضي - 1

2 - vehicle[source] غيرها لـ Vehicles و source الي player سطر 9 ولا شي معرف بل كود غير

Link to comment

سطر 5 خلي الفنكشن فاضي - 1

2 - vehicle[source] غيرها لـ Vehicles و source الي player سطر 9 ولا شي معرف بل كود غير

قصدك اخلية كذا

   

warpPedIntoVehicle  ( Player، vehicle[source] )  

Link to comment

يـصـيـر كـذا *

# Client Side

addEventHandler("onClientGUIClick", Button, 
function () 
    triggerServerEvent("onVehicleHit", localPlayer) 
  end 
) 

# Server Side

local vehicle = {} 
  
addEvent("onVehicleHit", true) 
addEventHandler("onVehicleHit", root, 
function () 
    if isElement ( vehicle[source] ) then destroyElement ( vehicle[source] ) end 
    x, y, z = getElementPosition( source ) 
    vehicle[source] = createVehicle( id, x, y, z ) 
    warpPedIntoVehicle  ( source، vehicle[source] ) 
  end 
) 
Link to comment

هيثم حبيبي

هذا الكود الي ردته

function onjoin () 
  
setElementData(source,"CanUseTheMarkeryesorNo",tostring("Yes")) 
end 
addEventHandler("onPlayerJoin",root,onjoin) 
  
  
  
marcker1ofGive = createMarker (x,y,z, "cylinder", 4.5, 0, 0, 255, 320 ) 
  
  
  
function MarkerHit( thePlayer ) 
permission = getElementData(thePlayer,"CanUseTheMarkeryesorNo") 
if permission == "Yes" then 
if not isPedInVehicle(thePlayer) then 
        x,y,z = getElementPosition( thePlayer ) 
        infurnuis = createVehicle ( 411, x, y, z ) 
        warpPedIntoVehicle(thePlayer,infurnuis) 
setElementData(thePlayer,"CanUseTheMarkeryesorNo",tostring("No")) 
end 
end 
end 
addEventHandler( "onMarkerHit", marcker1ofGive, MarkerHit ) 
  

Link to comment
هيثم حبيبي

هذا الكود الي ردته

function onjoin () 
  
setElementData(source,"CanUseTheMarkeryesorNo",tostring("Yes")) 
end 
addEventHandler("onPlayerJoin",root,onjoin) 
  
  
  
marcker1ofGive = createMarker (x,y,z, "cylinder", 4.5, 0, 0, 255, 320 ) 
  
  
  
function MarkerHit( thePlayer ) 
permission = getElementData(thePlayer,"CanUseTheMarkeryesorNo") 
if permission == "Yes" then 
if not isPedInVehicle(thePlayer) then 
        x,y,z = getElementPosition( thePlayer ) 
        infurnuis = createVehicle ( 411, x, y, z ) 
        warpPedIntoVehicle(thePlayer,infurnuis) 
setElementData(thePlayer,"CanUseTheMarkeryesorNo",tostring("No")) 
end 
end 
end 
addEventHandler( "onMarkerHit", marcker1ofGive, MarkerHit ) 
  

الكود هذا لو تنفجر السيارة او تنحذف معد يقدر ياخذ وحدة ثانية

ولازم يطلع ويدخل اذا شغلت المود :) عشان الداتا تجيه

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