Jump to content

[AYUDA] dxDrawText


AlvareZ_

Recommended Posts

estoy usando esto como esta en el post de Sasuke, pero no me anda me lo corriges? asi cuando me ande lo edito como quiero

Clien

addEvent("admin", true) 
addEventHandler("admin", getRootElement(), 
function() 
    addEventHandler("onClientRender", root, logueoadmin) 
    setTimer( 
        function() 
            removeEventHandler("onClientRender", root, logueoadmin) 
        end,7000,1) 
end) 
function logueoadmin() 
    dxDrawRectangle(417, 648, 461, 30, tocolor(5, 0, 5, 141), true) 
    dxDrawText( getPlayerName(localPlayer).." (Admin |Lv4|) Ha iniciado sesion", 422, 649, 845, 668, tocolor(200, 0, 0, 141), 1, "pricedown", "left", "top", false, false, true, false, false) 
end 

Server

addEventHandler("onPlayerLogin", getRootElement(), 
function (p) 
  for i,v in pairs(getElementsByType("player")) do 
     local account = getPlayerAccount ( v ) 
    
     if isObjectInACLGroup ( "user." .. getAccountName(account), aclGetGroup ( "Admin" ) )   then 
     triggerClientEvent ( "admin",getRootElement() ) 
 end 
end 
end 
) 

Link to comment

Client:

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

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

EDIT: Perdon ne confundi. Prueba asi.

Link to comment

Intenta cambiando esta linea

triggerClientEvent ( root, "admin", root, getPlayerName ( source ) )  

Por

triggerClientEvent ( source, "admin", source, getPlayerName ( source ) )  

Otra cosa. Vos queres que este mensaje se lo muestre a todos los que loguean? Porque este script esta configurado para solo los admins ue loguean.

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...