Turbe$Z Posted February 6, 2017 Share Posted February 6, 2017 Client.lua : LblOnlineAdmins = {} admins = "" function setAdminList(list) if (admins ~= list) then admins = list if (admins == "") then guiSetText(LblOnlineAdmins, "Admins online: none") else guiSetText(LblOnlineAdmins, "Admins online: " .. admins) end end end addEvent( "setAdminList", true ) addEventHandler( "setAdminList", getRootElement(), setAdminList ) function getAdmins() LblOnlineAdmins = guiCreateLabel(0,0.9466,0.3799,0.0247,"",true) guiLabelSetColor(LblOnlineAdmins,255,0,0) guiLabelSetVerticalAlign(LblOnlineAdmins,"top") guiLabelSetHorizontalAlign(LblOnlineAdmins,"left",true) guiSetFont(LblOnlineAdmins,"default-bold-small") end addEventHandler( "onClientResourceStart", getRootElement( ), getAdmins) Server.lua : admins = "" function processAdminList() players = getElementsByType ( "player" ) admins = "" for k,v in ipairs(players) do local accountname = "" if (isGuestAccount(getPlayerAccount(v)) == false) then accountname = getAccountName (getPlayerAccount(v)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then if (admins == "") then admins = getPlayerName(v) else admins = admins .. ", " .. getPlayerName(v) end end end end triggerClientEvent("setAdminList", getResourceRootElement(), admins) end addEventHandler( "onPlayerLogin", getRootElement(), processAdminList ) addEventHandler( "onPlayerLogout", getRootElement(), processAdminList ) addEventHandler( "onPlayerChangeNick", getRootElement(), processAdminList ) addEventHandler( "onPlayerQuit", getRootElement(), processAdminList ) addEventHandler("onPlayerJoin", getRootElement(), processAdminList) how to fix?:( 1 Link to comment
Turbe$Z Posted February 6, 2017 Author Share Posted February 6, 2017 why not show online admins, when i join? how to fix?* 1 Link to comment
nikitafloy Posted February 7, 2017 Share Posted February 7, 2017 11 hours ago, Turbo777 said: why not show online admins, when i join? how to fix?* idk, its work on my server Link to comment
Turbe$Z Posted February 7, 2017 Author Share Posted February 7, 2017 5 hours ago, nikitafloy said: idk, its work on my server working, but when i join, the online admins not show.. how to fix? 1 Link to comment
nikitafloy Posted February 7, 2017 Share Posted February 7, 2017 7 hours ago, Turbo777 said: working, but when i join, the online admins not show.. how to fix? because when u join - u not login u must login and this will work. Link to comment
Turbe$Z Posted February 7, 2017 Author Share Posted February 7, 2017 2 minutes ago, nikitafloy said: because when u join - u not login u must login and this will work. i know, but new players can not see 1 Link to comment
nikitafloy Posted February 7, 2017 Share Posted February 7, 2017 6 minutes ago, Turbo777 said: i know, but new players can not see triggerClientEvent(getResourceRootElement(), "setAdminList", getResourceRootElement(), admins) Link to comment
pa3ck Posted February 8, 2017 Share Posted February 8, 2017 12 hours ago, Turbo777 said: i know, but new players can not see Did you actually create another forum account just to like your own posts about "how to fix everything I download from community"? That's nice... 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