Jump to content

تصحيح كود :)


Mbtdaa

Recommended Posts

السلام عليكم

كيفكم يازقرت ! ان شاءالله طيبون

حبيت اعرف وش الغلط الي اركتبته بكتابة الكود

function Map () 
    local Map = getMapName() 
    guiSetText(GUIEditor_Label[13]," "..getMapName()) 
    if Map and Map ~= "None" then 
    end 
 end 
 addEventHandler("onClientRender", Map) 
  

ملاحظة : عدلت اخطاء واجهتني ببرنامج ام تي اي

Edited by Guest
Link to comment
  • Moderators

ججرب #

function Map () 
        local mapName = getMapName() 
        if mapName ~= "None" then 
            guiSetText(GUIEditor_Label[1],""..mapName.."" ) 
        end 
    end 
    addEventHandler("onClientRender",root, Map) 

Edited by Guest
Link to comment

ججرب #

function Map () 
    local mapName = getMapName() 
    if mapName ~= "None" then 
        guiSetText(GUIEditor_Label[1],""..mapName.."" ) 
    end 
end 
addEventHandler("onClientRender",root, Map) 

كلنت + سيرفر ؟ .. :mrgreen:

ي صاحب الموضوع تستخدم قيم الريس؟

Link to comment

كلينت

function Map() 
    local Map = getMapName() 
    triggerServerEvent('MapName', localPlayer)  
end 
 addEventHandler("onClientRender", Map) 

سيرفر

addEvent('MapName', true) 
addEventHandler('MapName', localPlayer, 
function Map() 
    guiSetText(GUIEditor_Label[13]," "..getMapName()) 
    if Map and Map ~= "None" then 
end 
Link to comment

جرب ذآ ..

Server Side :

addEventHandler ( 'onResourceStart',root, 
    function (  resource    ) 
        if getResourceInfo ( resource,'gamemodes' ) == 'race' and getResourceInfo ( resource,'type' ) == 'map' then 
            setElementData ( resourceRoot,'GetMapName',tostring ( getResourceInfo ( resource,'name' ) or 'N/A' ) ) 
        end 
    end 
) 

Client Side :

addEventHandler ( 'onClientRender',root, 
    function (      ) 
        local MapName = getElementData ( resourceRoot,'GetMapName' ) 
            if MapName and MapName ~= false then 
                guiSetText ( GUIEditor_Label[13],MapName ) 
        end 
    end 
) 

Link to comment

اعتقد عندك فنكشن يتعارض معه عموماً جرب خلي هذا كذا :

addEventHandler ( 'onClientRender',root, 
    function (      ) 
        local xxMapName = getElementData ( resourceRoot,'GetMapName' ) 
            if xxMapName and xxMapName ~= false then 
                guiSetText ( GUIEditor_Label[13],xxMapName ) 
        end 
    end 
) 

Link to comment

جربت اسوي نافذة جديده

عشان اعرف من وين الخطء

كلنت

  
GUIEditor = { 
    label = {}, 
    window = {} 
} 
GUIEditor.window[1] = guiCreateWindow(509, 214, 326, 279, "", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
  
GUIEditor.label[1] = guiCreateLabel(45, 63, 202, 91, "map", false, GUIEditor.window[1]) 
  
  
 bindKey ( "F2" , "down" , 
    function () 
        if guiGetVisible ( GUIEditor.window[1] , true ) then 
            guiSetVisible ( GUIEditor.window[1] , false ) 
            showCursor ( false ) 
        else 
            guiSetVisible ( GUIEditor.window[1] , true ) 
            showCursor ( true ) 
        end 
    end 
)      
  
addEventHandler ( 'onClientRender',root, 
    function (      ) 
        local MapName = getElementData ( resourceRoot,'GetMapName' ) 
            if MapName and MapName ~= false then 
                guiSetText ( GUIEditor_Label[1],MapName ) 
        end 
    end 
) 

سيرفر

addEventHandler ( 'onResourceStart',root, 
    function (  resource    ) 
        if getResourceInfo ( resource,'gamemodes' ) == 'race' and getResourceInfo ( resource,'type' ) == 'map' then 
            setElementData ( resourceRoot,'GetMapName',tostring ( getResourceInfo ( resource,'name' ) or 'N/A' ) ) 
        end 
    end 
) 

+

لما اشغله وافك الديبوج

مايجيني اخطاء من السكربت !

Link to comment
اعذرني المره الاولة كان في مشاكل بممود الريس نفسه وغيرته وجاتني مشاكل السكربت !

adODQ.png

لانة اللبل غير معرف !

  
GUIEditor = { 
    label = {}, 
    window = {} 
} 
GUIEditor.window[1] = guiCreateWindow(509, 214, 326, 279, "", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
  
GUIEditor.label[1] = guiCreateLabel(45, 63, 202, 91, "map", false, GUIEditor.window[1]) 
  
  
 bindKey ( "F2" , "down" , 
    function () 
        if guiGetVisible ( GUIEditor.window[1] , true ) then 
            guiSetVisible ( GUIEditor.window[1] , false ) 
            showCursor ( false ) 
        else 
            guiSetVisible ( GUIEditor.window[1] , true ) 
            showCursor ( true ) 
        end 
    end 
)     
  
addEventHandler ( 'onClientRender',root, 
    function (      ) 
        local MapName = getElementData ( resourceRoot,'GetMapName' ) 
            if MapName and MapName ~= false then 
                guiSetText ( GUIEditor.label[1],MapName ) 
        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...