Jump to content

تصحيح كود


[DONE]*

Recommended Posts

السلام عليكم,

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

والقيمة الي اخذها يحذفها,

الكود:

local pos = { 
{-3231.86914 ,2057.94629 ,31.59201}, 
{-3320.76880 ,1991.98511 ,44.09201}, 
{-3306.86157 ,2112.84399 ,44.09201}, 
{-3351.91675 ,2121.06616 ,44.09201}, 
{-3368.96924 ,2027.43518 ,31.59201}, 
{-3396.28687 ,2063.67407 ,31.59201}, 
{-3368.41772 ,2091.98657 ,31.59201}, 
{-3325.93262 ,2041.21875 ,31.59201}, 
{-3307.50342 ,2062.55981 ,31.59201}, 
{-3353.47192 ,2079.40942 ,31.59201}, 
{-3294.45288 ,2076.11523 ,31.59201}, 
{-3280.50366 ,2058.91284 ,31.59201}, 
{-3230.68555 ,2097.99634 ,31.59201}, 
{-3430.72168 ,2099.43921 ,44.09201}, 
{-3435.64160 ,2045.14905 ,44.09201}, 
{-3411.35474 ,2017.30530 ,44.09201}, 
{-3400.87427 ,2065.05591 ,44.30000}, 
{-3384.66821 ,2101.92114 ,44.09201}, 
{-3327.31348 ,2064.28345 ,44.30000} 
} 
  
entermark = createMarker (1100.60962 ,1597.18494 ,12.54688+1,"arrow",1.6,255,255,0) 
  
function cRStest() 
if source == entermark then 
    for v,_ in ipairs (#pos) do 
    local rund = pos[math.random ( #pos )] 
    setElementPosition (localPlayer,rund) 
    table.remove(pos, rund) 
    end 
    setElementDimension (localPlayer,30) 
end 
end 
addEventHandler("onClientMarkerHit", root, cRStest) 

تضبط زي كذا ؟ ولو غلط ,انتظظظر التصحيح

Link to comment
local entermark = createMarker( 1100.60962 , 1597.18494, 13.54688, "arrow", 1.6, 255, 255, 0 ) 
  
local pos = { 
    { -3231.86914 ,2057.94629 ,31.59201 }, 
    { -3320.76880 ,1991.98511 ,44.09201 }, 
    { -3306.86157 ,2112.84399 ,44.09201 }, 
    { -3351.91675 ,2121.06616 ,44.09201 }, 
    { -3368.96924 ,2027.43518 ,31.59201 }, 
    { -3396.28687 ,2063.67407 ,31.59201 }, 
    { -3368.41772 ,2091.98657 ,31.59201 }, 
    { -3325.93262 ,2041.21875 ,31.59201 }, 
    { -3307.50342 ,2062.55981 ,31.59201 }, 
    { -3353.47192 ,2079.40942 ,31.59201 }, 
    { -3294.45288 ,2076.11523 ,31.59201 }, 
    { -3280.50366 ,2058.91284 ,31.59201 }, 
    { -3230.68555 ,2097.99634 ,31.59201 }, 
    { -3430.72168 ,2099.43921 ,44.09201 }, 
    { -3435.64160 ,2045.14905 ,44.09201 }, 
    { -3411.35474 ,2017.30530 ,44.09201 }, 
    { -3400.87427 ,2065.05591 ,44.30000 }, 
    { -3384.66821 ,2101.92114 ,44.09201 }, 
    { -3327.31348 ,2064.28345 ,44.30000 } 
} 
      
addEventHandler( "onClientMarkerHit", root, 
function( hitPlayer ) 
    if ( source == entermark ) and ( hitPlayer == localPlayer ) then 
        if ( #pos > 0 ) then 
            local Random = math.random( #pos ) 
            local x, y, z = unpack( pos[Random] ) 
            setElementPosition ( hitPlayer, x, y, z ) 
            setElementDimension ( hitPlayer, 30 ) 
            table.remove( pos, Random ) 
        end 
    end 
end) 

Edited by Guest
Link to comment
local entermark = createMarker( 1100.60962 , 1597.18494, 13.54688, "arrow", 1.6, 255, 255, 0 ) 
  
local pos = { 
    {-3231.86914 ,2057.94629 ,31.59201 }, 
    {-3320.76880 ,1991.98511 ,44.09201 }, 
    {-3306.86157 ,2112.84399 ,44.09201 }, 
    {-3351.91675 ,2121.06616 ,44.09201 }, 
    {-3368.96924 ,2027.43518 ,31.59201 }, 
    {-3396.28687 ,2063.67407 ,31.59201 }, 
    {-3368.41772 ,2091.98657 ,31.59201 }, 
    {-3325.93262 ,2041.21875 ,31.59201 }, 
    {-3307.50342 ,2062.55981 ,31.59201 }, 
    {-3353.47192 ,2079.40942 ,31.59201 }, 
    {-3294.45288 ,2076.11523 ,31.59201 }, 
    {-3280.50366 ,2058.91284 ,31.59201 }, 
    {-3230.68555 ,2097.99634 ,31.59201 }, 
    {-3430.72168 ,2099.43921 ,44.09201 }, 
    {-3435.64160 ,2045.14905 ,44.09201 }, 
    {-3411.35474 ,2017.30530 ,44.09201 }, 
    {-3400.87427 ,2065.05591 ,44.30000 }, 
    {-3384.66821 ,2101.92114 ,44.09201 }, 
    {-3327.31348 ,2064.28345 ,44.30000 } 
} 
      
addEventHandler( "onClientMarkerHit", root, 
function( hitPlayer ) 
    if ( source == entermark ) and ( hitPlayer == localPlayer ) then 
        if ( #pos > 0 ) then 
            local Random = math.random( #pos ) 
            local x, y, z = unpack( pos[Random] ) 
            setElementPosition ( hitPlayer, x, y, z ) 
            setElementDimension ( hitPlayer, 30 ) 
            table.remove( pos, Random ) 
        end 
    end 
end 

قوس ناقص ذذ

Link to comment
local entermark = createMarker( 1100.60962 , 1597.18494, 13.54688, "arrow", 1.6, 255, 255, 0 ) 
  
local pos = { 
    {-3231.86914 ,2057.94629 ,31.59201 }, 
    {-3320.76880 ,1991.98511 ,44.09201 }, 
    {-3306.86157 ,2112.84399 ,44.09201 }, 
    {-3351.91675 ,2121.06616 ,44.09201 }, 
    {-3368.96924 ,2027.43518 ,31.59201 }, 
    {-3396.28687 ,2063.67407 ,31.59201 }, 
    {-3368.41772 ,2091.98657 ,31.59201 }, 
    {-3325.93262 ,2041.21875 ,31.59201 }, 
    {-3307.50342 ,2062.55981 ,31.59201 }, 
    {-3353.47192 ,2079.40942 ,31.59201 }, 
    {-3294.45288 ,2076.11523 ,31.59201 }, 
    {-3280.50366 ,2058.91284 ,31.59201 }, 
    {-3230.68555 ,2097.99634 ,31.59201 }, 
    {-3430.72168 ,2099.43921 ,44.09201 }, 
    {-3435.64160 ,2045.14905 ,44.09201 }, 
    {-3411.35474 ,2017.30530 ,44.09201 }, 
    {-3400.87427 ,2065.05591 ,44.30000 }, 
    {-3384.66821 ,2101.92114 ,44.09201 }, 
    {-3327.31348 ,2064.28345 ,44.30000 } 
} 
      
addEventHandler( "onClientMarkerHit", root, 
function( hitPlayer ) 
    if ( source == entermark ) and ( hitPlayer == localPlayer ) then 
        if ( #pos > 0 ) then 
            local Random = math.random( #pos ) 
            local x, y, z = unpack( pos[Random] ) 
            setElementPosition ( hitPlayer, x, y, z ) 
            setElementDimension ( hitPlayer, 30 ) 
            table.remove( pos, Random ) 
        end 
    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...