-
Posts
153 -
Joined
-
Last visited
Everything posted by Lucario
-
addEvent("PlayerLogin", true) addEventHandler("PlayerLogin",getRootElement(),abrirPanel) Alredy added
-
Error: Client triggeres server side event onLoadedAtClient, but event is not added to serverside Client: GUIEditor = { button = {}, window = {}, label = {}, memo = {} } GUIEditor.window[1] = guiCreateWindow(352, 104, 578, 546, "Panel de Ayuda Juramento", false) guiWindowSetMovable(GUIEditor.window[1], false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFF0000") xml = xmlLoadFile( "principal.xml" ) contents = xmlNodeGetValue( xml ) GUIEditor.memo[1] = guiCreateMemo(9, 21, 559, 346, contents, false, GUIEditor.window[1]) guiMemoSetReadOnly(GUIEditor.memo[1], true) GUIEditor.button[1] = guiCreateButton(168, 495, 247, 41, "Cerrar", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "sa-header") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF0000FF") GUIEditor.label[1] = guiCreateLabel(10, 398, 558, 97, "Info Importante y Basica Que Debes Leer: Somos un Clan de Mta San Andreas Que Posee 2 \nServidores, Juramento Freeroam y Zombie Roleplay. \nHistoria: El Clan Juramento Fue Creado a Traves de un Juego Llamado Metin2, Que Posee un Grupo \nde Personas (Chicas en Este Caso) Que Eran Mas Valientes Que los Propios Guerreros Masculinos, En \nEste Caso, el Grupo Se Llamaba Juramento Blanco.", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetColor(GUIEditor.label[1], 0, 255, 0) showCursor(true) function cerrarPanel () bindKey ( "F4", "down", abrirPanel ) guiSetVisible(GUIEditor.window[1],false) showCursor(false) end addEventHandler("onClientGUIClick",GUIEditor.button[1],cerrarPanel) function abrirPanel () bindKey ( "F4", "down", cerrarPanel ) guiSetVisible(GUIEditor.window[1],true) end addEvent("PlayerLogin", true) addEventHandler("PlayerLogin",getRootElement(),abrirPanel) function dxCloseMessage () dxDrawText("Esperamos que Te Hayas Leido Bien la Info y la Ayuda", 205, 246, 1091, 296, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Esperamos que Te Hayas Leido Bien la Info y la Ayuda", 205, 244, 1091, 294, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Esperamos que Te Hayas Leido Bien la Info y la Ayuda", 203, 246, 1089, 296, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Esperamos que Te Hayas Leido Bien la Info y la Ayuda", 203, 244, 1089, 294, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Esperamos que Te Hayas Leido Bien la Info y la Ayuda", 204, 245, 1090, 295, tocolor(0, 0, 255, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false) end function dxFunction () addEventHandler("onClientRender",root,dxCloseMessage) setTimer ( function ( ) removeEventHandler("onClientRender",root,dxCloseMessage) end,9000,1 ) end addEventHandler ("onClientGUIClick", GUIEditor.button[1], dxFunction) function dxCloseMessage2 () dxDrawText("Cualquier Otra Duda en General No Olviden de Publicarla en el Foro", 88, 531, 1236, 570, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "top", false, false, true, false, false) dxDrawText("Cualquier Otra Duda en General No Olviden de Publicarla en el Foro", 88, 529, 1236, 568, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "top", false, false, true, false, false) dxDrawText("Cualquier Otra Duda en General No Olviden de Publicarla en el Foro", 86, 531, 1234, 570, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "top", false, false, true, false, false) dxDrawText("Cualquier Otra Duda en General No Olviden de Publicarla en el Foro", 86, 529, 1234, 568, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "top", false, false, true, false, false) dxDrawText("Cualquier Otra Duda en General No Olviden de Publicarla en el Foro", 87, 530, 1235, 569, tocolor(0, 255, 0, 255), 1.00, "bankgothic", "center", "top", false, false, true, false, false) end function dxFunction2 () addEventHandler("onClientRender",root,dxCloseMessage2) setTimer ( function ( ) removeEventHandler("onClientRender",root,dxCloseMessage2) end,9000,1 ) end addEventHandler ("onClientGUIClick", GUIEditor.button[1], dxFunction2) Server side. function helpHandler () triggerClientEvent ("PlayerLogin", getRootElement()) end addEventHandler ("onPlayerLogin", getRootElement(), helpHandler)
-
In server side? Edit: a it server side function sorry
-
I have a little problem with the help panel wich i will upload to the community, it start when the resource start, i need the panel start when a player log in, everything work good, but i cant make it start when a player log in. Client side: GUIEditor = { button = {}, window = {}, label = {}, memo = {} } GUIEditor.window[1] = guiCreateWindow(352, 104, 578, 546, "Panel de Ayuda Juramento", false) guiWindowSetMovable(GUIEditor.window[1], false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFF0000") xml = xmlLoadFile( "principal.xml" ) contents = xmlNodeGetValue( xml ) GUIEditor.memo[1] = guiCreateMemo(9, 21, 559, 346, contents, false, GUIEditor.window[1]) guiMemoSetReadOnly(GUIEditor.memo[1], true) GUIEditor.button[1] = guiCreateButton(168, 495, 247, 41, "Cerrar", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "sa-header") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF0000FF") GUIEditor.label[1] = guiCreateLabel(10, 398, 558, 97, "Info Importante y Basica Que Debes Leer: Somos un Clan de Mta San Andreas Que Posee 2 \nServidores, Juramento Freeroam y Zombie Roleplay. \nHistoria: El Clan Juramento Fue Creado a Traves de un Juego Llamado Metin2, Que Posee un Grupo \nde Personas (Chicas en Este Caso) Que Eran Mas Valientes Que los Propios Guerreros Masculinos, En \nEste Caso, el Grupo Se Llamaba Juramento Blanco.", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetColor(GUIEditor.label[1], 0, 255, 0) showCursor(true) function cerrarPanel () bindKey ( "F4", "down", abrirPanel ) guiSetVisible(GUIEditor.window[1],false) showCursor(false) end addEventHandler("onClientGUIClick",GUIEditor.button[1],cerrarPanel) function abrirPanel () bindKey ( "F4", "down", cerrarPanel ) guiSetVisible(GUIEditor.window[1],true) end addEventHandler("onPlayerLogin",getRootElement(),abrirPanel) function dxCloseMessage () dxDrawText("Esperamos que Te Hayas Leido Bien la Info y la Ayuda", 205, 246, 1091, 296, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Esperamos que Te Hayas Leido Bien la Info y la Ayuda", 205, 244, 1091, 294, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Esperamos que Te Hayas Leido Bien la Info y la Ayuda", 203, 246, 1089, 296, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Esperamos que Te Hayas Leido Bien la Info y la Ayuda", 203, 244, 1089, 294, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Esperamos que Te Hayas Leido Bien la Info y la Ayuda", 204, 245, 1090, 295, tocolor(0, 0, 255, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false) end function dxFunction () addEventHandler("onClientRender",root,dxCloseMessage) setTimer ( function ( ) removeEventHandler("onClientRender",root,dxCloseMessage) end,9000,1 ) end addEventHandler ("onClientGUIClick", GUIEditor.button[1], dxFunction) function dxCloseMessage2 () dxDrawText("Cualquier Otra Duda en General No Olviden de Publicarla en el Foro", 88, 531, 1236, 570, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "top", false, false, true, false, false) dxDrawText("Cualquier Otra Duda en General No Olviden de Publicarla en el Foro", 88, 529, 1236, 568, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "top", false, false, true, false, false) dxDrawText("Cualquier Otra Duda en General No Olviden de Publicarla en el Foro", 86, 531, 1234, 570, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "top", false, false, true, false, false) dxDrawText("Cualquier Otra Duda en General No Olviden de Publicarla en el Foro", 86, 529, 1234, 568, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "top", false, false, true, false, false) dxDrawText("Cualquier Otra Duda en General No Olviden de Publicarla en el Foro", 87, 530, 1235, 569, tocolor(0, 255, 0, 255), 1.00, "bankgothic", "center", "top", false, false, true, false, false) end function dxFunction2 () addEventHandler("onClientRender",root,dxCloseMessage2) setTimer ( function ( ) removeEventHandler("onClientRender",root,dxCloseMessage2) end,9000,1 ) end addEventHandler ("onClientGUIClick", GUIEditor.button[1], dxFunction2)
-
how can i change the buttons and labels too?
-
Hi, im changing the main of original panel resource freeroam, but it have some problems, when i start the script, the gui autoopen, and when i press F1 it give me a error, and the buttons doesnt work. Client: CONTROL_MARGIN_RIGHT = 5 LINE_MARGIN = 5 LINE_HEIGHT = 16 g_Root = getRootElement() g_ResRoot = getResourceRootElement(getThisResource()) g_Me = getLocalPlayer() server = createServerCallInterface() guiSetInputMode("no_binds_when_editing") GUIEditor = { checkbox = {}, window = {}, button = {}, label = {} } GUIEditor.window[1] = guiCreateWindow(22, 182, 366, 399, "Panel Principal de Juramento Freeroam", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(10, 46, 110, 51, "Skins", false, GUIEditor.window[1]) local font_0 = guiCreateFont("bhz.ttf") guiSetFont(GUIEditor.button[1], font_0) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFFFFFF") GUIEditor.button[2] = guiCreateButton(10, 103, 109, 51, "Ropa de CJ", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], font_0) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFFFFFF") GUIEditor.button[3] = guiCreateButton(129, 46, 109, 51, "Animaciones", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[3], font_0) guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFFFFFFF") GUIEditor.button[4] = guiCreateButton(129, 103, 109, 51, "Mejoras", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[4], font_0) guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFFFFFFF") GUIEditor.button[5] = guiCreateButton(248, 46, 109, 51, "Armas", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[5], font_0) guiSetProperty(GUIEditor.button[5], "NormalTextColour", "FFFFFFFF") GUIEditor.button[6] = guiCreateButton(248, 103, 109, 51, "Morir", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[6], font_0) guiSetProperty(GUIEditor.button[6], "NormalTextColour", "FFFFFFFF") GUIEditor.button[7] = guiCreateButton(9, 338, 110, 51, "Crear Vehiculo", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[7], font_0) guiSetProperty(GUIEditor.button[7], "NormalTextColour", "FFFFFFFF") GUIEditor.label[1] = guiCreateLabel(255, 336, 97, 31, "Caerse de la \nMoto:", false, GUIEditor.window[1]) local font_1 = guiCreateFont("EmblemaOne.ttf") guiSetFont(GUIEditor.label[1], font_1) guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false) GUIEditor.checkbox[1] = guiCreateCheckBox(294, 370, 15, 18, "", false, false, GUIEditor.window[1]) GUIEditor.label[2] = guiCreateLabel(9, 154, 347, 18, "---------------------------------------------------------------------------------------------------------", false, GUIEditor.window[1]) GUIEditor.label[3] = guiCreateLabel(9, 302, 347, 15, "---------------------------------------------------------------------------------------------------------------------", false, GUIEditor.window[1]) GUIEditor.label[4] = guiCreateLabel(10, 19, 347, 27, "Beneficios de los Jugadores:", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[4], font_1) guiLabelSetHorizontalAlign(GUIEditor.label[4], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[4], "center") GUIEditor.label[5] = guiCreateLabel(9, 312, 343, 24, "Apartado de los Carros:", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[5], font_1) guiLabelSetHorizontalAlign(GUIEditor.label[5], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[5], "center") GUIEditor.label[6] = guiCreateLabel(9, 172, 347, 23, "Otros Beneficios:", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[6], font_1) guiLabelSetHorizontalAlign(GUIEditor.label[6], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[6], "center") GUIEditor.button[8] = guiCreateButton(9, 201, 110, 51, "Skins Jura", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[8], font_0) guiSetProperty(GUIEditor.button[8], "NormalTextColour", "FFFFFFFF") GUIEditor.button[9] = guiCreateButton(247, 200, 109, 51, "Skins Staff/VIP", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[9], font_0) guiSetProperty(GUIEditor.button[9], "NormalTextColour", "FFFFFFFF") GUIEditor.button[10] = guiCreateButton(131, 201, 106, 50, "Skins Modificados", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[10], font_0) guiSetProperty(GUIEditor.button[10], "NormalTextColour", "FFFFFFFF") GUIEditor.button[11] = guiCreateButton(131, 257, 108, 50, "Panel de Ayuda", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[11], font_0) guiSetProperty(GUIEditor.button[11], "NormalTextColour", "FFFFFFFF") GUIEditor.button[12] = guiCreateButton(131, 338, 108, 50, "Volcar Vehiculo", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[12], font_0) guiSetProperty(GUIEditor.button[12], "NormalTextColour", "FFFFFFFF") --------------------------- -- Set skin window --------------------------- function skinInid () setControlNumber(wndSkin, 'skinid', getElementModel(g_Me)) end function showSkinID(leaf) if leaf.id then setControlNumber(wndSkin, 'skinid', leaf.id) end end function applySkin() local skinID = getControlNumber(wndSkin, 'skinid') if skinID then server.setMySkin(skinID) fadeCamera(true) end end addEventHandler("onClientGUIClick",GUIEditor.button[1], function () wndSkin = { 'wnd', text = 'Poner Skin', width = 250, x = -20, y = 0.3, controls = { { 'lst', id='skinlist', width=230, height=290, columns={ {text="Skins", attr='name'} }, rows={xml='skins.xml', attrs={'id', 'name'}}, onitemclick=showSkinID, onitemdoubleclick=applySkin }, {'txt', id='skinid', text='', width=50}, {'btn', id='Poner', onclick=applySkin}, {'btn', id='Cerrar', closeswindow=true} }, oncreate = skinInit } end ) function setSkinCommand(cmd, skin) skin = skin and tonumber(skin) if skin then server.setMySkin(skin) fadeCamera(true) closeWindow(wndSpawnMap) closeWindow(wndSetPos) end end --------------------------- --- Set animation window --------------------------- function applyAnimation(leaf) if type(leaf) ~= 'table' then leaf = getSelectedGridListLeaf(wndAnim, 'animlist') if not leaf then return end end server.setPedAnimation(g_Me, leaf.parent.name, leaf.name, true, true) end function stopAnimation() server.setPedAnimation(g_Me, false) end addEventHandler("onClientGUIClick",GUIEditor.button[3], function () wndAnim = { 'wnd', text = 'Poner Animacion', width = 250, x = -20, y = 0.3, controls = { { 'lst', id='animlist', width=230, height=290, columns={ {text="Animaciones", attr='name'} }, rows={xml='animations.xml', attrs={'name'}}, expandlastlevel=false, onitemdoubleclick=applyAnimation }, {'btn', id='Poner', onclick=applyAnimation}, {'btn', id='Parar', onclick=stopAnimation}, {'btn', id='Cerrar', closeswindow=true} } } end ) addCommandHandler('anim', function(command, lib, name) server.setPedAnimation(g_Me, lib, name, true, true) end ) --------------------------- -- Weapon window --------------------------- function addWeapon(leaf, amount) if type(leaf) ~= 'table' then leaf = getSelectedGridListLeaf(wndWeapon, 'weaplist') amount = getControlNumber(wndWeapon, 'amount') if not amount or not leaf then return end end server.giveMeWeapon(leaf.id, amount) end addEventHandler("onClientGUIClick",GUIEditor.button[5], function () wndWeapon = { 'wnd', text = 'Escoger Armas', width = 250, controls = { { 'lst', id='weaplist', width=230, height=280, columns={ {text='Arma', attr='name'} }, rows={xml='weapons.xml', attrs={'id', 'name'}}, onitemdoubleclick=function(leaf) addWeapon(leaf, 500) end }, {'br'}, {'txt', id='amount', text='500', width=60}, {'btn', id='Coger', onclick=addWeapon}, {'btn', id='Cerrar', closeswindow=true} } } end ) function giveWeaponCommand(cmd, weapon, amount) weapon = tonumber(weapon) or getWeaponIDFromName(weapon) if not weapon then return end amount = amount and tonumber(amount) or 500 server.giveMeWeapon(math.floor(weapon), amount) end --------------------------- -- Fighting style --------------------------- addCommandHandler('estilo', function(cmd, style) style = style and tonumber(style) if style then server.
-
As i say, im not a professional scripter, im study in the first class of a programming center, ((first class)), there they teach me all the syntax of the functions, they say, in second class, they will teach me all the handlers, because the center is only dedicated for programming and hardware, you solid, i think you study in the fourth or third class of programming, you have all habilities to easyly make a staff gui in 2 hours or less, but im now trying to replace the main of freeroam to a main maked by me, but it is so difficult for me, as i say, im not expert.
-
Yesterday, a man contact me, he say he need: GUI with start button to warp in a car and drive thru marker for Job's GUI Login / Register PayDay (1 hour) GUI Bank GUI Car Panel GUI Car Shop GUI Skin Shop with previews GUI Ammunation GUI Driving School (Car, Bike, Farmer, Bus, Trucker, Plane and Heli license with questions and Driving test) VIP System Factions (Police, Swat, Utility) Gangs(Yakuza, Dead Angels, Cartel) Faction/Gang GUI with invite, unvite, Rang Up, Down buttons(6 Ranks). Gangwar with a start GUI I only can say, WOW! it take me so mutch time, but finelly, i will make it in 5 days lol, as i say, i dont make full gamemodes, but i think, it is not a full gamemode
-
viewtopic.php?f=91&t=59784
-
Nah, it is a joke we have in spain, forget it
-
I cant find the line, if i was founded, i was fixed it
-
It doesnt have function for open the skin selector, only when a player press the button register of my login panel, output the skin selector
-
Dont work , When i click on the gui, the skin selector output, and i need if they click on register
-
OFF: Can you help me with the last post please?
-
I have added to my login panel a skin selector, but the problem is, when i click on the gui, on the another part of the gui, the skin selector appear, i want the skin selector appear when i click register, how can i change it? Client: GUIEditor = { checkbox = {}, staticimage = {}, edit = {}, button = {}, window = {}, label = {}, memo = {} } ventanalogin = guiCreateWindow(278, 47, 701, 666, "Panel de Login Juramento", false) guiWindowSetSizable(ventanalogin, false) guiWindowSetMovable(ventanalogin, true) xml = xmlLoadFile( "server.xml" ) contents = xmlNodeGetValue( xml ) memo = guiCreateMemo(9, 466, 682, 190, contents, false, ventanalogin) guiMemoSetReadOnly(memo,true) usuario = guiCreateLabel(299, 26, 147, 41, "Usuario:", false, ventanalogin) guiSetFont(usuario, "sa-header") clave = guiCreateLabel(482, 26, 192, 40, "Contraseña:", false, ventanalogin) guiSetFont(clave, "sa-header") Edit_Login = guiCreateEdit(299, 77, 147, 39, "", false, ventanalogin) Edit_Password = guiCreateEdit(482, 76, 159, 40, "", false, ventanalogin) lgnBtn = guiCreateButton(367, 126, 193, 91, "Entrar", false, ventanalogin) guiSetFont(lgnBtn, "sa-header") guiSetProperty(lgnBtn, "NormalTextColour", "FF0000FF") guardar1 = guiCreateCheckBox(645, 91, 15, 16, "", false, false, ventanalogin) guardar2 = guiCreateCheckBox(451, 91, 15, 15, "", false, false, ventanalogin) usuario2 = guiCreateLabel(299, 257, 143, 41, "Usuario:", false, ventanalogin) guiSetFont(usuario2, "sa-header") clave2 = guiCreateLabel(479, 257, 192, 41, "Contraseña:", false, ventanalogin) guiSetFont(clave2, "sa-header") Edit_Login2 = guiCreateEdit(299, 308, 143, 41, "", false, ventanalogin) Edit_Password2 = guiCreateEdit(479, 308, 192, 41, "", false, ventanalogin) RgsBtn = guiCreateButton(362, 355, 193, 101, "Registrarse", false, ventanalogin) guiSetFont(RgsBtn, "sa-header") guiSetProperty(RgsBtn, "NormalTextColour", "FF00FF00") info = guiCreateLabel(14, 257, 285, 209, "Info Importante:\n\nPara Recordar Contraseña, Deja las Casillas\nAl Entrar al Servidor, Automaticamente Se\nMuestra la Pass.\nLean la Info de Abajo (Importante)\nNo Recomendable Hacer Videos o Imagenes\nTeniendo Abierto el Panel.\nTodavia No Existe la Opcion Cambiar Pass, Si\nQuieren Hacer un Video, Creense Otra Cuenta al \nEntrar.\no Desmarcan las Casillas de Verificacion\nDisfruten del Servidor Sigan las Reglas y Apreten\n.F4 Para Abrir el Panel de Ayuda", false, ventanalogin) guiSetFont(info, "default-bold-small") guiLabelSetColor(info, 0, 255, 0) juralogo = guiCreateStaticImage(18, 20, 275, 237, ":login_panel/logo.png", false, ventanalogin) showCursor(true) addEventHandler("onClientGUIClick",lgnBtn, function ( ) local User = guiGetText ( Edit_Login ) local Password = guiGetText ( Edit_Password ) if User and Password then triggerServerEvent("onPlayerTryingToLogin",localPlayer,User,Password) end end,false ) addEventHandler("onClientGUIClick",RgsBtn, function ( ) local User = guiGetText ( Edit_Login2 ) local Password = guiGetText ( Edit_Password2 ) if User and Password then triggerServerEvent("onPlayerTryingToRegister",localPlayer,User,Password) end end,false ) addEvent("PlayerLogedOnClient",true) addEventHandler("PlayerLogedOnClient",getRootElement(), function ( ) xmlFileHandler(guiCheckBoxGetSelected(guardar1)) xmlFileHandler(guiCheckBoxGetSelected(guardar2)) guiSetVisible(ventanalogin,false) end ) function xmlFileHandler(gReturn) if gReturn == true then setElementData(localPlayer, "LoginAuto", true) else setElementData(localPlayer, "LoginAuto", false) end sName = "Login" xmlFileName = tostring("login_" .. sName .. ".xml") local xmlFile = xmlLoadFile(xmlFileName) if not xmlFile then xmlFile = xmlCreateFile(xmlFileName, "settings") xmlNodeSetAttribute(xmlFile, "autologin", tostring(getElementData(localPlayer, "LoginAuto"))) end xmlNodeSetAttribute(xmlFile, "autologin", tostring(getElementData(localPlayer, "LoginAuto"))) xmlNodeSetAttribute(xmlFile, "username", tostring(guiGetText(Edit_Login))) xmlNodeSetAttribute(xmlFile, "password", tostring(guiGetText(Edit_Password,password))) xmlSaveFile(xmlFile) xmlUnloadFile(xmlFile) end function XML() sName = "Login" xmlFileName = tostring("login_" .. sName .. ".xml") local xmlFile = xmlLoadFile(xmlFileName) if xmlFile then status = xmlNodeGetAttribute(xmlFile, "autologin") end if status == "true" then local username = tostring(xmlNodeGetAttribute(xmlFile, "username")) local password = tostring(xmlNodeGetAttribute(xmlFile, "password")) if username ~= "" and password ~= "" then guiCheckBoxSetSelected(guardar1,true) guiCheckBoxSetSelected(guardar2,true) guiSetText(Edit_Login,username) guiSetText(Edit_Password,password) end end end setTimer( XML,50, 1) local x, y = guiGetScreenSize() SkinMusic = "data/music/SkinSelectMusic.mp3" SkinAnims = {"dnce_M_b","DAN_Left_A","DAN_Down_A","DAN_Loop_A"} StartSkin = 0 NewSkin = false function SelectSkin () setElementInterior ( getLocalPlayer(), 0, 0,0,0 ) setCameraMatrix( 1997.3852539063, -2329.8051757813, 14.718949317932, 1996.6430664063, -2423.5083007813, -20.197387695313) skin = createPed ( StartSkin, 1997.4000244141,-2332.8999023438,13.5 ) setPedAnimation( skin, "DANCING", SkinAnims[math.random(1,4)]) fadeCamera( true, 10) setTime(0,0) SkinSelectMusic = playSound(SkinMusic,true) addEventHandler("onClientRender",getRootElement(),dxDrawInfo) bindKey("arrow_r","down",NextSkin) bindKey("arrow_l","down",LastSkin) bindKey(".","down",SpawnPlayer) showChat(false) showPlayerHudComponent ( "radar", false ) end addEventHandler("onClientGUIClick", RgsBtn, SelectSkin) function dxDrawInfo () dxDrawText("Elige Bien tu Skin, No Podras Cambiartelo Hasta Que Tengas Ciertos Requisitos", 183, 204, 1052, 254, tocolor(239, 255, 0, 255), 1.00, "pricedown", "center", "center", false, false, true, false, false) end addEventHandler( "onClientGUIClick", RgsBtn, function() SelectSkin() FreezeBots() end) function SpawnPlayer() local r,g,b = math.random(0,255),math.random(0,255),math.random(0,255) triggerServerEvent ( "onClientWantsToSpawn", getLocalPlayer(), getLocalPlayer(),StartSkin,r,g,b ) unbindKey("arrow_r","down",NextSkin) unbindKey("arrow_l","down",LastSkin) unbindKey("lshift","down",SpawnPlayer) setTime(12,0) stopSound(SkinSelectMusic) removeEventHandler("onClientRender",getRootElement(),dxDrawInfo) showCursor(false) showChat(true) showPlayerHudComponent ( "radar", true ) guiSetVisible(lnextskin,false) guiSetVisible(rnextskin,false) guiSetVisible(spawnskin,false) setElementData(getLocalPlayer(),"red",r) setElementData(getLocalPlayer(),"green",g) setElementData(getLocalPlayer(),"blue",b) end function NextSkin() if StartSkin == 312 then StartSkin = -1 elseif StartSkin == 2 then StartSkin = 8 end StartSkin = StartSkin + 1 setElementModel(skin,StartSkin) setPedAnimation( skin, "DANCING", SkinAnims[math.random(1,4)]) SkinJobTextColor() end function LastSkin() if StartSkin == 0 then StartSkin = 313 elseif StartSkin == 9 then StartSkin = 3 end StartSkin = StartSkin - 1 setElementModel(skin,StartSkin) setPedAnimation( skin, "DANCING", SkinAnims[math.random(1,4)]) SkinJobTextColor() end function loadButtons () lnextskin = guiCreateButton(x-x/1.30,y/1.22,x/5,y/20,"<--",false) guiSetProperty(lnextskin,"PushedTextColour","FFFFFF00") guiSetFont(lnextskin,"sa-header") rnextskin = guiCreateButton(x-x/2.90,y/1.22,x/5,y/20,"-->",false) guiSetProperty(rnextskin,"PushedTextColour","FFFFFF00") guiSetFont(rnextskin,"sa-header") spawnskin = guiCreateButton(x-x/1.80,y/1.22,x/5,y/20,"Elegir",false) guiSetProperty(spawnskin,"PushedTextColour","FFFFFF00") guiSetFont(spawnskin,"sa-header") end addEventHandler ("onClientGUIClick", RgsBtn, loadButtons) addEventHandler( "onClientGUIClick", getRootElement(), function() if source == lnextskin then LastSkin() elseif source == rnextskin then NextSkin() elseif source == spawnskin then SpawnPlayer() end end) ------PEDS function FreezeBots() local Bots = getElementsByType("ped") for k,v in ipairs(Bots) do setElementFrozen(v,true) end end Server: addEvent("onPlayerTryingToLogin",true) addEventHandler("onPlayerTryingToLogin",getRootElement(), function ( User,Password ) if User ~= " " or User ~= " " then if Password ~= " " or Password ~= " " then if ( account ~= false ) then if not (username == "") then if not (password == "") then local account = getAccount ( User,Password ) if ( account ) then logIn ( source,account,Password ) triggerClientEvent(source,"PlayerLogedOnClient",source) showCursor(source,false) outputChatBox("* Has Entrado con Exito",source,0,255,0) else outputChatBox("* Usuario y/o Contraseña Incorrectos",source,255,0,0) end else outputChatBox ("Escribe Tu Contraseña!",source,255,0,0,true) end else outputChatBox ("Escribe Tu Nombre de Usuario",source,255,0,0) end end end end end ) addEvent("onPlayerTryingToRegister",true) addEventHandler("onPlayerTryingToRegister",getRootElement(), function ( User,Password ) if User ~= " " or User ~= " " then if Password ~= " " or Password ~= " " then if not (username == "") then if not (password == "") then if ( account ~= true ) then local account = getAccount ( User,Password ) addAccount ( User,Password ) triggerClientEvent(source,"PlayerLogedOnClient",source) outputChatBox("* Te Has Registrado Con Exito Con Tu Nueva Cuenta!",source,0,255,0) outputChatBox("* Usuario : "..User.." Contraseña : "..Password.." ",source,0,255,0) else outputChatBox("* Esta Cuenta Ya Existe",source,255,0,0) end else outputChatBox ("Escribe Tu Usuario",source,255,0,0) end else outputChatBox ("Escribe Tu Contraseña",source,255,0,0) end end end end ) playerSkin = {} Garages = {0,1,2,3,4,5,6,7,8,9,10, 11,12,13,14,15,16,17,18,19,20, 21,22,23,24,25,26,27,28,29,30, 31,32,33,34,35,36,37,38,39,40, 41,42,43,44,45,46,47,48,49} spawnTeam = createTeam ("Civiles", 255, 255, 255) function SpawnPlayer(thePlayer,skin,r,g,b) spawnPlayer ( thePlayer, 213.76528930664,1865.5185546875,13.140625, 180.0, skin, 0, 0, spawnTeam ) setCameraTarget (source, source) playerSkin[thePlayer] = {skin,r,g,b} setElementData(thePlayer,"Score",0) setPlayerNametagShowing ( thePlayer, false) end addEvent( "onClientWantsToSpawn", true ) addEventHandler( "onClientWantsToSpawn", getRootElement(), SpawnPlayer ) And i want to add this messages to the login panel, how can i make it? client: function dxLoginMessage() dxDrawText("Recordatorio: Apreta F4 Para Abrir/Cerrar el Panel de Ayuda", 240, 337, 1139, 376, tocolor(0, 0, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Recordatorio: Apreta F4 Para Abrir/Cerrar el Panel de Ayuda", 240, 335, 1139, 374, tocolor(0, 0, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Recordatorio: Apreta F4 Para Abrir/Cerrar el Panel de Ayuda", 238, 337, 1137, 376, tocolor(0, 0, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Recordatorio: Apreta F4 Para Abrir/Cerrar el Panel de Ayuda", 238, 335, 1137, 374, tocolor(0, 0, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Recordatorio: Apreta F4 Para Abrir/Cerrar el Panel de Ayuda", 239, 336, 1138, 375, tocolor(0, 255, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) end function dxJoinMessage() dxDrawText("Espera Mientras Cargue el Servidor, \nNo Tardara Mucho, y Te Sumergiras al Mejor Servidor \nde Mta San Andreas. \nEn Total Tenemos 2 Servidores, Juramento Freeroam \ny Juramento Zombie Roleplay", 248, 316, 1012, 456, tocolor(0, 0, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Espera Mientras Cargue el Servidor, \nNo Tardara Mucho, y Te Sumergiras al Mejor Servidor \nde Mta San Andreas. \nEn Total Tenemos 2 Servidores, Juramento Freeroam \ny Juramento Zombie Roleplay", 248, 314, 1012, 454, tocolor(0, 0, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Espera Mientras Cargue el Servidor, \nNo Tardara Mucho, y Te Sumergiras al Mejor Servidor \nde Mta San Andreas. \nEn Total Tenemos 2 Servidores, Juramento Freeroam \ny Juramento Zombie Roleplay", 246, 316, 1010, 456, tocolor(0, 0, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Espera Mientras Cargue el Servidor, \nNo Tardara Mucho, y Te Sumergiras al Mejor Servidor \nde Mta San Andreas. \nEn Total Tenemos 2 Servidores, Juramento Freeroam \ny Juramento Zombie Roleplay", 246, 314, 1010, 454, tocolor(0, 0, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Espera Mientras Cargue el Servidor, \nNo Tardara Mucho, y Te Sumergiras al Mejor Servidor \nde Mta San Andreas. \nEn Total Tenemos 2 Servidores, Juramento Freeroam \ny Juramento Zombie Roleplay", 247, 315, 1011, 455, tocolor(0, 0, 255, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) end addEvent("JoinDx",true) addEventHandler("JoinDx",root, function ( ) addEventHandler("onClientRender",root,dxJoinMessage) end ) addEvent("LoginDx",true) addEventHandler("LoginDx",root, function ( ) removeEventHandler("onClientRender",root,dxJoinMessage) addEventHandler("onClientRender",root,dxLoginMessage) setTimer ( function ( ) removeEventHandler("onClientRender",root,dxLoginMessage) end,6000,1 ) end ) server: function dxJoinFunction ( ) triggerClientEvent(source,"JoinDx",source) end addEventHandler("onPlayerJoin", root, dxJoinFunction) function dxLoginFunction ( ) triggerClientEvent(source,"LoginDx",source) end addEventHandler("onPlayerLogin", root, dxLoginFunction) i want the messages appears when a player enter, the second message, and when a player login/register, the first dx message, but when the download bar finish, and appear the login panel, hide the second message for prevent estorb the login panel
-
Made Client side: function dxLoginMessage() dxDrawText("Recordatorio: Apreta F4 Para Abrir/Cerrar el Panel de Ayuda", 240, 337, 1139, 376, tocolor(0, 0, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Recordatorio: Apreta F4 Para Abrir/Cerrar el Panel de Ayuda", 240, 335, 1139, 374, tocolor(0, 0, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Recordatorio: Apreta F4 Para Abrir/Cerrar el Panel de Ayuda", 238, 337, 1137, 376, tocolor(0, 0, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Recordatorio: Apreta F4 Para Abrir/Cerrar el Panel de Ayuda", 238, 335, 1137, 374, tocolor(0, 0, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Recordatorio: Apreta F4 Para Abrir/Cerrar el Panel de Ayuda", 239, 336, 1138, 375, tocolor(0, 255, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) end addEventHandler("onClientPreRender", root, dxLoginMessage) addEvent("onClientPreRender", true) function dxJoinMessage() dxDrawText("Espera Mientras Cargue el Servidor, \nNo Tardara Mucho, y Te Sumergiras al Mejor Servidor \nde Mta San Andreas. \nEn Total Tenemos 2 Servidores, Juramento Freeroam \ny Juramento Zombie Roleplay", 248, 316, 1012, 456, tocolor(0, 0, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Espera Mientras Cargue el Servidor, \nNo Tardara Mucho, y Te Sumergiras al Mejor Servidor \nde Mta San Andreas. \nEn Total Tenemos 2 Servidores, Juramento Freeroam \ny Juramento Zombie Roleplay", 248, 314, 1012, 454, tocolor(0, 0, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Espera Mientras Cargue el Servidor, \nNo Tardara Mucho, y Te Sumergiras al Mejor Servidor \nde Mta San Andreas. \nEn Total Tenemos 2 Servidores, Juramento Freeroam \ny Juramento Zombie Roleplay", 246, 316, 1010, 456, tocolor(0, 0, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Espera Mientras Cargue el Servidor, \nNo Tardara Mucho, y Te Sumergiras al Mejor Servidor \nde Mta San Andreas. \nEn Total Tenemos 2 Servidores, Juramento Freeroam \ny Juramento Zombie Roleplay", 246, 314, 1010, 454, tocolor(0, 0, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Espera Mientras Cargue el Servidor, \nNo Tardara Mucho, y Te Sumergiras al Mejor Servidor \nde Mta San Andreas. \nEn Total Tenemos 2 Servidores, Juramento Freeroam \ny Juramento Zombie Roleplay", 247, 315, 1011, 455, tocolor(0, 255, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) end addEventHandler("onClientRender", root, dxJoinMessage) addEvent("onClientRender", true) Server side: function dxJoinFunction () triggerClientEvent("onClientRender", getRootElement()) end addEventHandler("onPlayerJoin", root, dxJoinFunction) function dxLoginFunction () triggerClientEvent("onClientPreRender", getRootElement()) setTimer(dxLoginFunction, 6000, 1) end addEventHandler("onPlayerLogin", root, dxLoginFunction) removeEventHandler("onPlayerJoin", root, dxLoginFunction) Now the 2 messages appear in 1 time
-
Hi, i have a little problem with the dx login/join messages, i want when a player join the server and the download is in progress, show the second dx message, and when a player click register show the first dx message, using onplayerlogin and onplayerjoin: function dxLoginMessage() dxDrawText("Recordatorio: Apreta F4 Para Abrir/Cerrar el Panel de Ayuda", 240, 337, 1139, 376, tocolor(0, 0, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Recordatorio: Apreta F4 Para Abrir/Cerrar el Panel de Ayuda", 240, 335, 1139, 374, tocolor(0, 0, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Recordatorio: Apreta F4 Para Abrir/Cerrar el Panel de Ayuda", 238, 337, 1137, 376, tocolor(0, 0, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Recordatorio: Apreta F4 Para Abrir/Cerrar el Panel de Ayuda", 238, 335, 1137, 374, tocolor(0, 0, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Recordatorio: Apreta F4 Para Abrir/Cerrar el Panel de Ayuda", 239, 336, 1138, 375, tocolor(0, 255, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) setTimer(dxLoginMessage, 6000, 1) end addEventHandler("onPlayerLogin", root, dxLoginMessage) function dxJoinMessage() dxDrawText("Espera Mientras Cargue el Servidor, \nNo Tardara Mucho, y Te Sumergiras al Mejor Servidor \nde Mta San Andreas. \nEn Total Tenemos 2 Servidores, Juramento Freeroam \ny Juramento Zombie Roleplay", 248, 316, 1012, 456, tocolor(0, 0, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Espera Mientras Cargue el Servidor, \nNo Tardara Mucho, y Te Sumergiras al Mejor Servidor \nde Mta San Andreas. \nEn Total Tenemos 2 Servidores, Juramento Freeroam \ny Juramento Zombie Roleplay", 248, 314, 1012, 454, tocolor(0, 0, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Espera Mientras Cargue el Servidor, \nNo Tardara Mucho, y Te Sumergiras al Mejor Servidor \nde Mta San Andreas. \nEn Total Tenemos 2 Servidores, Juramento Freeroam \ny Juramento Zombie Roleplay", 246, 316, 1010, 456, tocolor(0, 0, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Espera Mientras Cargue el Servidor, \nNo Tardara Mucho, y Te Sumergiras al Mejor Servidor \nde Mta San Andreas. \nEn Total Tenemos 2 Servidores, Juramento Freeroam \ny Juramento Zombie Roleplay", 246, 314, 1010, 454, tocolor(0, 0, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Espera Mientras Cargue el Servidor, \nNo Tardara Mucho, y Te Sumergiras al Mejor Servidor \nde Mta San Andreas. \nEn Total Tenemos 2 Servidores, Juramento Freeroam \ny Juramento Zombie Roleplay", 247, 315, 1011, 455, tocolor(0, 255, 0, 255), 0.85, "bankgothic", "left", "top", false, false, true, false, false) end addEventHandler("onPlayerJoin", root, dxJoinMessage) removeEventHandler("onPlayerLogin", root, dxJoinMessage) removeEventHandler("onPlayerRegister", root, dxJoinMessage)
-
Thank you so mutch you help me to solve it
-
Hi i have a problem to bind a weapon shop, when i press the key nothing happen, and doesnt output any errors in the debugscript, im new with the bindKey function. addEventHandler("onClientResourceStart",resourceRoot, function() bindKey ( "F1", "down", closeShop ) end ) function closeShop() if guiGetVisible(shopWindow) then guiSetVisible(shopWindow,false) showCursor(false) end end addEventHandler ("onClientGUIClick", closeButton, closeShop) addEventHandler("onClientResourceStart",resourceRoot, function() bindKey ( "F1", "down", viewGUI ) end ) addEvent ("viewGUI", true) function viewGUI () if (getLocalPlayer() == source) then guiSetVisible (shopWindow, true) showCursor (true) end end addEventHandler ("viewGUI", getRootElement(), viewGUI) It is for Zombie Roleplay, the freeroam is OFF.
-
I need to make any math function?
-
Im not only know it, i know too mutch functions and handlers!
-
The server have now 8 months, and yes, when the people open their first server, they know lua too little, but when a server get time, the people leorn scripting for new updates, like tigreblanco and me, but i have all scripting responsabilities
-
Can you give me a example of a timer and the drawed text?