Sign in to follow this  
salh

][ استفسار ][ getServerName

Recommended Posts

Posted (edited)

السلام عليكم

شباب كيف اسوي

getServerName

في الكيلت

لاني حاولت ما عرفت له

Edited by salh

Share this post


Link to post

ما عرفت لها حذفتها

Share this post


Link to post
6 minutes ago, KillerX said:

triggerServerEvent + getServerName

 

-- كيلنت
local text = "server name: " triggerServerEvent ( "ServerName", resourceRoot, name )
window = guiCreateWindow(413, 103, 544, 596, text, false)

-- سيرفر
function outputServerName ( )
	local name = getServerName( )
	name =  getServerName( )
end
addEvent( "ServerName", true )
addEventHandler( "ServerName", resourceRoot, outputServerName )

 

الوحة تشتغل و كل شي يشتغل بس اسم السيرفر ما يشتغل

+ debug ما يقول شي

Share this post


Link to post

سوي ترايقر من السيرفر للكلينت وحط فيه اسم السيرفر وبس

Share this post


Link to post
addEventHandler ( "onClientResourceStart" , resourceRoot , function ( ) 
wnd = guiCreateWindow ( 413, 103, 544, 596, "", false )
triggerServerEvent ( "getServer:Name" , localPlayer )
end )

addEvent ( "setServer:Name" , true )
addEventHandler ( "setServer:Name" , root , function ( name )
guiSetText ( wnd , tostring ( name ) ) 
end )


--- Server

addEvent ( "getServer:Name" , true )
addEventHandler ( "getServer:Name" , root , function (  )
triggerClientEvent ( source , "setServer:Name" , source , getServerName ( ) )
end ) 

 

  • Thanks 1

Share this post


Link to post
9 hours ago, Hakan said:

addEventHandler ( "onClientResourceStart" , resourceRoot , function ( ) 
wnd = guiCreateWindow ( 413, 103, 544, 596, "", false )
triggerServerEvent ( "getServer:Name" , localPlayer )
end )

addEvent ( "setServer:Name" , true )
addEventHandler ( "setServer:Name" , root , function ( name )
guiSetText ( wnd , tostring ( name ) ) 
end )


--- Server

addEvent ( "getServer:Name" , true )
addEventHandler ( "getServer:Name" , root , function (  )
triggerClientEvent ( source , "setServer:Name" , source , getServerName ( ) )
end ) 

 

اقدر احط في اليفينت حق السيرفر فاكشنين

يعني

triggerClientEvent ( source , "setServer:Players" , source , getMaxPlayers ( ) )
 
كيليت
 
addEvent ( "setServer:Name" , true )
addEventHandler ( "setServer:Name" , root , function ( name,Players )
guiSetText ( window , "Server Name: "..tostring ( name ).."Players: ".. tostring( #players ) .. "/"..tostring(Players))
end )

Share this post


Link to post

triggerServerEvent ( "getServer:Name" , localPlayer )

addEvent ( "setServer:Name" , true )
function TitleWindow( name )
guiSetText ( window , "Server Name: "..tostring ( name ).."  Players: ".. tostring( #players ) .. "/")
end
addEventHandler( "setServer:Name", root, TitleWindow ) 

--server

addEvent ( "getServer:Name" , true )
addEventHandler ( "getServer:Name" , root , function (  )
triggerClientEvent ( source , "setServer:Name" , source , getServerName ( ) )
end ) 

انا ابي اضيف في الفاكشن ذا getMaxPlayers

Share this post


Link to post
addEvent ( "getServer:Name" , true )
addEventHandler ( "getServer:Name" , root , function (  )
triggerClientEvent ( source , "setServer:Name" , source ,table.concat({getServerName( ),'Players : '..getMaxPlayers ( )},','))
end ) 
triggerServerEvent ( "getServer:Name" , localPlayer )

addEvent ( "setServer:Name" , true )
function TitleWindow( name )
guiSetText ( window , "Server Name: "..name )
end
addEventHandler( "setServer:Name", root, TitleWindow ) 

 

Share this post


Link to post

شكرا اشتغل الكود بس ممكن سؤول

function TitleWindow( name )

name

من وين عرفتها؟

Share this post


Link to post
13 minutes ago, salh said:

شكرا اشتغل الكود بس ممكن سؤول

function TitleWindow( name )

name

من وين عرفتها؟

دا متغير عادي عشان احط اسم السيرفر باللوحه اللي جلبناه من ملف السيرفر بالترايقر

  • Thanks 1

Share this post


Link to post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.