Arsilex Posted March 10, 2012 Share Posted March 10, 2012 hola ize esto asta aora y quero hacer que en el dxText aparezca quen se cambia el name y quen entra y sale del sv para no llenar el chatbox de basura como esa alguen me dice que ago mal alli es que no aparece nada ._. el script esta en "server side" g_Root = getRootElement() nickdisplay = dxText:create('', 2, screenHeight - dxGetFontHeight(0.4, 'bankgothic'), false, 'bankgothic', 0.6, 'left') addEventHandler('onPlayerJoin',g_Root, function () local country = exports['admin']:getPlayerCountry(source) setElementData(source,'Country',country) outputChatBox2('#abcdef* #ffffff' .. getPlayerName(source) .. '#00FF00 Joined the game From: #abcdef(' .. tostring">tostring(country) .. ') ', getRootElement(), 171, 255, 0, true) end ) addEventHandler('onPlayerChangeNick', g_Root, function(oldNick, newNick) outputnickdisplay ('#abcdef* #ffffff' .. oldNick .. '#80FF00 is now known as #ffffff', getRootElement(), 171, 255, 0, true) end ) addEventHandler('onPlayerQuit', g_Root, function(reason) outputChatBox2('#abcdef* #ffffff' .. getPlayerName(source) .. ' #FF0000Disconnected [#abcdef' .. reason .. '#ff0000]', getRootElement(), 171, 255, 0, true) end ) Link to comment
BorderLine Posted March 10, 2012 Share Posted March 10, 2012 la funcion es DxDrawText y solo se aplica en clientside Link to comment
Arsilex Posted March 10, 2012 Author Share Posted March 10, 2012 g_Root = getRootElement() local screenWidth, screenHeight = guiGetScreenSize ( ) -- Get the screen resolution (width and height) function createText ( ) local playerX, playerY, playerZ = getElementPosition ( localPlayer ) -- Get our player's coordinates. local playerZoneName = getZoneName ( 1, 2, 3 ) -- Get name of the zone the player is in. -- Draw zone name text's shadow. dxDrawText ( playerZoneName, 44, screenHeight - 41, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 1.02, "pricedown" ) -- Draw zone name text. dxDrawText ( playerZoneName, 44, screenHeight - 43, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1, "pricedown" ) end function HandleTheRendering ( ) addEventHandler ( "onClientRender", root, createText ) -- keep the text visible with onClientRender. end addEventHandler ( "onClientResourceStart", resourceRoot, HandleTheRendering ) addEventHandler('onPlayerJoin',g_Root, function () local country = exports['admin']:getPlayerCountry(source) setElementData(source,'Country',country) outputChatBox('#abcdef* #ffffff' .. getPlayerName(source) .. '#00FF00 Joined the game From: #abcdef(' .. tostring">tostring(country) .. ') ', getRootElement(), 171, 255, 0, true) end ) addEventHandler('onPlayerChangeNick', g_Root, function(oldNick, newNick) outputcreateText ('#abcdef* #ffffff' .. oldNick .. '#80FF00 is now known as #ffffff', getRootElement(), 171, 255, 0, true) end ) addEventHandler('onPlayerQuit', g_Root, function(reason) outputChatBox('#abcdef* #ffffff' .. getPlayerName(source) .. ' #FF0000Disconnected [#abcdef' .. reason .. '#ff0000]', getRootElement(), 171, 255, 0, true) end ) Hize eso y no aparece nada ._. Link to comment
Recommended Posts