yaver123 Posted May 3, 2012 Share Posted May 3, 2012 Hola bueno hacemos este post aver si me ayudan mejor quisiera hacer un script donde , cuando uno se connecta aparesca esto * ejemplo has joined the game " que diga "ejemplo se a unido " y cuando se va diga "ejemplo abandono el server" que en vez de que aparesca en el chat que aparesca a la derecha de la pantalla Link to comment
Alexs Posted May 3, 2012 Share Posted May 3, 2012 Mmmm..... en la comunidad creo que hay uno que lo meustra en los killmessages Link to comment
yaver123 Posted May 3, 2012 Author Share Posted May 3, 2012 pero creo que no entendes por que yo ise uno pero no anda function dxDrawColorText(str, ax, ay, bx, by, color, scale, font, left, top, clip, wordbreak, postGUI) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor( tonumber( "0x"..col:sub( 1, 2 ) ), tonumber( "0x"..col:sub( 3, 4 ) ), tonumber( "0x"..col:sub( 5, 6 ) ), 255 ) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText( cap, ax, ay, ax + w, by, color, scale, font ) ax = ax + w color = tocolor( tonumber( "0x"..col:sub( 1, 2 ) ), tonumber( "0x"..col:sub( 3, 4 ) ), tonumber( "0x"..col:sub( 5, 6 ) ), 255 ) end last = e + 1 s, e, cap, col = str:find( pat, last ) end if last <= #str then cap = str:sub( last ) local w = dxGetTextWidth( cap, scale, font ) dxDrawText( cap, ax, ay, ax + w, by, color, scale, font, left, top, clip, wordbreak, postGUI ) end end local messageJoin = "" local messageQuit = "" function renderPlayerJoined ( ) dxDrawColorText("* ".. messageJoin,504.0,4.0,574.0,20.0,tocolor(200,0,0,255),0.7,"sans","left","top",false,false,false) end function renderPlayerLeft ( ) dxDrawColorText("* ".. messageQuit,503.0,16.0,573.0,32.0,tocolor(0,0,255,170),0.7,"sans","left","top",false,false,false) end addEventHandler('onClientPlayerJoin', root, function() messageJoin = getPlayerName(source) .. " #ffffffa entrado al servidor." addEventHandler ( "onClientRender", root, renderPlayerJoined ) setTimer ( function ( ) removeEventHandler ( "onClientRender", root, renderPlayerJoined ) end ,6000,1 ) end ) addEventHandler('onClientPlayerChangeNick', root, function(oldNick, newNick) outputChatBox('* ' .. oldNick .. ' #ffffffis now known as ' .. newNick, 255, 100, 100) end ) addEventHandler('onClientPlayerQuit', root, function(reason) messageQuit = getPlayerName(source) .. " #ffffffa salido del server [" .. reason .. "]" addEventHandler ( "onClientRender", root, renderPlayerLeft ) setTimer ( function ( ) removeEventHandler ( "onClientRender", root, renderPlayerLeft ) end ,6000,1 ) end ) Link to comment
Alexs Posted May 3, 2012 Share Posted May 3, 2012 Si lo vi, si ya hiciste un tema, por que lo haces de nuevo? Link to comment
yaver123 Posted May 3, 2012 Author Share Posted May 3, 2012 para que me ayuden mejor nadie me ayuda nunca nunca comentan mis post Link to comment
elmarcosmta14 Posted May 3, 2012 Share Posted May 3, 2012 -- Client Side local toDraw = "" local screenWidth, screenHeight = guiGetScreenSize ( ) addEventHandler('onClientPlayerJoin', root, function ( ) toDraw = getPlayerName ( source ):gsub ( "#%x%x%x%x%x%x", "" ) .." Se ha unido al servidor." end ) addEventHandler('onClientPlayerQuit', root, function ( ) toDraw = getPlayerName ( source ):gsub ( "#%x%x%x%x%x%x", "" ) .." Se fue del servidor." end ) function drawText ( ) dxDrawText ( toDraw, 35, screenHeight - 260, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 0.5, "pricedown" ) end addEventHandler ( "onClientRender", root, drawText ) Si quieres cambiar la posicion y el color de la letra se cambia aca : dxDrawText ( toDraw, 35, screenHeight - 260, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 0.5, "pricedown" ) Ya habia un tema sobre esto deberias mirar antes de postear un nuevo tema sobre lo mismo. Link to comment
iFoReX Posted May 3, 2012 Share Posted May 3, 2012 #0T : Lo hiciste tu ?, sigues con eso ¬_¬ Link to comment
Arsilex Posted May 3, 2012 Share Posted May 3, 2012 si yo se que lo iciste tu y lo puse en meta de mi joinquit Link to comment
elmarcosmta14 Posted May 3, 2012 Share Posted May 3, 2012 NO ANDA En realidad no se por que no te anda a mi me anda, talves tu hiciste algo mal. Link to comment
yaver123 Posted May 4, 2012 Author Share Posted May 4, 2012 pero lo copie y todo como lo tienen ustedes y no me anda Link to comment
Recommended Posts