Jump to content

Cocodrilo

Members
  • Posts

    93
  • Joined

  • Last visited

Everything posted by Cocodrilo

  1. How do i something like this .. ? local consulta = dbQuery(myCallback,db,"SELECT * FROM acc_table") local resultado = dbPoll( consulta, -1 ) for _, v in ipairs(resultado) do local acc = v['account'] local playerAccount = getPlayerAccount ( getAccountName(acc) ) setAccountData(playerAccount,"Money", 1000) end * I save 'getPlayerMoney' into the "Money" accountData. I want to set that money to accounts who are in the table in the column 'account'.
  2. I use : local money = getPlayerMoney(getLocalPlayer()) string.gsub(money,"^(-?%d+)(%d%d%d)", '%1,%2') When money is 1 000 = 1,000 10 000 = 10,000 100 000 = 100,000 etc. But When money is 1 000 000 returns 1000,000. How i get 1,000,000 ? *without modifying the previous examples
  3. so how would it be? any function or example?
  4. How to get a string value from a column db? something like this: local q = dbQuery(con, "SELECT * FROM t_ayuntamiento WHERE Cuenta=?",Cuenta) local result = dbPoll(q,-1) if tostring(result) == "Cocodrilo" then outputChatBox(result.. " is into db") end
  5. Quiero que la progressBar = el valor de la variable "value" y aumente este valor cada segundo. El problema esta que, cuando la variable "value" esta entre 0 y 1, por ejemplo, 0.50, 0.80, etc. La progressBar no aumenta nada. A que se debe esto? tiene alguna solucion? o existe otra manera de hacerlo? ayuntamiento_panel_mejorar = guiCreateWindow(0.29, 0.27, 0.51, 0.55, "", true) guiWindowSetSizable(ayuntamiento_panel_mejorar, false) casa_lbl_me = guiCreateLabel(0.27, 0.11, 0.46, 0.06, "", true, ayuntamiento_panel_mejorar) guiLabelSetHorizontalAlign(casa_lbl_me, "center", false) casa_mejorar_confirmar = guiCreateButton(0.38, 0.78, 0.27, 0.09, "upgrade", true, ayuntamiento_panel_mejorar) casacerrarme = guiCreateButton(0.89, 0.08, 0.07, 0.08, "x", true, ayuntamiento_panel_mejorar) lbl_info = guiCreateLabel(0.26, 0.26, 0.49, 0.34, "Upgrade this building.", true, ayuntamiento_panel_mejorar) guiLabelSetHorizontalAlign(lbl_info, "center", false) guiLabelSetVerticalAlign(lbl_info, "center") tiempo = guiCreateLabel(0.44, 0.71, 0.18, 0.07, "0 %", true, ayuntamiento_panel_mejorar) label = guiCreateLabel(0.47, 0.88, 0.12, 0.07, "", true, ayuntamiento_panel_mejorar) guiLabelSetHorizontalAlign(label, "center", false) guiLabelSetVerticalAlign(label, "center") guiLabelSetHorizontalAlign(tiempo, "center", false) Bar = guiCreateProgressBar(0.31, 0.62, 0.39, 0.07, true, ayuntamiento_panel_mejorar) showCursor ( true ) ttime = 10 value = 0 function conf() if source == casa_mejorar_confirmar then theTimer = setTimer( func, 1000, 0) guiSetText(label,ttime.. " sec") guiSetProperty(casa_mejorar_confirmar,"Disabled","true") end end addEventHandler ("onClientGUIClick", getRootElement(), conf) function func() local percent = guiProgressBarGetProgress(Bar) local value = (100/ttime) local progress = percent + value guiProgressBarSetProgress(Bar, progress) guiSetText(tiempo,percent.. " %") if guiProgressBarGetProgress(Bar) == 100 then guiProgressBarSetProgress(Bar, 0) killTimer ( theTimer ) outputChatBox("Done!", 0,255,0) guiSetText(tiempo,"0 %") guiSetText(label,"") guiSetProperty(casa_mejorar_confirmar,"Disabled","false") end end function close_panel() if source == casacerrarme then guiSetVisible ( ayuntamiento_panel_mejorar, false ) showCursor ( false ) end end addEventHandler ("onClientGUIClick", getRootElement(), close_panel)
  6. Here i have a variable "ttime" which is used to define seconds, in this case. I calculate the 1% of the variable "ttime" to add to the progressBar every second. The problem is this: If my variable "ttime" is <= 100 everything works fine, but when "ttime" > 100 , the progressBar just don't increases. I've noticed that when the "value" variable's result is 0.5, 0.58, 0.9, anything between 0 and 1 this happens. is there any solution? or some other way to do this? ayuntamiento_panel_mejorar = guiCreateWindow(0.29, 0.27, 0.51, 0.55, "", true) guiWindowSetSizable(ayuntamiento_panel_mejorar, false) casa_lbl_me = guiCreateLabel(0.27, 0.11, 0.46, 0.06, "", true, ayuntamiento_panel_mejorar) guiLabelSetHorizontalAlign(casa_lbl_me, "center", false) casa_mejorar_confirmar = guiCreateButton(0.38, 0.78, 0.27, 0.09, "upgrade", true, ayuntamiento_panel_mejorar) casacerrarme = guiCreateButton(0.89, 0.08, 0.07, 0.08, "x", true, ayuntamiento_panel_mejorar) lbl_info = guiCreateLabel(0.26, 0.26, 0.49, 0.34, "Upgrade this building.", true, ayuntamiento_panel_mejorar) guiLabelSetHorizontalAlign(lbl_info, "center", false) guiLabelSetVerticalAlign(lbl_info, "center") tiempo = guiCreateLabel(0.44, 0.71, 0.18, 0.07, "0 %", true, ayuntamiento_panel_mejorar) label = guiCreateLabel(0.47, 0.88, 0.12, 0.07, "", true, ayuntamiento_panel_mejorar) guiLabelSetHorizontalAlign(label, "center", false) guiLabelSetVerticalAlign(label, "center") guiLabelSetHorizontalAlign(tiempo, "center", false) Bar = guiCreateProgressBar(0.31, 0.62, 0.39, 0.07, true, ayuntamiento_panel_mejorar) showCursor ( true ) ttime = 10 value = 0 function conf() if source == casa_mejorar_confirmar then theTimer = setTimer( func, 1000, 0) guiSetText(label,ttime.. " sec") guiSetProperty(casa_mejorar_confirmar,"Disabled","true") end end addEventHandler ("onClientGUIClick", getRootElement(), conf) function func() local percent = guiProgressBarGetProgress(Bar) local value = (100/ttime) local progress = percent + value guiProgressBarSetProgress(Bar, progress) guiSetText(tiempo,percent.. " %") if guiProgressBarGetProgress(Bar) == 100 then guiProgressBarSetProgress(Bar, 0) killTimer ( theTimer ) outputChatBox("Done!", 0,255,0) guiSetText(tiempo,"0 %") guiSetText(label,"") guiSetProperty(casa_mejorar_confirmar,"Disabled","false") end end function close_panel() if source == casacerrarme then guiSetVisible ( ayuntamiento_panel_mejorar, false ) showCursor ( false ) end end addEventHandler ("onClientGUIClick", getRootElement(), close_panel)
  7. the first one option, i just try to understand this (sql) with a easy example like this
  8. What is wrong here? addEventHandler("onResourceStart", resourceRoot, function () connection = dbConnect("sqlite", "data.db") dbExec(connection, "CREATE TABLE IF NOT EXISTS data (ID INT, cuenta TEXT, deaths INT)") end) function player_Wasted ( ammo, attacker, weapon, bodypart ) local deathss = getElementData(source, "deaths") dbExec(connection,"UPDATE data SET deaths = ? WHERE cuenta = ?", tostring(deathss)+1, source) end addEventHandler ( "onPlayerWasted", getRootElement(), player_Wasted )
  9. Cocodrilo

    VIP

    Client: call ( getResourceFromName ( "scoreboard" ), "scoreboardAddColumn", "VIP", root, 25 ) function funcion ( ) local Deadusergroup = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..Deadusergroup, aclGetGroup("VIP")) then setElementData ( source, "VIP", "Si" ) else setElementData ( source, "VIP", "No" ) end end addEventHandler ( "onPlayerLogin", getRootElement(), funcion )
  10. Un ejemplo: Client --creas la barra barra = guiCreateProgressBar(0.78, 0.30, 0.17, 0.05, true) --Funcion para hacer aumentar +1 la barra function greetingHandler ( ) guiProgressBarSetProgress ( barra, ( guiProgressBarGetProgress ( barra ) + 1) ) local thePlayer = getLocalPlayer() local mu = guiProgressBarGetProgress (barra) if mu >= 100 then guiProgressBarSetProgress(barra, 0) progCount = progCount+1 end end addEvent ( "geet", true ) addEventHandler ( "geet", getRootElement(), greetingHandler ) Server --evento para que aumente por cada zombie kill addEvent ( "onZombieWasted", true ) addEventHandler ( "onZombieWasted", root, function ( theKiller ) triggerClientEvent(theKiller, "geet", getRootElement()) end ) Para lo de 10/100 , 50/100 deberias de darle un elementData al player en la funcion 'greetingHandler' Y después hacerla mostrar ya sea por un label o un dx.
  11. JAJAJA no vale madre, no sirve jajaja buen video, que bien que hagas esto para las personas interesadas en script que apenas comienzan, sigue asi, suerte
  12. objeto = createObject ( .... setElementDimension ( objeto, dim ) --(tambien le puedes dar interior) setElementInterior ( objeto, int )
  13. GUIEditor = { gridlist = {}, window = {}, button = {}, label = {} } GUIEditor.window[1] = guiCreateWindow(352, 69, 599, 652, "eTunes - Comprar Canciones", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.gridlist[1] = guiCreateGridList(30, 63, 230, 498, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Canciones", 0.9) GUIEditor.label[1] = guiCreateLabel(276, 73, 130, 19, "Nombre de la cancion: ", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[1], "right", false) NombreDeLaCancion = guiCreateLabel(406, 73, 139, 19, "", false, GUIEditor.window[1]) guiLabelSetHorizontalAlign(NombreDeLaCancion, "center", false) GUIEditor.label[2] = guiCreateLabel(276, 92, 130, 19, "Artista: ", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[2], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[2], "right", false) ArtistaDeLaCancion = guiCreateLabel(406, 92, 139, 19, "", false, GUIEditor.window[1]) guiLabelSetHorizontalAlign(ArtistaDeLaCancion, "center", false) GUIEditor.label[3] = guiCreateLabel(276, 111, 130, 19, "Album: ", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[3], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[3], "right", false) AlbumDeLaCancion = guiCreateLabel(406, 111, 139, 19, "", false, GUIEditor.window[1]) guiLabelSetHorizontalAlign(AlbumDeLaCancion, "center", false) GUIEditor.label[4] = guiCreateLabel(276, 233, 130, 19, "Precio: ", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[4], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[4], "right", false) PrecioDeLaCancion = guiCreateLabel(406, 233, 139, 19, "", false, GUIEditor.window[1]) guiLabelSetHorizontalAlign(PrecioDeLaCancion, "center", false) GUIEditor.button[1] = guiCreateButton(30, 567, 139, 60, "Tus Canciones", false, GUIEditor.window[1]) GUIEditor.button[2] = guiCreateButton(173, 567, 139, 60, "Comprar Canciones", false, GUIEditor.window[1]) GUIEditor.button[3] = guiCreateButton(316, 567, 139, 60, "Canciones Favoritas", false, GUIEditor.window[1]) GUIEditor.button[4] = guiCreateButton(364, 336, 181, 50, "Comprar Cancion", false, GUIEditor.window[1]) GUIEditor.label[5] = guiCreateLabel(464, 567, 125, 60, "Script Made By ElMota\nCopyright 2014 (c)", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[5], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[5], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[5], "center") GUIEditor.label[6] = guiCreateLabel(276, 130, 130, 19, "Ventas: ", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[6], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[6], "right", false) Ventas = guiCreateLabel(406, 130, 139, 19, "", false, GUIEditor.window[1]) guiLabelSetHorizontalAlign(Ventas, "center", false) GUIEditor.button[5] = guiCreateButton(364, 276, 82, 50, "Reproducir", false, GUIEditor.window[1]) GUIEditor.button[6] = guiCreateButton(463, 276, 82, 50, "Detener", false, GUIEditor.window[1]) GUIEditor.window[2] = guiCreateWindow(352, 69, 599, 652, "eTunes - Tus Canciones", false) guiWindowSetSizable(GUIEditor.window[2], false) GUIEditor.label[7] = guiCreateLabel(276, 73, 130, 19, "Nombre de la cancion: ", false, GUIEditor.window[2]) guiSetFont(GUIEditor.label[7], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[7], "right", false) NombreDeLaCancion2 = guiCreateLabel(406, 73, 139, 19, "", false, GUIEditor.window[2]) guiLabelSetHorizontalAlign(NombreDeLaCancion2, "center", false) GUIEditor.label[8] = guiCreateLabel(276, 92, 130, 19, "Artista: ", false, GUIEditor.window[2]) guiSetFont(GUIEditor.label[8], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[8], "right", false) ArtistaDeLaCancion2 = guiCreateLabel(406, 92, 139, 19, "", false, GUIEditor.window[2]) guiLabelSetHorizontalAlign(ArtistaDeLaCancion2, "center", false) GUIEditor.label[9] = guiCreateLabel(276, 111, 130, 19, "Album: ", false, GUIEditor.window[2]) guiSetFont(GUIEditor.label[9], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[9], "right", false) AlbumDeLaCancion2 = guiCreateLabel(406, 111, 139, 19, "", false, GUIEditor.window[2]) guiLabelSetHorizontalAlign(AlbumDeLaCancion2, "center", false) GUIEditor.gridlist[2] = guiCreateGridList(30, 63, 230, 498, false, GUIEditor.window[2]) guiGridListAddColumn(GUIEditor.gridlist[2], "Tus Canciones", 0.9) GUIEditor.button[7] = guiCreateButton(30, 567, 139, 60, "Tus Canciones", false, GUIEditor.window[2]) GUIEditor.button[8] = guiCreateButton(173, 567, 139, 60, "Comprar Canciones", false, GUIEditor.window[2]) GUIEditor.button[9] = guiCreateButton(316, 567, 139, 60, "Canciones Favoritas", false, GUIEditor.window[2]) GUIEditor.button[10] = guiCreateButton(364, 278, 81, 50, "Reproducir", false, GUIEditor.window[2]) GUIEditor.label[10] = guiCreateLabel(464, 567, 125, 60, "Script Made By ElMota\nCopyright 2014 (c)", false, GUIEditor.window[2]) guiSetFont(GUIEditor.label[10], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[10], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[10], "center") GUIEditor.label[11] = guiCreateLabel(276, 230, 130, 19, "Reproducciones: ", false, GUIEditor.window[2]) guiSetFont(GUIEditor.label[11], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[11], "right", false) ReproduccionesDeLaCancion = guiCreateLabel(406, 230, 139, 19, "", false, GUIEditor.window[2]) guiLabelSetHorizontalAlign(ReproduccionesDeLaCancion, "center", false) GUIEditor.button[11] = guiCreateButton(364, 338, 181, 50, "Convertir En Favorita", false, GUIEditor.window[2]) GUIEditor.button[12] = guiCreateButton(464, 278, 81, 50, "Detener", false, GUIEditor.window[2]) GUIEditor.window[3] = guiCreateWindow(352, 69, 599, 652, "eTunes - Canciones Favoritas", false) guiWindowSetSizable(GUIEditor.window[3], false) GUIEditor.label[12] = guiCreateLabel(276, 73, 130, 19, "Nombre de la cancion: ", false, GUIEditor.window[3]) guiSetFont(GUIEditor.label[12], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[12], "right", false) NombreDeLaCancion3 = guiCreateLabel(406, 73, 139, 19, "", false, GUIEditor.window[3]) guiLabelSetHorizontalAlign(NombreDeLaCancion3, "center", false) GUIEditor.label[13] = guiCreateLabel(276, 92, 130, 19, "Artista: ", false, GUIEditor.window[3]) guiSetFont(GUIEditor.label[13], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[13], "right", false) ArtistaDeLaCancion3 = guiCreateLabel(406, 92, 139, 19, "", false, GUIEditor.window[3]) guiLabelSetHorizontalAlign(ArtistaDeLaCancion3, "center", false) GUIEditor.label[14] = guiCreateLabel(276, 111, 130, 19, "Album: ", false, GUIEditor.window[3]) guiSetFont(GUIEditor.label[14], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[14], "right", false) AlbumDeLaCancion3 = guiCreateLabel(406, 111, 139, 19, "", false, GUIEditor.window[3]) guiLabelSetHorizontalAlign(AlbumDeLaCancion3, "center", false) GUIEditor.gridlist[3] = guiCreateGridList(30, 63, 230, 498, false, GUIEditor.window[3]) guiGridListAddColumn(GUIEditor.gridlist[3], "Canciones Favoritas", 0.9) GUIEditor.button[13] = guiCreateButton(30, 567, 139, 60, "Tus Canciones", false, GUIEditor.window[3]) GUIEditor.button[14] = guiCreateButton(173, 567, 139, 60, "Comprar Canciones", false, GUIEditor.window[3]) GUIEditor.button[15] = guiCreateButton(316, 567, 139, 60, "Canciones Favoritas", false, GUIEditor.window[3]) GUIEditor.button[16] = guiCreateButton(364, 278, 82, 50, "Reproducir", false, GUIEditor.window[3]) GUIEditor.label[15] = guiCreateLabel(464, 567, 125, 60, "Script Made By ElMota\nCopyright 2014 (c)", false, GUIEditor.window[3]) guiSetFont(GUIEditor.label[15], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[15], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[15], "center") GUIEditor.label[16] = guiCreateLabel(276, 230, 130, 19, "Reproducciones: ", false, GUIEditor.window[3]) guiSetFont(GUIEditor.label[16], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[16], "right", false) ReproduccionesDeLaCancion2 = guiCreateLabel(406, 230, 139, 19, "", false, GUIEditor.window[3]) guiLabelSetHorizontalAlign(ReproduccionesDeLaCancion2, "center", false) GUIEditor.button[17] = guiCreateButton(364, 338, 181, 50, "Convertir En Favorita", false, GUIEditor.window[3]) GUIEditor.button[18] = guiCreateButton(463, 278, 82, 50, "Detener", false, GUIEditor.window[3]) guiSetVisible(GUIEditor.window[1],false) guiSetVisible(GUIEditor.window[2],false) guiSetVisible(GUIEditor.window[3],false) addCommandHandler("etunes",function() if guiGetVisible(GUIEditor.window[1]) == true then guiSetVisible(GUIEditor.window[1],false) showCursor(false) elseif guiGetVisible(GUIEditor.window[1]) == false then guiSetVisible(GUIEditor.window[1],true) showCursor(true) elseif guiGetVisible(GUIEditor.window[2]) == true then guiSetVisible(GUIEditor.window[2],false) showCursor(false) elseif guiGetVisible(GUIEditor.window[3]) == true then guiSetVisible(GUIEditor.window[3],false) showCursor(false) end end ) addEventHandler("onClientGUIClick",GUIEditor.button[1],function() guiSetVisible(GUIEditor.window[1],false) guiSetVisible(GUIEditor.window[2],true) end)
  14. Yo entiendo y trato de hacer el script lo mas corto posible. Que por cierto tu ejemplo fue unas lineas mas largo que el mio. Pero bueno, a como leí por ahi.. cada quien tiene sus propias maneras. (:
  15. @GHz30 Te recomiendo que leas bien como se usan correctamente las funciones y eventos addEvent addCommandHandler exports.scoreboard:scoreboardAddColumn No te ofendas pero cada cosa que pones no tiene sentido. Cuando no puedes ayudar no hay de más. Yo en lo personal no comento cosas que no se. Y cuando las sé y puedo ayudar lo hago. Tu intención de ayudar esta clara pero que sentido tiene comentar algo que no se sabe? Lo probaste? te funcionó? a simple vista se pueden observar muchos errores sin necesidad de probarlo.
  16. Client addEventHandler ("onClientPlayerDamage", root, function (attacker) if ( attacker and getElementType(attacker) == "player" ) then if ( getPlayerTeam(source) ~= getTeamFromName("STAFF")) then cancelEvent() end end end) Server addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), function( ) theTeam = createTeam ( "STAFF", 143, 143, 16 ) end) addCommandHandler("equipoadm", function () if ( isObjectInACLGroup("user."..getAccountName(getPlayerAccount( playerSource )), aclGetGroup("lvl 1"))) or ( isObjectInACLGroup("user."..getAccountName(getPlayerAccount( playerSource )), aclGetGroup("lvl 2"))) or ( isObjectInACLGroup("user."..getAccountName(getPlayerAccount( playerSource )), aclGetGroup("lvl 3"))) or ( isObjectInACLGroup("user."..getAccountName(getPlayerAccount( playerSource )), aclGetGroup("lvl 4"))) or ( isObjectInACLGroup("user."..getAccountName(getPlayerAccount( playerSource )), aclGetGroup("lvl 5"))) or ( isObjectInACLGroup("user."..getAccountName(getPlayerAccount( playerSource )), aclGetGroup("lvl 10"))) then setPlayerTeam (playerSource, theTeam) end end)
  17. oh, recien veo. Solo onClientPlayerDamage
  18. server addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), function( ) theTeam = createTeam ( "STAFF", 143, 143, 16 ) end) addCommandHandler("equipoadm", function (playerSource) if ( isObjectInACLGroup("user."..getAccountName(getPlayerAccount( playerSource )), aclGetGroup("lvl 1"))) or ( isObjectInACLGroup("user."..getAccountName(getPlayerAccount( playerSource )), aclGetGroup("lvl 2"))) or ( isObjectInACLGroup("user."..getAccountName(getPlayerAccount( playerSource )), aclGetGroup("lvl 3"))) or ( isObjectInACLGroup("user."..getAccountName(getPlayerAccount( playerSource )), aclGetGroup("lvl 4"))) or ( isObjectInACLGroup("user."..getAccountName(getPlayerAccount( playerSource )), aclGetGroup("lvl 5"))) or ( isObjectInACLGroup("user."..getAccountName(getPlayerAccount( playerSource )), aclGetGroup("lvl 10"))) then setPlayerTeam (playerSource, theTeam) end end) addEventHandler ("onPlayerDamage", root, function (attacker) if ( attacker ) and getPlayerTeam(source) ~= getTeamFromName("STAFF")then then cancelEvent() end end )
  19. Pd. Edité un poco el código para reducir lineas. De nada
  20. El código que puse funciona bien. Pero como que no entendí del todo lo que el quiere hacer. Faltó que se explicara un poco mejor
  21. client GUIEditor = { button = {}, window = {}, memo = {}, } PanelObjetosMapa = guiCreateWindow(124, 50, 579, 354, "Panel de objetos de mapeo ~ By: Tomasito", false) guiWindowSetSizable(PanelObjetosMapa, false) guiSetVisible(PanelObjetosMapa,false) Close = guiCreateButton(470, 309, 99, 35, "Cerrar", false, PanelObjetosMapa) guiSetFont(Close, "sa-header") guiSetProperty(Close, "NormalTextColour", "C8E70000") BORRAR = guiCreateButton(352, 309, 99, 35, "borrar", false, PanelObjetosMapa) guiSetFont(BORRAR, "sa-header") guiSetProperty(BORRAR, "NormalTextColour", "C8E70000") --GUIEditor.button[1] = guiCreateButton(-451, -44, 51, 15, "", false, Close) Gate1V = guiCreateButton(10, 50, 70, 27, "Gate1", false, PanelObjetosMapa) Gate8V = guiCreateButton(10, 271, 70, 27, "Gate7", false, PanelObjetosMapa) Gate2V = guiCreateButton(10, 98, 70, 27, "Gate2", false, PanelObjetosMapa) Gate9V = guiCreateButton(10, 317, 70, 27, "Gate8", false, PanelObjetosMapa) Gate3V = guiCreateButton(10, 141, 70, 27, "Gate4", false, PanelObjetosMapa) Gate6V = guiCreateButton(10, 225, 70, 27, "Gate6", false, PanelObjetosMapa) Gate4V = guiCreateButton(10, 184, 70, 27, "Gate5", false, PanelObjetosMapa) Memo = guiCreateMemo(9, 23, 560, 27, "Al hacer click en cada boton aparecera un objeto diferente. ", false, PanelObjetosMapa) guiMemoSetReadOnly(Memo, true) addCommandHandler ( "panel", function () local value = guiGetVisible(PanelObjetosMapa) guiSetVisible(PanelObjetosMapa,not value) showCursor (not value) end) addEventHandler("onClientGUIClick", Gate1V , function () triggerServerEvent ( "crearGate1V", getLocalPlayer() ) end) addEventHandler("onClientGUIClick", Close , function () guiSetVisible (PanelObjetosMapa,false) showCursor(false) end) addEventHandler("onClientGUIClick", BORRAR , function() triggerServerEvent ( "borrarTodo", getLocalPlayer() ) guiSetVisible (PanelObjetosMapa,false) showCursor(false) end) server todoslosobjetos = {} addEvent( "crearGate1V", true ) addEventHandler( "crearGate1V", getRootElement(), function () local x, y, z = getElementPosition (source) objeto = createObject (976, x + 0.1, y + 0.1, z, 0, 0, 0) if (objeto) then outputChatBox ( "Objeto creado", source, 0, 255, 0) table.insert(todoslosobjetos, objeto) end end) addEvent( "borrarTodo", true ) addEventHandler( "borrarTodo", getRootElement(), function() for i, v in ipairs ( todoslosobjetos ) do if ( isElement(v) ) then destroyElement(v) outputChatBox ( "Todos los objetos han sido borrados", source, 0, 255, 0) end end end)
×
×
  • Create New...