Jump to content

تصحيح كود


Recommended Posts

السلام عليكم ورحمة الله وبركاته

مساكم الله بالخير يالربع

ياشباب انا ابي احط اسم السيرفر والكود مدري فيه غلط ولا لا

  
guiSetText(ServerNam,"name server: "..getElementData(root, "ServerName")) 

addEventHandler("onResourceStart", resourceRoot, 
function() 
     setElementData(root, "ServerName", getServerName()) 
end) 

Link to comment
السلام عليكم ورحمة الله وبركاته

مساكم الله بالخير يالربع

ياشباب انا ابي احط اسم السيرفر والكود مدري فيه غلط ولا لا

  
guiSetText(ServerNam,"name server: "..getElementData(root, "ServerName")) 

addEventHandler("onResourceStart", resourceRoot, 
function() 
     setElementData(root, "ServerName", getServerName()) 
end) 

  
--- server side 
  
  
addEvent("update",true) 
addEventHandler("update",root, 
function(client) 
local name = getServerName() 
triggerClientEvent(client,"update",name) 
end) 
  

  
-- client side 
  
addEvent("update",true) 
addEventHandler("update",root, 
function(name) 
guiSetText(اسم الليبل,"Server Name: " ..tostring(name).. "") 
end) 
  

Link to comment

جرب ذا

-- Client Side 
  
addEventHandler("onClientResourceStart",resourceRoot, 
    function () 
        setTimer(guiSetText,1000,1,LabelName,"Server Name : " .. getElementData(localPlayer,"ServerName")) 
    end 
) 
  
-- Server Side 
  
addEventHandler("onResourceStart",resourceRoot, 
    function () 
        for i,v in ipairs(getElementsByType("player")) do 
            setElementData(v,"ServerName",getServerName()) 
        end 
    end 
) 
  
addEventHandler("onPlayerJoin",root, 
    function () 
        setElementData(source,"ServerName",getServerName()) 
    end 
) 
  
  

Link to comment
جرب ذا
-- Client Side 
  
addEventHandler("onClientResourceStart",resourceRoot, 
    function () 
        setTimer(guiSetText,1000,1,LabelName,"Server Name : " .. getElementData(localPlayer,"ServerName")) 
    end 
) 
  
-- Server Side 
  
addEventHandler("onResourceStart",resourceRoot, 
    function () 
        for i,v in ipairs(getElementsByType("player")) do 
            setElementData(v,"ServerName",getServerName()) 
        end 
    end 
) 
  
addEventHandler("onPlayerJoin",root, 
    function () 
        setElementData(source,"ServerName",getServerName()) 
    end 
) 
  
  

ماظبط

Link to comment

طيب جرب ذا

اذا ما اشتغل عندك خطاا

label وغير

الى اسم الابل

-- Client Side --

addEventHandler("onClientResourceStart",resourceRoot, 
    function () 
        triggerServerEvent("onGetServerName",localPlayer) 
    end 
) 
  
addEvent("onGetted",true) 
addEventHandler("onGetted",root, 
    function (name) 
        guiSetText(label,"Server Name : " .. name) 
    end 
) 

-- Server Side --

addEvent("onGetServerName",true) 
addEventHandler("onGetServerName",root, 
    function () 
        local name = getServerName() 
        triggerClientEvent(source,"onGetted",source,name) 
    end 
) 

Link to comment
جرب ذا
-- Client Side 
  
addEventHandler("onClientResourceStart",resourceRoot, 
    function () 
        setTimer(guiSetText,1000,1,LabelName,"Server Name : " .. getElementData(localPlayer,"ServerName")) 
    end 
) 
  
-- Server Side 
  
addEventHandler("onResourceStart",resourceRoot, 
    function () 
        for i,v in ipairs(getElementsByType("player")) do 
            setElementData(v,"ServerName",getServerName()) 
        end 
    end 
) 
  
addEventHandler("onPlayerJoin",root, 
    function () 
        setElementData(source,"ServerName",getServerName()) 
    end 
) 
  
  

كل مايدخل لاعب تجيب اسم السيرفر (:

Link to comment
جرب ذا
-- Client Side 
  
addEventHandler("onClientResourceStart",resourceRoot, 
    function () 
        setTimer(guiSetText,1000,1,LabelName,"Server Name : " .. getElementData(localPlayer,"ServerName")) 
    end 
) 
  
-- Server Side 
  
addEventHandler("onResourceStart",resourceRoot, 
    function () 
        for i,v in ipairs(getElementsByType("player")) do 
            setElementData(v,"ServerName",getServerName()) 
        end 
    end 
) 
  
addEventHandler("onPlayerJoin",root, 
    function () 
        setElementData(source,"ServerName",getServerName()) 
    end 
) 
  
  

كل مايدخل لاعب تجيب اسم السيرفر (:

طيب االاعب اذا دخل يسير له داتا لاسم السيرفر في مشكلة

Link to comment
-- Server Side 
addEvent ( "WhatIsTheServerName", true ) 
addEventHandler ( "WhatIsTheServerName", root, 
    function ( ) 
        ServerName = getServerName ( ) or "N/A" 
        triggerClientEvent ( source, "onGetServerName", source, ServerName ) 
    end 
) 
  

-- Client Side 
triggerServerEvent ( "WhatIsTheServerName", localPlayer ) 
  
addEvent ( "onGetServerName", true ) 
addEventHandler ( "onGetServerName", root, 
    function ( theName ) 
        if theName then 
            guiSetText ( ServerNam, "name server: ".. tostring ( theName ) ) 
        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...