Jump to content

-- تعديل كود # وطلب


Recommended Posts

هلا شباب :

ليه مااشتغل ذا

addEventHandler( "onPlayerWasted", getRootElement( ), 
    function() 
    if isElement(source) then 
        setTimer( nk2 = createVehicle, 2000, 1, 350, unpack(posB[math.random(1,3)]) ) 
        warpPedIntoVehicle ( source, nk2 ) 
        setElementHealth ( nk2, 350 ) 
               toggleControl ( source, "enter_exit", false ) 
               end 
    end 
)        

Edited by Guest
Link to comment
local VehicleID = { 560,540 } 
local car = { } 
  
  
addEventHandler( "onPlayerWasted", 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, z ) 
       if car [ source ] then 
          warpPedIntoVehicle ( source, car [ source ] ) 
    toggleControl ( source, "enter_exit", false ) 
      end 
end 
   end ) 

Link to comment

لو واحد مات يوديه الاماكن العشوائية

local posB = { 
    {-102.37923, 2377.39893, 231.38014}, 
    {-125.39194, 2493.71021, 231.63734}, 
    {-119.94868, 2509.49927, 231.63800}, 
    } 

local tank = createVehicle ( 432,unpack(posB[math.random(1,3)]) )  --- ينزل السيارة 
            warpPedIntoVehicle ( source, tank )---- ينقل اللاعب داخلها 
             setElementHealth ( tank, 350 )--- يغير حياة السيارة 
               toggleControl ( source, "enter_exit", false )--- يمنع الدخول والخروج فيها  

الكوود كامل __ :

local posB = { 
    {-102.37923, 2377.39893, 231.38014}, -- المكان الاول 
    {-125.39194, 2493.71021, 231.63734}, -- الثاني 
    {-119.94868, 2509.49927, 231.63800}, --  الثالث 
    } 
------------ 
             
addEventHandler("onPlayerWasted", root, 
  function() 
if isElement(source) then   
            local tank = createVehicle ( 432,unpack(posB[math.random(1,3)]) )  
            warpPedIntoVehicle ( source, tank ) 
             setElementHealth ( tank, 350 ) 
               toggleControl ( source, "enter_exit", false ) 
            end 
            end) 

ليه مااشتغل

Link to comment

local posB = { 
    {-102.37923, 2377.39893, 231.38014}, 
    {-125.39194, 2493.71021, 231.63734}, 
    {-119.94868, 2509.49927, 231.63800} 
} 
  
local veh = { } 
             
addEventHandler("onPlayerWasted", root, function() 
    if isElement (veh [source]) then  
        destroyElement (veh [source]) 
        veh [source] = nil 
    end 
        local pos = math.random(1, #posB) 
        spawnPlayer (source, posB[pos][1], posB[pos][2], posB[pos][3], 0, getElementModel (source), 0, 0) 
        veh [source] = createVehicle (432, posB[pos][1], posB[pos][2], posB[pos][3])  
        setElementHealth (veh [source], 350) 
        warpPedIntoVehicle (source, veh [source]) 
        toggleControl (source, "enter_exit", false) 
    end 
) 
  
addEventHandler ("onPlayerQuit", root, function () 
    if isElement (veh [source]) then 
        destroyElement (veh [source]) 
        veh [source] = nil 
    end 
end 
) 
Link to comment

مثال ب ال رندر و تايمر

و ثنين كلنت

local progress = guiCreateProgressBar( 0.8, 0.8, 0.1, 0.1, true) 
  
render = function() 
    if guiProgressBarGetProgress(progress) >= 100 then removeEventHandler('onClientRender',root,render) end 
        guiProgressBarSetProgress(progress,guiProgressBarGetProgress(progress)+1) 
    end 
addEventHandler('onClientRender',root,render) 

و هذه بتايمر

local progress = guiCreateProgressBar( 0.8, 0.8, 0.1, 0.1, true) 
  
t = setTimer ( function() 
    if guiProgressBarGetProgress( progress ) >= 100 then if isTimer ( t ) then killTimer ( t ) t = nil end 
        guiProgressBarSetProgress( progress, guiProgressBarGetProgress( progress ) + 1 ) 
end, 1000,0,true ) 

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