Jump to content

تصحيح كود


Recommended Posts

السلام عليكم يا شباب الحين الكود هذا

marker = createMarker(-3548.76904, -3007.77417, 59.8000, "cylinder", 2.5, 255, 255, 0) 
car = {} 
addEventHandler("onMarkerHit", marker, 
    function(player) 
        if getElementType(player) == "player" then 
            if isElement(car[player]) then destroyElement(car[player]) car[player] = nil end 
 local ID = math.random ( 400,499 ) 
                car[player] = createVehicle ( ID, -3549.21899, -3020.20923, 60.8000 ) 
            if car[player] then 
                warpPedIntoVehicle ( player, car[player]) 
            end  
        end 
    end 
) 
  

يعطيني سيارات عشوائيه بس انا ابيها سيارات عشوائيه يعني انا احط جدول وفي الجدول احط فيه السيارات

لأن هذا تجيني طياره حربيه وسفينه وكذا

انا مابيها ابي احط سيارات محدده في جدوله

اتمنى وضحت المعلومه :$ا

Link to comment

local ZA7FTable = { ID, ID, ID, ID, ID, ID, ID, ID, ID, ID, ID,} 
  
marker = createMarker(-3548.76904, -3007.77417, 59.8000, "cylinder", 2.5, 255, 255, 0) 
car = {} 
addEventHandler("onMarkerHit", marker, 
    function(player) 
        if getElementType(player) == "player" then 
            if isElement(car[player]) then destroyElement(car[player]) car[player] = nil end 
                    ZA7F = tonumber(ZA7F[math.random(#ZA7F)]) 
                car[player] = createVehicle ( ZA7F, -3549.21899, -3020.20923, 60.8000 ) 
            if car[player] then 
                warpPedIntoVehicle ( player, car[player]) 
            end 
        end 
    end 
) 
  
Link to comment
local ZA7FTable = { ID, ID, ID, ID, ID, ID, ID, ID, ID, ID, ID,} 
  
marker = createMarker(-3548.76904, -3007.77417, 59.8000, "cylinder", 2.5, 255, 255, 0) 
car = {} 
addEventHandler("onMarkerHit", marker, 
    function(player) 
        if getElementType(player) == "player" then 
            if isElement(car[player]) then destroyElement(car[player]) car[player] = nil end 
                    ZA7F = tonumber(ZA7F[math.random(#ZA7F)]) 
                car[player] = createVehicle ( ZA7F, -3549.21899, -3020.20923, 60.8000 ) 
            if car[player] then 
                warpPedIntoVehicle ( player, car[player]) 
            end 
        end 
    end 
) 
  

كودك خطأ

#Mr.Pres[T]ege
VehicleID = { id,id,id,id } 
local ID =  VehicleID[ math.random( #VehicleID ) ] 

مشكور يالغلا

Link to comment

طيب في مشكله انه اذا حطيت 4 سيارات تجيني سيارتين بس

VehicleID = { 560,429,402,602 } 
  
marker = createMarker(-3548.76904, -3007.77417, 59.8000, "cylinder", 2.5, 255, 255, 0) 
car = {} 
addEventHandler("onMarkerHit", marker, 
    function(player) 
        if getElementType(player) == "player" then 
            if isElement(car[player]) then destroyElement(car[player]) car[player] = nil end 
local ID =  VehicleID[ math.random( #VehicleID ) ] 
                car[player] = createVehicle ( ID, -3549.21899, -3020.20923, 60.8000 ) 
            if car[player] then 
                warpPedIntoVehicle ( player, car[player]) 
            end 
        end 
    end 
) 
  

Link to comment

by : s3d

مارك سياره و لون

مدري لو يشتغل او لا

  
local ZA7FTable = { ID, ID, ID, ID, ID, ID, ID, ID, ID, ID, ID,} 
  
Vehicles = {} 
  
VehicleM = createMarker ( -3666.1684570313, -3016.6381835938, 66.836853027344, "cylinder", 2, 255, 0, 0, 255 ) 
ColorM = createMarker ( -3660.4226074219, -3009.423828125, 65.607810974121, "cylinder", 2, 0, 255, 0, 255 ) 
  
addEventHandler( "onMarkerHit", root, 
    function ( hitElement ) 
        if source == VehicleM and getElementType( hitElement ) == "player" then 
            if Vehicles[hitElement] and getElementType( Vehicles[hitElement] ) == "vehicle" then 
                destroyElement( Vehicles[hitElement] ) 
            end 
            local x,y,z = getElementPosition(  math.random( #VehicleID )  ) 
            Vehicles[hitElement] = createVehicle ( 438, x, y, z ) 
            if Vehicles[hitElement] then 
                warpPedIntoVehicle( hitElement, Vehicles[hitElement] ) 
                outputChatBox( " لقد حصلت علي موتر لتغير لون اذهب للماركر الاخضر", hitElement, 255, 0, 0, true ) 
            end 
        elseif source == ColorM and getElementType( hitElement) == "player" and isPedInVehicle( hitElement ) then 
            local player = getPedOccupiedVehicle( hitElement ) 
            setVehicleColor( player, math.random(255), math.random(255), math.random(255) ) 
            outputChatBox( "تم تلوين موترك ", hitElement, 0, 255, 0, true ) 
        end 
    end 
) 
  
addEventHandler( "onVehicleExplode", root, 
    function( ) 
        setTimer( destroyElement, 2000, 1, source ) 
    end 
) 
  
addEventHandler( "onPlayerQuit", root, 
    function( ) 
        if Vehicles[source] then 
            destroyElement( Vehicles[source] ) 
        end 
    end 
) 

Link to comment
local ZA7FTable = { ID, ID, ID, ID, ID, ID, ID, ID, ID, ID, ID,} 
  
marker = createMarker(-3548.76904, -3007.77417, 59.8000, "cylinder", 2.5, 255, 255, 0) 
car = {} 
addEventHandler("onMarkerHit", marker, 
    function(player) 
        if getElementType(player) == "player" then 
            if isElement(car[player]) then destroyElement(car[player]) car[player] = nil end 
                    ZA7F = tonumber(ZA7F[math.random(#ZA7F)]) 
                car[player] = createVehicle ( ZA7F, -3549.21899, -3020.20923, 60.8000 ) 
            if car[player] then 
                warpPedIntoVehicle ( player, car[player]) 
            end 
        end 
    end 
) 
  

كودك خطأ

#Mr.Pres[T]ege
VehicleID = { id,id,id,id } 
local ID =  VehicleID[ math.random( #VehicleID ) ] 

مشكور يالغلا

يخوي انا اشوفه ما في اي غلط

يعني شي عشوائي وانا حاط كذا بالكود لاكن تاكد من انكـ تعرفه جانب سيرفر ومافي اي اخطاء math.random حل مشكلتكـ هو الـ .

Edited by Guest
Link to comment

انت تقول انت مجربه , طيب شوف كذا , انا سويته كذا ما اشتغل

local ZA7FTable = { 560, 561, 429, 416, 402,} 
  
marker = createMarker(-3548.76904, -3007.77417, 59.8000, "cylinder", 2.5, 255, 255, 0) 
car = {} 
addEventHandler("onMarkerHit", marker, 
    function(player) 
        if getElementType(player) == "player" then 
            if isElement(car[player]) then destroyElement(car[player]) car[player] = nil end 
                    local ID =  VehicleID[ math.random( #VehicleID ) ] 
                car[player] = createVehicle ( ID, -3549.21899, -3020.20923, 60.8000 ) 
            if car[player] then 
                warpPedIntoVehicle ( player, car[player]) 
            end 
        end 
    end 
) 

Link to comment
انت تقول انت مجربه , طيب شوف كذا , انا سويته كذا ما اشتغل
local ZA7FTable = { 560, 561, 429, 416, 402,} 
  
marker = createMarker(-3548.76904, -3007.77417, 59.8000, "cylinder", 2.5, 255, 255, 0) 
car = {} 
addEventHandler("onMarkerHit", marker, 
    function(player) 
        if getElementType(player) == "player" then 
            if isElement(car[player]) then destroyElement(car[player]) car[player] = nil end 
                    local ID =  VehicleID[ math.random( #VehicleID ) ] 
                car[player] = createVehicle ( ID, -3549.21899, -3020.20923, 60.8000 ) 
            if car[player] then 
                warpPedIntoVehicle ( player, car[player]) 
            end 
        end 
    end 
) 

خخخخخخخخخخخخخخخ

local ID =  VehicleID[ math.random( #VehicleID ) ] .....؟

يخوي تـــأكد قبل لا تتكلم ..#

#~ اسم الجدول ZA7FTable

ششــوفه # فوق ما فيه اي غلط + جربته #

Link to comment

VehicleID = { 560,429,402,602 } 
  
marker = createMarker(-3548.76904, -3007.77417, 59.8000, "cylinder", 2.5, 255, 255, 0) 
car = {} 
addEventHandler("onMarkerHit", marker, 
    function(player) 
        if getElementType(player) == "player" then 
            if isElement(car[player]) then destroyElement(car[player]) car[player] = nil end 
local ID = unpack(VehicleID[math.random(#VehicleID)])   
                car[player] = createVehicle ( ID, -3549.21899, -3020.20923, 60.8000 ) 
            if car[player] then 
                warpPedIntoVehicle ( player, car[player]) 
            end 
        end 
    end 
) 

جرب ورد لي خبر ~

Link to comment
انت تقول انت مجربه , طيب شوف كذا , انا سويته كذا ما اشتغل
local ZA7FTable = { 560, 561, 429, 416, 402,} 
  
marker = createMarker(-3548.76904, -3007.77417, 59.8000, "cylinder", 2.5, 255, 255, 0) 
car = {} 
addEventHandler("onMarkerHit", marker, 
    function(player) 
        if getElementType(player) == "player" then 
            if isElement(car[player]) then destroyElement(car[player]) car[player] = nil end 
                    local ID =  VehicleID[ math.random( #VehicleID ) ] 
                car[player] = createVehicle ( ID, -3549.21899, -3020.20923, 60.8000 ) 
            if car[player] then 
                warpPedIntoVehicle ( player, car[player]) 
            end 
        end 
    end 
) 

خخخخخخخخخخخخخخخ

local ID =  VehicleID[ math.random( #VehicleID ) ] .....؟

يخوي تـــأكد قبل لا تتكلم ..#

#~ اسم الجدول ZA7FTable

ششــوفه # فوق ما فيه اي غلط + جربته #

مشكور يالغلا :$ا

Link to comment

جرب ذا أظن راح يمنع التكرير

VehicleID = { 560,429,402,602 } 
  
marker = createMarker(-3548.76904, -3007.77417, 59.8000, "cylinder", 2.5, 255, 255, 0) 
car = {} 
lastCar = { } 
  
addEventHandler("onMarkerHit", marker, 
    function(player) 
        if getElementType(player) == "player" then 
            if isElement(car[player]) then destroyElement(car[player]) car[player] = nil end 
            local ID = VehicleID[math.random(#VehicleID)]  
            repeat until lastCar[player] ~= ID 
            car[player] = createVehicle ( ID, -3549.21899, -3020.20923, 60.8000 ) 
            if car[player] then 
                warpPedIntoVehicle ( player, car[player]) 
            end 
            lastCar[player] = ID 
        end 
    end 
) 

Link to comment
VehicleID = { 560,429,402,602 } 
  
marker = createMarker(-3548.76904, -3007.77417, 59.8000, "cylinder", 2.5, 255, 255, 0) 
car = {} 
addEventHandler("onMarkerHit", marker, 
    function(player) 
        if getElementType(player) == "player" then 
            if isElement(car[player]) then destroyElement(car[player]) car[player] = nil end 
local ID = unpack(VehicleID[math.random(#VehicleID)])   
                car[player] = createVehicle ( ID, -3549.21899, -3020.20923, 60.8000 ) 
            if car[player] then 
                warpPedIntoVehicle ( player, car[player]) 
            end 
        end 
    end 
) 

جرب ورد لي خبر ~

مشكور بس حق زاحف اشتغل ()

Link to comment
انت تقول انت مجربه , طيب شوف كذا , انا سويته كذا ما اشتغل
local ZA7FTable = { 560, 561, 429, 416, 402,} 
  
marker = createMarker(-3548.76904, -3007.77417, 59.8000, "cylinder", 2.5, 255, 255, 0) 
car = {} 
addEventHandler("onMarkerHit", marker, 
    function(player) 
        if getElementType(player) == "player" then 
            if isElement(car[player]) then destroyElement(car[player]) car[player] = nil end 
                    local ID =  VehicleID[ math.random( #VehicleID ) ] 
                car[player] = createVehicle ( ID, -3549.21899, -3020.20923, 60.8000 ) 
            if car[player] then 
                warpPedIntoVehicle ( player, car[player]) 
            end 
        end 
    end 
) 

خخخخخخخخخخخخخخخ

local ID =  VehicleID[ math.random( #VehicleID ) ] .....؟

يخوي تـــأكد قبل لا تتكلم ..#

#~ اسم الجدول ZA7FTable

ششــوفه # فوق ما فيه اي غلط + جربته #

مشكور يالغلا :$ا

العفو .. ^

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