AlvareZ_ Posted March 3, 2013 Share Posted March 3, 2013 Bueno, lo siguiente es como podría hacer que aparezca un dxDrawText por cierto tiempo cuando el jugador logee Link to comment
Sasu Posted March 3, 2013 Share Posted March 3, 2013 Haz el dx en donde quieras, publicalo, y yo te ayudo. Link to comment
Sasu Posted March 3, 2013 Share Posted March 3, 2013 Mira, yo pregunte y me ayudaron. Funciona correctamente y sin errores. viewtopic.php?f=91&t=54632&hilit=dxDrawText+onPlayerLogin Link to comment
AlvareZ_ Posted March 3, 2013 Author Share Posted March 3, 2013 Nada, Debug expected (to closed '(' at line 1 ) near 'if' Link to comment
AlvareZ_ Posted March 3, 2013 Author Share Posted March 3, 2013 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
Sasu Posted March 3, 2013 Share Posted March 3, 2013 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
Julian09123 Posted March 3, 2013 Share Posted March 3, 2013 Zorro El script que Tu le pasaste a alvarez Tiene Error Lo Probe.. Link to comment
Sasu Posted March 3, 2013 Share Posted March 3, 2013 Ademas zorro el dijo cuando el player loguee. Link to comment
AlvareZ_ Posted March 3, 2013 Author Share Posted March 3, 2013 Ya me anda como me lo paso sasuke pero se le envia a el servidor completo como para que se envie solo a la persona que logeo ? Link to comment
Sasu Posted March 3, 2013 Share Posted March 3, 2013 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
AlvareZ_ Posted March 3, 2013 Author Share Posted March 3, 2013 Mi idea es que al loggear el usuario le diga algo en la pantalla SOLO A EL, a mas nadie, pero eso podria configurarlo yo ps si quieres ayudarme bueno Link to comment
AlvareZ_ Posted March 3, 2013 Author Share Posted March 3, 2013 Solucionado, Gracias a todos! Link to comment
Recommended Posts