Julian09123 Posted March 16, 2013 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? Skype: Juliang09123
MTA Team 0xCiBeR Posted March 16, 2013 MTA Team 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" ) DevOps Engineer, Cloud Advocate & Security Engineer(Red Team) | Coffee, Containers & Burp
Julian09123 Posted March 16, 2013 Author 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 ) Skype: Juliang09123
MTA Team 0xCiBeR Posted March 16, 2013 MTA Team 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 DevOps Engineer, Cloud Advocate & Security Engineer(Red Team) | Coffee, Containers & Burp
MTA Team 0xCiBeR Posted March 16, 2013 MTA Team 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?! DevOps Engineer, Cloud Advocate & Security Engineer(Red Team) | Coffee, Containers & Burp
AlvareZ_ Posted March 16, 2013 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 )
MTA Team 0xCiBeR Posted March 16, 2013 MTA Team 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 DevOps Engineer, Cloud Advocate & Security Engineer(Red Team) | Coffee, Containers & Burp
Julian09123 Posted March 16, 2013 Author 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) Skype: Juliang09123
AlvareZ_ Posted March 16, 2013 Posted March 16, 2013 Usa lo que te dije, No sirvio ? Julian.. ZombieVille ._.
Alexs Posted March 16, 2013 Posted March 16, 2013 Para ejecutar la función a todos los jugadores vas a tener que hacerlo desde el server side. Developer @ MYVAL
Julian09123 Posted March 16, 2013 Author Posted March 16, 2013 Ahora lo pruebo alvarez Ok xddd Skype: Juliang09123
MTA Team 0xCiBeR Posted March 16, 2013 MTA Team Posted March 16, 2013 Como dice Alex debes hacer el client side con lo que es GUI, y luego triggear cada boton serverside.. DevOps Engineer, Cloud Advocate & Security Engineer(Red Team) | Coffee, Containers & Burp
NodZen Posted March 16, 2013 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) ------------------------------------------------------------------------------------------ My scripts http://community.multitheftauto.com/index.php?p=resources&s=details&id=6977 http://community.multitheftauto.com/index.php?p=resources&s=details&id=7740
Julian09123 Posted March 17, 2013 Author Posted March 17, 2013 Nod El addCommandHandler("crear", createText) seria para que cuando escriba /crear te aparezca? Skype: Juliang09123
NodZen Posted March 17, 2013 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 ------------------------------------------------------------------------------------------ My scripts http://community.multitheftauto.com/index.php?p=resources&s=details&id=6977 http://community.multitheftauto.com/index.php?p=resources&s=details&id=7740
Julian09123 Posted March 17, 2013 Author Posted March 17, 2013 Me dice en la console attemp to call global `guiGetScreenSize` Skype: Juliang09123
Sasu Posted March 17, 2013 Posted March 17, 2013 guiGetScreenSize es client Side. Muestra el script que tienes. State: Inactive
Alexs Posted March 17, 2013 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? Developer @ MYVAL
Julian09123 Posted March 17, 2013 Author 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) Skype: Juliang09123
Alexs Posted March 17, 2013 Posted March 17, 2013 Pásalo a client side, a eso me refería. Developer @ MYVAL
Julian09123 Posted March 17, 2013 Author Posted March 17, 2013 ahora me dice Bad Argument destroyElement Skype: Juliang09123
Recommended Posts