salh Posted May 25, 2019 Share Posted May 25, 2019 (edited) السلام عليكم شباب كيف اسوي getServerName في الكيلت لاني حاولت ما عرفت له Edited May 25, 2019 by salh Link to comment
KillerX Posted May 25, 2019 Share Posted May 25, 2019 triggerServerEvent + getServerName Link to comment
salh Posted May 25, 2019 Author Share Posted May 25, 2019 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 ما يقول شي Link to comment
Abdul KariM Posted May 25, 2019 Share Posted May 25, 2019 سوي ترايقر من السيرفر للكلينت وحط فيه اسم السيرفر وبس Link to comment
Hakan Posted May 25, 2019 Share Posted May 25, 2019 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 ) 1 Link to comment
salh Posted May 25, 2019 Author Share Posted May 25, 2019 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 ) Link to comment
salh Posted May 25, 2019 Author Share Posted May 25, 2019 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 Link to comment
#\_oskar_/# Posted May 25, 2019 Share Posted May 25, 2019 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 ) Link to comment
salh Posted May 25, 2019 Author Share Posted May 25, 2019 شكرا اشتغل الكود بس ممكن سؤول function TitleWindow( name ) name من وين عرفتها؟ Link to comment
#\_oskar_/# Posted May 25, 2019 Share Posted May 25, 2019 13 minutes ago, salh said: شكرا اشتغل الكود بس ممكن سؤول function TitleWindow( name ) name من وين عرفتها؟ دا متغير عادي عشان احط اسم السيرفر باللوحه اللي جلبناه من ملف السيرفر بالترايقر 1 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now