Jump to content

Country Scoreboard


^#Dream

Recommended Posts

السلام عليكم

عندي مشكلة بالسكور بورد

if column.name == "country" and content ~= "?" then 
                                    local countryName = getCountryNameFromCode(content) or content 
                                    local countryString = ":admin/client/images/flags/"..content:lower()..".png" 
                                    if fileExists(countryString) then 
                                        local imageX = (dxGetFontHeight( fontscale(contentFont, scoreboardScale), contentFont )-s(4))*1.4 
                                        dxDrawImage(topX+theX+s(1), y+s(3), imageX,dxGetFontHeight( fontscale(contentFont, scoreboardScale), contentFont )-s(5),countryString,0,0,0,tocolor(255,255,255,a or 255)) 
                                        dxDrawText( countryName, topX+theX+s(6)+imageX,     y+s(1), topX+x+s(1+column.width),   y+s(11)+dxGetFontHeight( fontscale(contentFont, scoreboardScale), contentFont ),    tocolor( 0, 0, 0, a or 255 ), fontscale(contentFont, s(1)), contentFont, "left", "top", true, false, drawOverGUI ) 
                                        dxDrawText( countryName, topX+theX+s(5)+imageX,         y,      topX+x+s(column.width),     y+dxGetFontHeight( fontscale(contentFont, scoreboardScale), contentFont ),          tocolor( r or 255, g or 255, b or 255, a or 255 ), fontscale(contentFont, s(1)), contentFont, "left", "top", true, false, drawOverGUI ) 
                                    else 
                                        dxDrawText( countryName, topX+theX+s(1),    y+s(1), topX+x+s(1+column.width),   y+s(11)+dxGetFontHeight( fontscale(contentFont, scoreboardScale), contentFont ),    tocolor( 0, 0, 0, a or 255 ), fontscale(contentFont, s(1)), contentFont, "left", "top", true, false, drawOverGUI ) 
                                        dxDrawText( countryName, topX+theX,         y,      topX+x+s(column.width),     y+dxGetFontHeight( fontscale(contentFont, scoreboardScale), contentFont ),          tocolor( r or 255, g or 255, b or 255, a or 255 ), fontscale(contentFont, s(1)), contentFont, "left", "top", true, false, drawOverGUI ) 
                                    end 
                                else 
                                    dxDrawText( content, topX+theX+s(1),    y+s(1), topX+x+s(1+column.width),   y+s(11)+dxGetFontHeight( fontscale(contentFont, scoreboardScale), contentFont ),    tocolor( 0, 0, 0, a or 255 ), fontscale(contentFont, s(1)), contentFont, "left", "top", true, false, drawOverGUI ) 
                                    dxDrawText( content, topX+theX,         y,      topX+x+s(column.width),     y+dxGetFontHeight( fontscale(contentFont, scoreboardScale), contentFont ),          tocolor( r or 255, g or 255, b or 255, a or 255 ), fontscale(contentFont, s(1)), contentFont, "left", "top", true, false, drawOverGUI ) 
                                end 
                            end 
                        end 

واذا شغلت السكور بورد يقولي

[16:45:23] ERROR: scoreboard\dxscoreboard_exports.lua:295: call: failed to call 
'admin:getPlayerCountry' 

والسطر 295 من ملف اكسبورتس

function onServerIDStart() 
    for i,thePlayer in pairs(getElementsByType("player")) do 
        findIDForPlayer(thePlayer) 
        local country = call(getResourceFromName("admin"),"getPlayerCountry",source) 
        if country then 
            setElementData(source,"country",country) 
        else 
            setElementData(source,"country","?") 
        end 
    end 
end 
addEventHandler("onResourceStart",resourceRoot,onServerIDStart) 

Link to comment
function findIDForPlayer(thePlayer) 
    if thePlayer and not getElementData(thePlayer,"ID") then 
        local i = 0 
        local players = getElementsByType("player") 
        repeat  
            local foundID = false 
            i = i + 1 
            for _,player in pairs(players) do 
                if player ~= thePlayer then 
                    local playerID = tonumber(getElementData(player,"ID")) 
                    if playerID == i then 
                        foundID = true 
                        break 
                    end 
                end 
            end 
        until not foundID 
        setElementData(thePlayer,"ID",i) 
    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...