Julian09123 Posted March 16, 2013 Share Posted March 16, 2013 Hola amigos, quisiera saber como hacer un script que al escribir un comando por Ejemplo /foro Salga el foro en la pantalla de cada jugador. como podria ahcerlo? Link to comment
AlvareZ_ Posted March 16, 2013 Share Posted March 16, 2013 setTimer dxDrawText addCommandHandler Link to comment
MTA Team 0xCiBeR Posted March 16, 2013 MTA Team Share Posted March 16, 2013 Para que un timer? Te conviene igual Hacer un Gui, y si quieres que le salga a todos los jugadores del server usa "getElementsByType ( "player" ) Link to comment
Julian09123 Posted March 16, 2013 Author Share Posted March 16, 2013 Pero Como seria Aparte de haci? o como seria perdonen los errores es que nose local screenWidth, screenHeight = guiGetScreenSize ( ) -- Get the screen resolution (width and height) function createText ( ) local playerX, playerY, playerZ = getElementPosition ( localPlayer ) -- Get our player's coordinates. 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 setTimer ( dxDraWText, 1000, 1, "Hello, World!" ) addCommandHandler ( "drawtext", dxdrawtext ) addEventHandler ( "dxDrawText", setTimer, createtext ) Link to comment
AlvareZ_ Posted March 16, 2013 Share Posted March 16, 2013 Eso no tiene nada de sentido. Link to comment
MTA Team 0xCiBeR Posted March 16, 2013 MTA Team Share Posted March 16, 2013 Estas mezlcando conceptos-- O haces lo que queres por gui o por dxDrawTex.. Si es por gui, crea todo por el guieditor ya q te sera mas facil si no sabes mucho de gui. Luego agregale triggers y las funciones Link to comment
MTA Team 0xCiBeR Posted March 16, 2013 MTA Team Share Posted March 16, 2013 Pero Como seria Aparte de haci? o como seria perdonen los errores es que nose local screenWidth, screenHeight = guiGetScreenSize ( ) -- Get the screen resolution (width and height) function createText ( ) local playerX, playerY, playerZ = getElementPosition ( localPlayer ) -- Get our player's coordinates. 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 setTimer ( dxDraWText, 1000, 1, "Hello, World!" ) addCommandHandler ( "drawtext", dxdrawtext ) addEventHandler ( "dxDrawText", setTimer, createtext ) Eso no sirve de nada..Hace una cosa..Crea una gui que te guste por guieditor, sube el codigo aca y te ayudamos..Vale?! Link to comment
AlvareZ_ Posted March 16, 2013 Share Posted March 16, 2013 Creo que seria así: (No estoy Seguro) function dependeText() dxDrawText( "Hola!", sx/3.5, sy/3.5, 1020, 424, tocolor(255, 0, 0, 255), 1, "bankgothic", "left", "center", false, false, true, false, false) end function encenderTexto() addEventHandler("onClientRender", root, dependeText) end function apagarTexto() removeEventHandler("onClientRender", root, dependeText) end function decir() setTimer(encenderTexto, 6000, 1) setTimer(apagarTexto, 12000, 1) addCommandHandler ( "drawtext", decir ) Link to comment
MTA Team 0xCiBeR Posted March 16, 2013 MTA Team Share Posted March 16, 2013 Seria algo como dice AlvareZ_ pero realmente te recomiendo si no sabes mucho de lua lo hagas por gui la ventana y eso..hacelo y pega el codigo final aca..Y te ayudamos a armarlo Link to comment
Julian09123 Posted March 16, 2013 Author Share Posted March 16, 2013 como haria para que con un comando /foro salga a los players aunque Esto esta mal quedaria mal yo queria un DxDrawText porque esto quedaria mal GUIEditor = { tab = {}, edit = {}, window = {}, scrollbar = {}, memo = {}, tabpanel = {}, } GUIEditor.window[1] = guiCreateWindow(207, 199, 384, 48, "www.ZombieVille.com", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.memo[1] = guiCreateMemo(218, 252, 366, 90, "", false) GUIEditor.tabpanel[1] = guiCreateTabPanel(211, 217, 380, 133, false) GUIEditor.tab[1] = guiCreateTab("Pagina", GUIEditor.tabpanel[1]) GUIEditor.memo[2] = guiCreateMemo(53, 250, 126, 20, "", false, GUIEditor.tab[1]) GUIEditor.edit[1] = guiCreateEdit(49, 19, 276, 66, "", false, GUIEditor.tab[1]) GUIEditor.scrollbar[2] = guiCreateScrollBar(525, 263, 15, 67, false, false) Link to comment
AlvareZ_ Posted March 16, 2013 Share Posted March 16, 2013 Usa lo que te dije, No sirvio ? Julian.. ZombieVille ._. Link to comment
Alexs Posted March 16, 2013 Share Posted March 16, 2013 Para ejecutar la función a todos los jugadores vas a tener que hacerlo desde el server side. Link to comment
Julian09123 Posted March 16, 2013 Author Share Posted March 16, 2013 Ahora lo pruebo alvarez Ok xddd Link to comment
MTA Team 0xCiBeR Posted March 16, 2013 MTA Team Share Posted March 16, 2013 Como dice Alex debes hacer el client side con lo que es GUI, y luego triggear cada boton serverside.. Link to comment
NodZen Posted March 16, 2013 Share Posted March 16, 2013 local screenWidth, screenHeight = guiGetScreenSize ( ) local texts = { "Hola Bienvenido", "Welcome to zombieVille" } function createText ( ) local tex = dxDrawText ( texts [ math.random ( #texts ) ], screenWidth-40, screenHeight -50, screenWidth, screenHeight, tocolor ( 200, 0, 0, 255 ), 1, "pricedown" ) setTimer(destroyElement, 5000, 1, tex) end addCommandHandler("crear", createText) Link to comment
Julian09123 Posted March 17, 2013 Author Share Posted March 17, 2013 Nod El addCommandHandler("crear", createText) seria para que cuando escriba /crear te aparezca? Link to comment
NodZen Posted March 17, 2013 Share Posted March 17, 2013 Nod El addCommandHandler("crear", createText) seria para que cuando escriba /crear te aparezca? Si, y se destruya a los 5 segundos. Almenos esa es la idea Link to comment
Julian09123 Posted March 17, 2013 Author Share Posted March 17, 2013 Me dice en la console attemp to call global `guiGetScreenSize` Link to comment
Sasu Posted March 17, 2013 Share Posted March 17, 2013 guiGetScreenSize es client Side. Muestra el script que tienes. Link to comment
Alexs Posted March 17, 2013 Share Posted March 17, 2013 Si man. Cuando te dije que lo habías puesto en server side, era afirmación, no pregunta. Lo cambiaste, no? Link to comment
Julian09123 Posted March 17, 2013 Author Share Posted March 17, 2013 No lo cambie local screenWidth, screenHeight = guiGetScreenSize () local texts = { "Hola Bienvenido", "Welcome to zombieVille" } function createText ( ) local tex = dxDrawText ( texts [ math.random ( #texts ) ], screenWidth-40, screenHeight -50, screenWidth, screenHeight, tocolor ( 200, 0, 0, 255 ), 1, "pricedown" ) setTimer(destroyElement, 5000, 1, tex) end addCommandHandler("crear", createText) Link to comment
Alexs Posted March 17, 2013 Share Posted March 17, 2013 Pásalo a client side, a eso me refería. Link to comment
Julian09123 Posted March 17, 2013 Author Share Posted March 17, 2013 ahora me dice Bad Argument destroyElement Link to comment
Recommended Posts