Sasu Posted February 21, 2013 Share Posted February 21, 2013 function adminchat(thePlayer, ...) local word = {...} local message = table.concat(word, " ") local account = getPlayerAccount ( thePlayer ) for _, group in ipairs ( { "Admin", "Moderator", "SuperModerator" } ) do if isObjectInACLGroup ( "user." .. getAccountName(account), aclGetGroup (group) ) then outputChatBox ( "#FF0000[Admin Chat]" .. getPlayerName ( thePlayer ) .. ": " .. message, getRootElement(), 255, 255, 255, true ) else exports["Evo-notificaciones"]:showBox ( thePlayer, "error", " "..getPlayerName(thePlayer).."Acceso Denegado.") end end end addCommandHandler("ga", adminchat) Hola. Bueno el error con mi script es que el admin chat se los muestra a los players y yo quiero que solo lo vean los admins. El color hex se muestra como esta y el else no funciona porque tambien se los manda a los admins. Me pueden ayudar? Link to comment
Castillo Posted February 22, 2013 Share Posted February 22, 2013 function adminchat ( thePlayer, _, ... ) local message = table.concat ( { ... }, " " ) if ( isPlayerOnGroup ( thePlayer ) ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( isPlayerOnGroup ( player ) ) then outputChatBox ( "#FF0000[Admin Chat]".. getPlayerName ( thePlayer ) ..": ".. message, player, 255, 255, 255, true ) end end else exports [ "Evo-notificaciones" ]:showBox ( thePlayer, "error", " ".. getPlayerName ( thePlayer ) .."Acceso Denegado." ) end end addCommandHandler ( "ga", adminchat ) function isPlayerOnGroup ( thePlayer ) local account = getPlayerAccount ( thePlayer ) local inGroup = false for _, group in ipairs ( { "Admin", "Moderator", "SuperModerator" } ) do if isObjectInACLGroup ( "user.".. getAccountName ( account ), aclGetGroup ( group ) ) then inGroup = true break end end return inGroup end Link to comment
Sasu Posted February 22, 2013 Author Share Posted February 22, 2013 function adminchat ( thePlayer, _, ... ) local message = table.concat ( { ... }, " " ) if ( isPlayerOnGroup ( thePlayer ) ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( isPlayerOnGroup ( player ) ) then outputChatBox ( "#FF0000[Admin Chat]".. getPlayerName ( thePlayer ) ..": ".. message, player, 255, 255, 255, true ) end end else exports [ "Evo-notificaciones" ]:showBox ( thePlayer, "error", " ".. getPlayerName ( thePlayer ) .."Acceso Denegado." ) end end addCommandHandler ( "ga", adminchat ) function isPlayerOnGroup ( thePlayer ) local account = getPlayerAccount ( thePlayer ) local inGroup = false for _, group in ipairs ( { "Admin", "Moderator", "SuperModerator" } ) do if isObjectInACLGroup ( "user.".. getAccountName ( account ), aclGetGroup ( group ) ) then inGroup = true break end end return inGroup end Despues lo pruebo porque ahora no puedo. Muchas gracias igual Solid. OFF-Topic: Muy buen feliz cumpleaños Solid. Espero que la hayas pasado bien este dia Link to comment
Recommended Posts