Jump to content

مساعدة


RdX

Recommended Posts

Map_s = { } 
function UpMapsToTable() 
    for i,v in ipairs (getResources()) do 
        name = getResourceName(v) 
        if string.find ( name, "[DM]", 1, true ) then--على حسب القيم للماب راح يبحث عن اسم الماب الي بدايته كذا DDاذا تبي ديربي حط  
            table.insert(Map_s,name) 
        end 
    end 
end 
UpMapsToTable() 

الي عليك تستخرج كل الي بالجدول وترسله لكلينت وترفعه بالسته ,

طبعا ذا الكود سهل اذا كان ودك تطلع مابات لقيم معين ديربي او شوتر الخ ,

Link to comment

كذا راح يثبت المابات لما يشتغل المود بس لما يسوي رستارت راح تنحذف القيم من الجدول وتتثبت من جديد ,

يعني مايحتآج غير يجلب القيم الي بالجدول ويرسلها لكلينت ويرفعها بالسته .

Map_s = { } 
function UpMapsToTable() 
    for i,v in ipairs (getResources()) do 
        name = getResourceName(v) 
        if string.find ( name, "[DM]", 1, true ) then 
            table.remove(Map_s,name) 
            table.insert(Map_s,name) 
        end 
    end 
end 
UpMapsToTable() 

كذا لما يركب ماب مايحتآج يسوي رستارت للمود يستخدم الوظيفه وينرفع الماب ,

Link to comment

فنكشن جديد

getMaps ( type ) 

- type = "DM" or "DD" .... etc

Enad = { }; 
  
getMaps = function ( value ) 
    if value then 
        Enad[value] = { } 
        for i, v in ipairs ( getResources ( ) ) do 
            local resourceName = getResourceName ( v ) 
            if string.find ( string.upper ( resourceName ), "["..value.."]", 1, true ) then 
                table.insert ( Enad[value], { MapName = resourceName } ) 
            end 
        end 
        return Enad[value] 
    end 
end 

Ex.:

addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        local Maps = getMaps ( "DM" ) 
        if #Maps > 0 then 
            for i = 1, #Maps do 
                if Maps [ i ] then 
                    outputChatBox ( Maps [ i ].MapName, root, 255, 255, 0, true ) 
                end 
            end 
        else 
            outputChatBox ( "* There are no maps", root, 255, 0, 0, true ) 
        end 
    end 
) 

Link to comment

صعبتوها و هي سهله كذاا

function getRaceMaps() 
    local maps = {} 
    for _,res in ipairs(getResources()) do 
        if getResourceInfo(res,"type") == "map" then 
            if getResourceInfo(res,"gamemodes") == "race" then 
                table.insert(maps,getResourceInfo(res,"name")) 
            end 
        end 
    end 
    return maps 
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...