Jump to content

loggin admin


Sasu

Recommended Posts

Well, that's wrong, because it'll show the local player name, not the admin who logged.

Try this:

-- client side:

-------------------------------------------------------------------------------------------- 
--                              Scripting by Sasuke 
--                                 Client-Side 
-------------------------------------------------------------------------------------------- 
local adminName = "" 
  
addEvent ( "admin", true ) 
addEventHandler ( "admin", getRootElement(), 
    function ( name ) 
        adminName = name 
        addEventHandler ( "onClientRender", getRootElement(), logueoadmin ) 
        setTimer ( 
            function ( ) 
                removeEventHandler ( "onClientRender", getRootElement(), logueoadmin ) 
            end 
            ,7000, 1 
        ) 
    end 
) 
  
function logueoadmin ( ) 
    dxDrawRectangle(417, 648, 500, 30, tocolor(0, 0, 0, 0), true) 
    dxDrawText( adminName .." (Admin |Lv4|) Ha iniciado Sesion!", 422, 649, 845, 668, tocolor(255, 255, 255, 255), 1, "pricedown", "left", "top", false, false, true, false, false) 
end 

-- server side:

-------------------------------------------------------------------------------------------- 
--                              Scripting by Sasuke 
--                                 Server-Side 
-------------------------------------------------------------------------------------------- 
addEventHandler ( "onPlayerLogin", getRootElement(), 
    function ( _, account ) 
        if isObjectInACLGroup ( "user.".. getAccountName ( account ), aclGetGroup ( "Admin" ) ) then 
            triggerClientEvent ( root, "admin", root, getPlayerName ( source ) ) 
        end 
    end 
) 

It works. Thank you very much Solid.

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...