Jump to content

LPM//Bruno

Members
  • Posts

    94
  • Joined

  • Last visited

Everything posted by LPM//Bruno

  1. Hola amigos de la forum de MTA:SA ando con un problema muy grave en mi servidor El problema es que en el webadmin (puerto 22005) al entrar me pide usuario y contraseña, pongo la cuenta con la que soy admin, y inicia excelente, pero no estan los botones para elegir es decir ahi tendrian que haber botones que dicen Resource browser etc, cuando finalizo todos los resources (/stopall) esos botones funcionan, pero cuando inicio el servidor de 0 ya no funcionan, y si inicio los resources 1 por 1 sigue sin funcionar. ¿Alguna solucion? Asi es como se ve
  2. Basado en otro script he creado algo mejor, con GUI incluida y todo...el problema es que a veces funciona y aveces no, es raro, que podra ser? client: function unfuck(text) return string.gsub(text, "(#%x%x%x%x%x%x)", function(colorString) return "" end) end function onModeratorButtonClick() local row, col = guiGridListGetSelectedItem(playerList) if row == -1 or col == -1 then return end local name = guiGridListGetItemText(playerList, row, col) local target = getPlayerFromName(name) if target then triggerServerEvent("darvsk", getLocalPlayer(), target, "Moderator") end end function onSuperModeratorButtonClick() local row, col = guiGridListGetSelectedItem(playerList) if row == -1 or col == -1 then return end local name = guiGridListGetItemText(playerList, row, col) local target = getPlayerFromName(name) if target then triggerServerEvent("sacarvsk", getLocalPlayer(), target, "SuperModerator") end end addEventHandler("onClientResourceStart",resourceRoot, function() GUIEditor_Grid = {} Window1 = guiCreateWindow(207,287,400,300,"MTA-LPM | Clanes",false) Moderator = guiCreateButton(18,32,83,37,"Agregar",false,Window1) guiSetFont(Moderator,"default-bold-small") addEventHandler("onClientGUIClick", Moderator, onModeratorButtonClick, true ) SuperModerator = guiCreateButton(18,94,86,40,"Sacar",false,Window1) guiSetFont(SuperModerator,"default-bold-small") addEventHandler("onClientGUIClick", SuperModerator, onSuperModeratorButtonClick, true ) playerList = guiCreateGridList ( 112, 35, 290, 200, false,Window1 ) local column = guiGridListAddColumn( playerList, "Lista de jugadores ONLINE", 0.9 ) for id, player in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( playerList ) guiGridListSetItemText ( playerList, row, column, unfuck(getPlayerName(player)), false, false ) guiGridListSetItemColor ( playerList, row, column, 0, 250, 154, 255 ) end guiCreateStaticImage( 15,175, 100, 100, "data/logo.png", false,Window1 ) fechar = guiCreateButton(300,250,100,35,"Cerrar",false,Window1) guiSetVisible(Window1, false) addEventHandler("onClientGUIClick", fechar, function() guiSetVisible( Window1, false) showCursor( false) end, false ) end) addEvent("openWindowVSK",true) function openWindowVSK() guiSetVisible(Window1, true) showCursor(true) end addEventHandler("openWindowVSK", getRootElement(), openWindowVSK) function atualizarlista() guiGridListClear(playerList) for id, players in ipairs (getElementsByType("player")) do local row = guiGridListAddRow(playerList) guiGridListSetItemText(playerList, row, 1, unfuck(getPlayerName(players)), false, false) guiGridListSetItemColor ( playerList, row, 1, 0, 250, 154, 255 ) end end addEventHandler("onClientPlayerJoin", getRootElement(), atualizarlista) addEventHandler("onClientPlayerQuit", getRootElement(), atualizarlista) addEventHandler("onClientPlayerChangeNick", getRootElement(), atualizarlista)
  3. Perdon no me di cuenta a la hora de ponerlo, lo mismo con el mensaje, era una forma de ponerlo para que funcione si notas he puesto [LPM-2] y en la primera [LPM] solo para verificar si funcionaba el "else" esque nunca lo había echo.
  4. Hola gente de la Forum de MTA SA, en esta ocasión vengo a pedir ayuda porque no se cómo hacer esta parte de un script que he descargado desde la Community. El resource que descargué fue trabajo-de-pesquero ( Link en la Community ) El resource funciona de maravilla, sólo le he echo unos ajustes a mi gusto, el problema es que cuando se spawnea un barco puedes volver a spawnearlo nuevamente las veces que quieras y temo que bugeen y hagan mucho lag en mi servidor con ese problemita. ¿Me podrán ayudar? Aquí el serverside: local join = createMarker( -2975.974609375, 504.951171875, 1.3, "cylinder", 1.3, 255, 255, 0, 150) function joinjob(localPlayer) if (getElementType(localPlayer) == "player") and not ( isPedInVehicle( localPlayer ) ) then triggerClientEvent (localPlayer,"pesquero",getRootElement(),localPlayer) end end addEventHandler ("onMarkerHit", join, joinjob) createBlip( -2975.974609375, 504.951171875, 2.4296875, 56, 3, 0, 0, 255, 255, 0, 250) local Barcos = { [ 453 ] = true, [ 453 ] = true } local BarcosSkins = { [ 210 ] = true, [ 225 ] = true } local barcoTable = { { -3038.4482421875, 604.1875, -0.340974599123 }, { -3095.3408203125, 766.5185546875, -0.31019884347916 }, { -3161.6103515625, 903.453125, -0.35642492771149 }, { -3094.2880859375, 998.7802734375, -0.32000458240509 }, { -3027.7529296875, 922.7392578125, -0.34394550323486 }, { -3041.1240234375, 856.3134765625, -0.3497366309166 }, { -3053.4599609375, 750.5791015625, -0.33944514393806 }, { -3045.521484375, 643.712890625, -0.375756919384 }, { -3057.8583984375, 549.732421875, -0.36067345738411 }, { -3143.16796875, 504.248046875, -0.39858004450798 }, { -3198.35546875, 605.2978515625, -0.35631018877029 }, { -3306.8505859375, 744.03125, -0.32741913199425 }, { -3430.1376953125, 963.283203125, -0.37901026010513 }, { -3384.814453125, 1068.4091796875, -0.32916113734245 }, { -3278.1748046875, 1114.71875, -0.3424257338047 }, } function getRandombarcoTable ( ) return unpack ( barcoTable [ math.random ( #barcoTable ) ] ) end function createbarcoTeam ( ) theTeam = createTeam ( "Pesquero", 255, 255, 0 ) end addEventHandler ( "onResourceStart", resourceRoot, createbarcoTeam ) addEventHandler ( "onVehicleStartEnter", root, function ( player, seat, jacked, door ) if ( Barcos [ getElementModel ( source ) ] ) and ( not BarcosSkins [ getElementModel ( player ) ] ) and ( seat == 0 ) then cancelEvent ( ) end end ) spawned = false vehiculo = createVehicle ( 453, 0, 0, 0 ) function joinBarco( skin ) local x, y, z = getElementPosition ( source ) if vehiculo and (spawned == false) then setElementPosition ( vehiculo, x+5, y+4, z+2 ) setPlayerTeam ( source, theTeam ) setElementModel ( source, skin ) setElementData ( source, "Ocupacion", "Trabajo de Pesquero", true ) outputChatBox ( "[LPM] Subite al barco y anda hacia los marcadores para pescar y recibir dinero.",source, 0, 255, 0 ) destroyElement ( vehiculo2 ) spawned = true else spawned = false destroyElement ( vehiculo ) setPlayerTeam ( source, theTeam ) setElementModel ( source, skin ) setElementData ( source, "Ocupacion", "Trabajo de Pesquero", true ) outputChatBox ( "[LPM-2] Subite al barco y anda hacia los marcadores para pescar y recibir dinero.",source, 0, 255, 0 ) end end addEvent ( "setBarco", true ) addEventHandler ( "setBarco", root, joinBarco ) function getNewBarcoLocation ( thePlayer ) local x, y, z = getRandombarcoTable ( ) triggerClientEvent ( thePlayer, "barco_set_location", thePlayer, x, y, z ) end function onVehicleEnter ( thePlayer ) if ( not Barcos [ getElementModel ( source ) ] ) then return end if ( not getPlayerTeam ( thePlayer ) ) then return end if ( getTeamName ( getPlayerTeam ( thePlayer ) ) == "Pesquero" ) then getNewBarcoLocation ( thePlayer ) end end addEventHandler ( "onVehicleEnter", root, onVehicleEnter ) addEvent ( "pizza_finish", true ) addEventHandler("pizza_finish", root, function ( ) if ( not isPedInVehicle ( source ) ) then return end local vehicle = getPedOccupiedVehicle ( source ) if ( not Barcos [ getElementModel ( vehicle ) ] ) then return end local money = math.random ( 800, 1600 ) givePlayerMoney ( source, money ) setElementFrozen ( vehicle, true ) fadeCamera(source, false, 1.-- s8) --> setTimer(fadeCamera, 1500, 1, source, true) setElementFrozen ( vehicle, false ) getNewBarcoLocation ( source ) end ) Espero que puedan ayudarme Saludos.
  5. No se mucho de Grupos de ACL, pero puedes intentar esto: -- [ CLAN LG ] -- function darlg (playerSource, commandName, accountName) if accountName and isObjectInACLGroup( 'user.CUENTA', aclGetGroup( 'Clan-LG' ) ) then aclGroupAddObject (aclGetGroup("Clan-LG"), "user."..accountName) outputChatBox ("[LPM] Cuenta '"..accountName.."' añadida al Clan LG.", playerSource, 0,255,0) else outputChatBox ("No se especifico la cuenta.", playerSource, 255,0,0) outputChatBox ("Escritura correcta: /añadirlg [CUENTA]", playerSource, 255,255,0) end end addCommandHandler ("añadirlg", darlg) -- function eliminarlg (playerSource, commandName, accountName) local account = getPlayerAccount(thePlayer) if accountName and isObjectInACLGroup( 'user.CUENTA', aclGetGroup( 'Clan-LG' ) ) then aclGroupRemoveObject (aclGetGroup("Clan-LG"), "user."..accountName) outputChatBox ("[LPM] Cuenta '"..accountName.."' eliminada del Clan LG.", playerSource, 255,0,0) else outputChatBox ("No se especifico la cuenta.", playerSource, 255,0,0) outputChatBox ("Escritura correcta: /eliminarlg [CUENTA]", playerSource, 255,255,0) end end addCommandHandler ("eliminarlg", eliminarlg) intenta ese a ver, no se que otras formas podrías usar ya que usas Grupos de ACL solo cambie la linea del "if .... then", solo reemplaza "CUENTA" por la cuenta de la persona que quieres que use ese comando. EDIT: tambien podrias crear otro Grupo ACL especial para los lideres o personas que puedan usar ese Comando, Como Lideres-Clan-LG. Solo digo, como dije no se mucho del ACL. Gracias! Lo intentaré EDIT: No funciono :\
  6. Hola a todos ando con un problema creando mi script. Quiero que sólo una cuenta determinada pueda utilizar el comando /añadirlg y /eliminarlg que la funcion de los comandos es añadir o eliminar cuentas de un ACL. Aqui el script: -- [ CLAN LG ] -- function darlg (playerSource, commandName, accountName) if accountName and isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount(playerSource) ), aclGetGroup( 'Clan-LG' ) ) then aclGroupAddObject (aclGetGroup("Clan-LG"), "user."..accountName) outputChatBox ("[LPM] Cuenta '"..accountName.."' añadida al Clan LG.", playerSource, 0,255,0) else outputChatBox ("No se especifico la cuenta.", playerSource, 255,0,0) outputChatBox ("Escritura correcta: /añadirlg [CUENTA]", playerSource, 255,255,0) end end addCommandHandler ("añadirlg", darlg) -- function eliminarlg (playerSource, commandName, accountName) local account = getPlayerAccount(thePlayer) if accountName and isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount(playerSource) ), aclGetGroup( 'Clan-LG' ) ) then aclGroupRemoveObject (aclGetGroup("Clan-LG"), "user."..accountName) outputChatBox ("[LPM] Cuenta '"..accountName.."' eliminada del Clan LG.", playerSource, 255,0,0) else outputChatBox ("No se especifico la cuenta.", playerSource, 255,0,0) outputChatBox ("Escritura correcta: /eliminarlg [CUENTA]", playerSource, 255,255,0) end end addCommandHandler ("eliminarlg", eliminarlg) ¿Podrán ayudarme? Gracias :3 Saludos
  7. Hola amigos tengo un problema con mi GUI que he echo desde 0 por mi y me ayudo un poco lLinux. Tengo un problema, cuando abro la GUI todos pueden verla y clickearla, cerrarla etc como si se abriese desde la pc del otro jugador hacia todas las pc de los player conectados. ¿que he echo mal? He aqui el codigo: (client) g_Me = getLocalPlayer() GUIEditor = { label = {} } panelvip = guiCreateWindow(271, 202, 257, 271, "Panel VIP | MTA-LPM", false) guiWindowSetSizable(panelvip, false) guiSetVisible (panelvip, false) botonhandlings = guiCreateButton(14, 33, 106, 39, "Handlings", false, panelvip) botonskinvip = guiCreateButton(138, 33, 106, 39, "Skin VIP", false, panelvip) botonarmasvip = guiCreateButton(138, 86, 106, 39, "Armas VIP", false, panelvip) botonjetpack = guiCreateButton(14, 86, 106, 39, "Jetpack", false, panelvip) botonchalecovip = guiCreateButton(138, 142, 106, 39, "Chaleco VIP", false, panelvip) botonstunt = guiCreateButton(14, 142, 106, 39, "Stunt", false, panelvip) botoncerrar = guiCreateButton(14, 196, 230, 39, "Cerrar", false, panelvip) GUIEditor.label[1] = guiCreateLabel(74, 245, 115, 20, "www.mtalpm.com.ar", false, panelvip) addCommandHandler ("vip" , "Ani open") --GUI HEADLING -- Aqui se crea la gui cuando inician el resource handlings = guiCreateWindow(141, 204, 125, 291, "Handlings VIP", false) guiWindowSetSizable(handlings, false) guiSetVisible(handlings, false) -- Este la oculta. botonpicada = guiCreateButton(9, 35, 106, 29, "Picada", false, handlings) botonpaseo = guiCreateButton(9, 74, 106, 29, "Paseo", false, handlings) botonhellaflush = guiCreateButton(9, 113, 106, 29, "Hellaflush", false, handlings) botonalpiso = guiCreateButton(9, 152, 106, 29, "Al piso", false, handlings) function botonhandlingsfunc() if (guiGetVisible(handlings) == false) then --Si la gui handlings es no es visible (esto no es necesario, pero asi queda bien.) guiSetVisible (handlings, true ) -- la pone visible else guiSetVisible (handlings, false ) --la pone invisible end addEventHandler ("onClientGUIClick" , botonpicada, botonpicadafunc, false) addEventHandler ("onClientGUIClick" , botonpaseo, botonpaseofunc, false) addEventHandler ("onClientGUIClick" , botonhellaflush, botonhellaflushfunc, false) addEventHandler ("onClientGUIClick" , botonalpiso, botonalpisofunc, false) end boton = { hand = {}, anim = {} } GUIEditor = { label = {}, window = {} } GUIEditor.window[1] = guiCreateWindow(533, 203, 125, 291, "Stunt VIP", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1],false) botonanim1 = guiCreateButton(10, 58, 105, 30, "Anim. 1", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(8, 26, 107, 15, "Animaciones", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "clear-normal") guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false) GUIEditor.label[2] = guiCreateLabel(8, 144, 107, 15, "Handlings", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[2], "clear-normal") guiLabelSetHorizontalAlign(GUIEditor.label[2], "center", false) botonanim2 = guiCreateButton(10, 98, 105, 30, "Anim. 2", false, GUIEditor.window[1]) botonhand1 = guiCreateButton(10, 173, 105, 30, "Handling 1", false, GUIEditor.window[1]) botonhand2 = guiCreateButton(10, 213, 105, 30, "Handling 2", false, GUIEditor.window[1]) function botonstuntfunc() if (guiGetVisible(GUIEditor.window[1]) == false) then --Si la gui handlings es no es visible (esto no es necesario, pero asi queda bien.) guiSetVisible (GUIEditor.window[1], true ) -- la pone visible else guiSetVisible (GUIEditor.window[1], false ) --la pone invisible end addEventHandler ("onClientGUIClick" , botonanim1, botonanim1func, false) addEventHandler ("onClientGUIClick" , botonanim2, botonanim2func, false) addEventHandler ("onClientGUIClick" , botonhand1, botonhand1func, false) addEventHandler ("onClientGUIClick" , botonhand2, botonhand2func, false) end function botonhand1func() triggerServerEvent ("HandlingStunt1",localPlayer) end function botonhand2func() triggerServerEvent ("HandlingStunt2",localPlayer) end anim1 = false function botonanim1func() if (anim1 == false) then anim1 = true anim2 = false triggerServerEvent ("StuntAnim1activado",localPlayer) else anim1 = false triggerServerEvent ("StuntAnim1desactivado",localPlayer) end end anim2 = false function botonanim2func() if (anim2 == false) then anim2 = true triggerServerEvent ("StuntAnim2activado",localPlayer) else anim2 = false anim1 = false triggerServerEvent ("StuntAnim2desactivado",localPlayer) end end -- Boton skin vip function botonskinvipfunc() triggerServerEvent ("SkinVIP",localPlayer) end -- Boton armas vip function botonarmasvipfunc() triggerServerEvent ("ArmasVIP",localPlayer) end -- Boton jetpack function botonjetpackfunc() triggerServerEvent ("Jetpack",localPlayer) end -- Boton chaleco vip function botonchalecovipfunc() triggerServerEvent ("ChalecoVIP",localPlayer) end -- Boton cerrar function botoncerrarfunc() showCursor (false) guiSetVisible (panelvip, false ) guiSetVisible (handlings, false ) guiSetVisible (GUIEditor.window[1], false ) end function botoncerrarfunc_stunt() guiSetVisible (GUIEditor.window[1], false ) end function botoncerrarfunc_handlings() guiSetVisible (handlings, false ) end ------------------ -- BOTONES HANDLING function botonpicadafunc() triggerServerEvent ("HandlingPicada",localPlayer) end function botonpaseofunc() triggerServerEvent ("HandlingPaseo",localPlayer) end function botonhellaflushfunc() triggerServerEvent ("HandlingHellaflush",localPlayer) end function botonalpisofunc() triggerServerEvent ("HandlingAlpiso",localPlayer) end -- OPEN GUI function opengui() if not guiGetVisible(panelvip) then ani_otworz() else ani_zamknij() end end bindKey( "F4", "down", "vip") addCommandHandler("Ani open", funcioncheck) addEvent( "Abrir", true ) addEventHandler( "Abrir", getRootElement(), opengui ) function funcioncheck() triggerServerEvent ("checkserver",localPlayer) end function ani_otworz() if not guiGetVisible(panelvip) and not guiGetVisible(handlings) and not guiGetVisible(GUIEditor.window[1]) then guiSetVisible(panelvip, true) showCursor(true) end addEventHandler ("onClientGUIClick" , botonhandlings, botonhandlingsfunc, false) addEventHandler ("onClientGUIClick" , botonskinvip, botonskinvipfunc, false) addEventHandler ("onClientGUIClick" , botonarmasvip, botonarmasvipfunc, false) addEventHandler ("onClientGUIClick" , botonjetpack, botonjetpackfunc, false) addEventHandler ("onClientGUIClick" , botonchalecovip, botonchalecovipfunc, false)
  8. Creo que cuando el comando es activado por 2 o más personas.
  9. Men luego de unos dias yo no entre a la carpeta "logs" pero se me dio por entrar a ver los logs y me veo con que el archivo server.log pesa 4GB y lo abri y tdo dice: [2014-06-08 22:09:09] WARNING: colorlights\server.lua:28: Bad 'vehicle' pointer @ 'setVehicleHeadLightColor'(1) Podrias ayudarme nuevamente?
  10. Estaba apurado xDD ahi lo edito el tema y pongo el code
  11. Hola muchachos otra vez tengo un problema En esta ocacion con el resource "greenzones"; ya no se como arreglarlo iva a cambiarme por antiZ que es de zombies. El tema es tengo un comando /dm creado por lLinux que cancela el daño del cliente, saca el HUD etc tambien hace que la vida no disminuya, cuando se lo pone pero cuando se entra a la greenzone, y luego se sale de la greenzone el daño vuelve al client, el hud, todo y con eso PERO... la vida no disminuye y mis clientes pueden atacar a la gente y no les hacen daño y abusan. Script creado por lLinux [CLIENT] modop = false function pasivo() if (modop == false) then modop = true addEventHandler ("onClientPlayerDamage", getLocalPlayer(), stopDamage) addEventHandler ("onClientPlayerStealthKill", getLocalPlayer(), stopDamage) addEventHandler ("onClientPedDamage", getLocalPlayer(), stopDamage) setElementAlpha (getLocalPlayer(), 255) toggleControl ("fire", false) toggleControl ("aim_weapon", false) toggleControl ("vehicle_fire", false) toggleControl ("vehicle_secondary_fire ", false) showPlayerHudComponent ("weapon", false) showPlayerHudComponent ("crosshair", false) showPlayerHudComponent ("ammo", false) triggerServerEvent("DmON", getLocalPlayer(), getLocalPlayer()) else modop = false removeEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopDamage ) removeEventHandler ( "onClientPlayerStealthKill", getLocalPlayer(), stopDamage ) removeEventHandler ( "onClientPedDamage", getLocalPlayer(), stopDamage ) setElementAlpha (getLocalPlayer(), 255) toggleControl ("fire", true) toggleControl ("aim_weapon", true) toggleControl ("vehicle_fire", true) toggleControl ("vehicle_secondary_fire ", true) showPlayerHudComponent ("weapon", true) showPlayerHudComponent ("crosshair", true) showPlayerHudComponent ("ammo", true) triggerServerEvent("DmOFF", getLocalPlayer(), getLocalPlayer()) end end addCommandHandler("dm", pasivo) function NoKill() if (modop == true) then addEventHandler ("onClientPlayerDamage", getLocalPlayer(), stopDamage) addEventHandler ("onClientPlayerStealthKill", getLocalPlayer(), stopDamage) addEventHandler ("onClientPedDamage", getLocalPlayer(), stopDamage) setElementAlpha (getLocalPlayer(), 255) toggleControl ("fire", false) toggleControl ("aim_weapon", false) toggleControl ("vehicle_fire", false) toggleControl ("vehicle_secondary_fire ", false) showPlayerHudComponent ("weapon", false) showPlayerHudComponent ("crosshair", false) showPlayerHudComponent ("ammo", false) end end addEventHandler("onClientPlayerWasted", getLocalPlayer(), NoKill) function stopDamage () cancelEvent() end Script greenzones [sERVER] addEventHandler ("onResourceStart",getResourceRootElement(getThisResource()), function() local allGreenzones = getElementsByType ("radararea") for i,v in ipairs (allGreenzones) do local r,g,b,a = getRadarAreaColor (v) if (r == 0) and (g == 255) and (b == 0) and (a == 127) then local x,y = getElementPosition (v) local sx,sy = getRadarAreaSize (v) local col = createColCuboid (x,y, -50, sx,sy, 7500) setElementID (col, "greenzoneColshape") end end end) addEventHandler ("onColShapeHit", getRootElement(), function(hitElement, matchingDimension) if (isElement(hitElement)) and (getElementType (hitElement) == "player") and (getElementID (source) == "greenzoneColshape") then toggleControl (hitElement, "fire", false) toggleControl (hitElement, "next_weapon", false) toggleControl (hitElement, "previous_weapon", false) toggleControl (hitElement, "aim_weapon", false) toggleControl (hitElement, "vehicle_fire", false) showPlayerHudComponent (hitElement, "ammo", false) showPlayerHudComponent (hitElement, "weapon", false) triggerClientEvent (hitElement, "enableGodMode", hitElement) end end) addEventHandler ("onColShapeLeave", getRootElement(), function(leaveElement, matchingDimension) if (getElementType (leaveElement) == "player") and (getElementID (source) == "greenzoneColshape") then toggleControl (leaveElement, "fire", true) toggleControl (leaveElement, "next_weapon", true) toggleControl (leaveElement, "previous_weapon", true) toggleControl (leaveElement, "aim_weapon", true) toggleControl (leaveElement, "vehicle_fire", true) showPlayerHudComponent (leaveElement, "ammo", true) showPlayerHudComponent (leaveElement, "weapon", true) triggerClientEvent (leaveElement, "disableGodMode", leaveElement) end end) Habra forma de solucionarlo? Gracias.
  12. Si se fijan hay canciones random como hago con eso? Gracias por responder.
  13. No entendí la parte que dice, "(tu se lo tienes que poner)" en el getTickCount lo entendí, pongo en el onClientRender, es la única forma que funciona con este login, y ... después no entendí la parte de tu se lo tienes qe poner el color a los autos y eso. Te refieres a que ponga setSkyGradient, setVehicleHeadLightColor etc etc? Saludos y gracias por responder.
  14. Ya lo arreglé por mi mismo Puse esto a la hora de renderizar la ventana wdw_LoginPanel (GUI principal) function updateCamera () if not(isElement(wdwLogin_Pannel)) then if blackLoginScreen == true then fadeCamera (false,blackScreenTime) end end end addEventHandler ( "onClientRender", wdwLogin_Pannel, updateCamera )
  15. Hola amigos como vannn ando queriendo hacer que mi panel de login sea mas divertido S: pero solo no puedo pìdo ayuda con esto... Yo le puse para que cuando la gente entre la pnatalla este toda negra(fadeCamera) y que haya musica en el logueo, una vez que terminaron de loguearse /iniciar sesion\ que la musica siga... y que la camara se libere y se pueda ver y mover, pero lo que quiero es que cuando la musica siga que el cielo halla colores y se cambien el color de los autos y las luces etc etc (modo disco digamosle) yo ya tengo el codigo de u script de disco: function rvc() for i, veh in ipairs(getElementsByType("vehicle")) do local r = math.random(255) local g= math.random(255) local b = math.random(255) setVehicleColor(veh, r, g, b) setVehicleOverrideLights (veh, 2 ) setVehicleHeadLightColor (veh, math.random(255), math.random(255), math.random(255)) end setSkyGradient (thePlayer, math.random (255), math.random (255), math.random (255), math.random (255), math.random (255), math.random (255)) setWaterColor(thePlayer, math.random (255), math.random (255), math.random (255)) end setTimer(rvc, 300, 0) lo que quiero hacer es que cuando la musica se detenga , los colores del cielo etc etc tambien se detengan , y otro problema es que quiero que solo el player pueda ver que cambia del color el cielo etc etc no todos los usuarios , porque cuando inicio el modo disco se le cambia a todos. aqui les dejo el clientside de mi login: wdwLogin_Pannel = {} tabPannel_Main = {} tab_Login = {} tab_Register = {} --Settings blackLoginScreen = true --True/false Black screen, while player login... blackScreenTime = 3 --Time to complete disappearance of the black screen in seconds. GuestEnable = false --Can a Player play as Guest, or no. [true/false] EnableMTAControlsOnLogin = false --Set false to not open the chat when you press "t" on fields, for example. [true/false] function open_log_reg_pannel() if not(isElement(wdwLogin_Pannel)) then if blackLoginScreen == true then fadeCamera (false,blackScreenTime) end local sWidth,sHeight = guiGetScreenSize() -- The variables local Width,Height = 350,390 --Main Window sizes local X = (sWidth/2) - (Width/2) --Main Window horizontal position local Y = (sHeight/2) - (Height/2) --Main Window vertical position toggleAllControls(EnableMTAControlsOnLogin) wdwLogin_Pannel = guiCreateWindow(X,Y,Width,Height,"MTA-LPM",false) guiWindowSetSizable(wdwLogin_Pannel,false) tabPannel_Main = guiCreateTabPanel(9,130,350,251,false,wdwLogin_Pannel) tab_Login = guiCreateTab("Iniciar sesion",tabPannel_Main) lbl_Login = guiCreateLabel(13,39,100,21,"Cuenta:",false,tab_Login) guiLabelSetVerticalAlign(lbl_Login,"center") guiLabelSetHorizontalAlign(lbl_Login,"right",false) guiSetFont(lbl_Login,"default-bold-small") edit_Login = guiCreateEdit(142,40,130,23,"",false,tab_Login) --Поле ввода логина edit_password = guiCreateEdit(142,71,130,23,"",false,tab_Login) --Поле ввода пароля guiEditSetMaxLength ( edit_Login,25) guiEditSetMaxLength ( edit_password,25) guiEditSetMasked ( edit_password, true ) lbl_Password = guiCreateLabel(13,71,100,21,"Clave:",false,tab_Login) guiLabelSetVerticalAlign(lbl_Password,"center") guiLabelSetHorizontalAlign(lbl_Password,"right",false) guiSetFont(lbl_Password,"default-bold-small") lbl_top_info = guiCreateStaticImage(36, 28, 261, 88, "logo.png", false, wdwLogin_Pannel) local sounds = {"sonido1.mp3","sonido2.mp3"} sonido = playSound (sounds[math.random(1, #sounds)]) --[[lbl_top_info = guiCreateLabel(74,6,244,35,"Enter with your username and password.",false,tab_Login) guiLabelSetColor(lbl_top_info,137,26,26) guiLabelSetVerticalAlign(lbl_top_info,"center") guiLabelSetHorizontalAlign(lbl_top_info,"center",false) guiSetFont(lbl_top_info,"default-bold-small")]] --[[lbl_about_legth = guiCreateLabel(142,42,184,18,"Max Length: 25 symbols",false,tab_Login) guiLabelSetColor(lbl_about_legth,253,255,68) guiLabelSetVerticalAlign(lbl_about_legth,"center") guiLabelSetHorizontalAlign(lbl_about_legth,"center",false)]] checkbox_save = guiCreateCheckBox(215,97,140,20,"Recordar",false,false,tab_Login) guiSetFont(checkbox_save,"default-small") btn_Login = guiCreateButton(110,150,130,40,"Iniciar sesion",false,tab_Login) guiSetFont(btn_Login,"default-bold-small") login_tab_error_msg = guiCreateLabel(0,112,350,25,"Error_login_tab",false,tab_Login) guiLabelSetColor(login_tab_error_msg,255,0,0) guiLabelSetVerticalAlign(login_tab_error_msg,"center") guiLabelSetHorizontalAlign(login_tab_error_msg,"center",false) guiSetFont(login_tab_error_msg,"default-bold-small") --Guest func if GuestEnable == true then btnGuest = guiCreateButton(29,168,94,32,"Play as Guest",false,tab_Login) guiSetFont(btnGuest,"default-small") guiSetVisible(btnGuest,true) else if isElement(btnGuest) then guiSetVisible(btnGuest,false) end btnGuest = nil end tab_Register = guiCreateTab("Registro",tabPannel_Main) lbl_account_name = guiCreateLabel(13,39,119,21,"Cuenta:",false,tab_Register) guiLabelSetVerticalAlign(lbl_account_name,"center") guiLabelSetHorizontalAlign(lbl_account_name,"right",false) guiSetFont(lbl_account_name,"default-bold-small") lbl_reg_top_info = guiCreateLabel(80,5,364,31,"No usar caracteres raros.",false,tab_Register) guiLabelSetColor(lbl_reg_top_info,255,234,55) guiLabelSetVerticalAlign(lbl_reg_top_info,"center") guiLabelSetHorizontalAlign(lbl_reg_top_info,"left",false) edit_account_name = guiCreateEdit(142,40,130,23,"",false,tab_Register) guiEditSetMaxLength ( edit_account_name,25) lbl__reg_tab_password = guiCreateLabel(13,71,119,21,"Clave:",false,tab_Register) guiLabelSetVerticalAlign(lbl__reg_tab_password,"center") guiLabelSetHorizontalAlign(lbl__reg_tab_password,"right",false) guiSetFont(lbl__reg_tab_password,"default-bold-small") edit__reg_tab_password = guiCreateEdit(142,71,130,23,"",false,tab_Register) guiEditSetMaxLength ( edit__reg_tab_password,25) edit__reg_tab_Repassword = guiCreateEdit(142,102,130,23,"",false,tab_Register) guiEditSetMaxLength ( edit__reg_tab_Repassword,25) lvl_reg_tab_Repassword = guiCreateLabel(13,102,119,21,"Repetir clave:",false,tab_Register) guiLabelSetVerticalAlign(lvl_reg_tab_Repassword,"center") guiLabelSetHorizontalAlign(lvl_reg_tab_Repassword,"right",false) guiSetFont(lvl_reg_tab_Repassword,"default-bold-small") btn_reg_tab_register = guiCreateButton(110,150,130,40,"Crear cuenta",false,tab_Register) guiSetFont(btn_reg_tab_register,"default-bold-small") reg_tab_error_msg = guiCreateLabel(0,170,350,31,"Error_reg_ttab",false,tab_Register) guiLabelSetColor(reg_tab_error_msg,255,20,0) guiLabelSetVerticalAlign(reg_tab_error_msg,"center") guiLabelSetHorizontalAlign(reg_tab_error_msg,"center",false) guiSetFont(reg_tab_error_msg,"default-bold-small") guiEditSetMasked(edit__reg_tab_password, true) guiEditSetMasked(edit__reg_tab_Repassword, true) guiSetVisible(wdwLogin_Pannel,true) --guiSetInputEnabled(true) showCursor(true) --Изменение надписей: guiSetText(reg_tab_error_msg, "") --Поле ошибки в Reg табе guiSetText(login_tab_error_msg, "") --Поле ошибки в Login табе local username, password = loadLoginFromXML() if not( username == "" or password == "") then guiCheckBoxSetSelected ( checkbox_save, true ) guiSetText ( edit_Login, tostring(username)) guiSetText ( edit_password, tostring(password)) else guiCheckBoxSetSelected ( checkbox_save, false ) guiSetText ( edit_Login, tostring(username)) guiSetText ( edit_password, tostring(password)) end --Эвенты addEventHandler("onClientGUIClick",btn_Login,onClickBtnLogin) addEventHandler("onClientGUIClick",btn_reg_tab_register,onClickBtnRegister) if GuestEnable == true then addEventHandler("onClientGUIClick",btnGuest,onClickGuest) end --else --destroyElement(wdwLogin_Pannel) --guiSetInputEnabled(false) --wdwLogin_Pannel = nil --showCursor(false) end end function updateCamera () if not(isElement(wdwLogin_Pannel)) then if blackLoginScreen == true then fadeCamera (false,blackScreenTime) end end end addEventHandler ( "onClientRender", wdwLogin_Pannel, updateCamera ) function start_cl_resource() --При старте open_log_reg_pannel() end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),start_cl_resource) function loadLoginFromXML() --Загрузка логина и пароля из XML local xml_save_log_File = xmlLoadFile ("files/xml/userdata.xml") if not xml_save_log_File then xml_save_log_File = xmlCreateFile("files/xml/userdata.xml", "login") end local usernameNode = xmlFindChild (xml_save_log_File, "username", 0) local passwordNode = xmlFindChild (xml_save_log_File, "password", 0) if usernameNode and passwordNode then return xmlNodeGetValue(usernameNode), xmlNodeGetValue(passwordNode) else return "", "" end xmlUnloadFile ( xml_save_log_File ) end function saveLoginToXML(username, password) --Сохрание логина и пароля в XML local xml_save_log_File = xmlLoadFile ("files/xml/userdata.xml") if not xml_save_log_File then xml_save_log_File = xmlCreateFile("files/xml/userdata.xml", "login") end if (username ~= "") then local usernameNode = xmlFindChild (xml_save_log_File, "username", 0) if not usernameNode then usernameNode = xmlCreateChild(xml_save_log_File, "username") end xmlNodeSetValue (usernameNode, tostring(username)) end if (password ~= "") then local passwordNode = xmlFindChild (xml_save_log_File, "password", 0) if not passwordNode then passwordNode = xmlCreateChild(xml_save_log_File, "password") end xmlNodeSetValue (passwordNode, tostring(password)) end xmlSaveFile(xml_save_log_File) xmlUnloadFile (xml_save_log_File) end addEvent("saveLoginToXML", true) addEventHandler("saveLoginToXML", getRootElement(), saveLoginToXML) function resetSaveXML() --Сохрание логина и пароля в XML local xml_save_log_File = xmlLoadFile ("files/xml/userdata.xml") if not xml_save_log_File then xml_save_log_File = xmlCreateFile("files/xml/userdata.xml", "login") end if (username ~= "") then local usernameNode = xmlFindChild (xml_save_log_File, "username", 0) if not usernameNode then usernameNode = xmlCreateChild(xml_save_log_File, "username") end end if (password ~= "") then local passwordNode = xmlFindChild (xml_save_log_File, "password", 0) if not passwordNode then passwordNode = xmlCreateChild(xml_save_log_File, "password") end xmlNodeSetValue (passwordNode, "") end
  16. Claro, pero yo también te explico: En Argentina la velocidad de descarga es muy baja es por eso que quiero que estén comprimidas no importa que en el cliente se descompriman eso no hay problema. EL problema es qe las resource yo las tengo COMPRIMIDAS EN ZIP y al descargarlas TODAS las deja en descomprimidas :\
  17. Ya no me ha dado problemas. ¡Muchas gracias Tomás!
  18. El server.log sigue dandome los errores
  19. Hola amigos otra vez tengo un problema con unos de mis resource. Tengo el resource "loginform" (Link en la community AQUI) Modificado por mi mismo, hice algunas modificaciones mínimas , traducción y una imágen estática, el problema es que viene con opcion de poner true/false para la opción fadeCamera para que cuando un jugador entre al juego se le vea toda la pantalla negra y sólo se vea el GUI. El problema es que cuando la gente entra se ve el GUI, pero no la pantalla negra, quiero solucionar eso, sólo se ve la pantalla negra cuando inicio el Script. Client: wdwLogin_Pannel = {} tabPannel_Main = {} tab_Login = {} tab_Register = {} --Settings blackLoginScreen = true --True/false Black screen, while player login... blackScreenTime = 3 --Time to complete disappearance of the black screen in seconds. GuestEnable = false --Can a Player play as Guest, or no. [true/false] EnableMTAControlsOnLogin = false --Set false to not open the chat when you press "t" on fields, for example. [true/false] function open_log_reg_pannel() if not(isElement(wdwLogin_Pannel)) then if blackLoginScreen == true then fadeCamera(false,0,0,0,0) end local sWidth,sHeight = guiGetScreenSize() -- The variables local Width,Height = 350,390 --Main Window sizes local X = (sWidth/2) - (Width/2) --Main Window horizontal position local Y = (sHeight/2) - (Height/2) --Main Window vertical position toggleAllControls(EnableMTAControlsOnLogin) wdwLogin_Pannel = guiCreateWindow(X,Y,Width,Height,"MTA-LPM",false) guiWindowSetSizable(wdwLogin_Pannel,false) tabPannel_Main = guiCreateTabPanel(9,130,350,251,false,wdwLogin_Pannel) tab_Login = guiCreateTab("Iniciar sesion",tabPannel_Main) lbl_Login = guiCreateLabel(13,39,100,21,"Cuenta:",false,tab_Login) guiLabelSetVerticalAlign(lbl_Login,"center") guiLabelSetHorizontalAlign(lbl_Login,"right",false) guiSetFont(lbl_Login,"default-bold-small") edit_Login = guiCreateEdit(142,40,130,23,"",false,tab_Login) --Поле ввода логина edit_password = guiCreateEdit(142,71,130,23,"",false,tab_Login) --Поле ввода пароля guiEditSetMaxLength ( edit_Login,25) guiEditSetMaxLength ( edit_password,25) guiEditSetMasked ( edit_password, true ) lbl_Password = guiCreateLabel(13,71,100,21,"Clave:",false,tab_Login) guiLabelSetVerticalAlign(lbl_Password,"center") guiLabelSetHorizontalAlign(lbl_Password,"right",false) guiSetFont(lbl_Password,"default-bold-small") lbl_top_info = guiCreateStaticImage(36, 28, 261, 88, "logo.png", false, wdwLogin_Pannel) local sound = playSound("sonido.mp3") --[[lbl_top_info = guiCreateLabel(74,6,244,35,"Enter with your username and password.",false,tab_Login) guiLabelSetColor(lbl_top_info,137,26,26) guiLabelSetVerticalAlign(lbl_top_info,"center") guiLabelSetHorizontalAlign(lbl_top_info,"center",false) guiSetFont(lbl_top_info,"default-bold-small")]] --[[lbl_about_legth = guiCreateLabel(142,42,184,18,"Max Length: 25 symbols",false,tab_Login) guiLabelSetColor(lbl_about_legth,253,255,68) guiLabelSetVerticalAlign(lbl_about_legth,"center") guiLabelSetHorizontalAlign(lbl_about_legth,"center",false)]] checkbox_save = guiCreateCheckBox(215,97,140,20,"Recordar",false,false,tab_Login) guiSetFont(checkbox_save,"default-small") btn_Login = guiCreateButton(110,150,130,40,"Iniciar sesion",false,tab_Login) guiSetFont(btn_Login,"default-bold-small") login_tab_error_msg = guiCreateLabel(0,112,350,25,"Error_login_tab",false,tab_Login) guiLabelSetColor(login_tab_error_msg,255,0,0) guiLabelSetVerticalAlign(login_tab_error_msg,"center") guiLabelSetHorizontalAlign(login_tab_error_msg,"center",false) guiSetFont(login_tab_error_msg,"default-bold-small") --Guest func if GuestEnable == true then btnGuest = guiCreateButton(29,168,94,32,"Play as Guest",false,tab_Login) guiSetFont(btnGuest,"default-small") guiSetVisible(btnGuest,true) else if isElement(btnGuest) then guiSetVisible(btnGuest,false) end btnGuest = nil end tab_Register = guiCreateTab("Registro",tabPannel_Main) lbl_account_name = guiCreateLabel(13,39,119,21,"Cuenta:",false,tab_Register) guiLabelSetVerticalAlign(lbl_account_name,"center") guiLabelSetHorizontalAlign(lbl_account_name,"right",false) guiSetFont(lbl_account_name,"default-bold-small") lbl_reg_top_info = guiCreateLabel(80,5,364,31,"No usar caracteres raros.",false,tab_Register) guiLabelSetColor(lbl_reg_top_info,255,234,55) guiLabelSetVerticalAlign(lbl_reg_top_info,"center") guiLabelSetHorizontalAlign(lbl_reg_top_info,"left",false) edit_account_name = guiCreateEdit(142,40,130,23,"",false,tab_Register) guiEditSetMaxLength ( edit_account_name,25) lbl__reg_tab_password = guiCreateLabel(13,71,119,21,"Clave:",false,tab_Register) guiLabelSetVerticalAlign(lbl__reg_tab_password,"center") guiLabelSetHorizontalAlign(lbl__reg_tab_password,"right",false) guiSetFont(lbl__reg_tab_password,"default-bold-small") edit__reg_tab_password = guiCreateEdit(142,71,130,23,"",false,tab_Register) guiEditSetMaxLength ( edit__reg_tab_password,25) edit__reg_tab_Repassword = guiCreateEdit(142,102,130,23,"",false,tab_Register) guiEditSetMaxLength ( edit__reg_tab_Repassword,25) lvl_reg_tab_Repassword = guiCreateLabel(13,102,119,21,"Repetir clave:",false,tab_Register) guiLabelSetVerticalAlign(lvl_reg_tab_Repassword,"center") guiLabelSetHorizontalAlign(lvl_reg_tab_Repassword,"right",false) guiSetFont(lvl_reg_tab_Repassword,"default-bold-small") btn_reg_tab_register = guiCreateButton(110,150,130,40,"Crear cuenta",false,tab_Register) guiSetFont(btn_reg_tab_register,"default-bold-small") reg_tab_error_msg = guiCreateLabel(0,170,350,31,"Error_reg_ttab",false,tab_Register) guiLabelSetColor(reg_tab_error_msg,255,20,0) guiLabelSetVerticalAlign(reg_tab_error_msg,"center") guiLabelSetHorizontalAlign(reg_tab_error_msg,"center",false) guiSetFont(reg_tab_error_msg,"default-bold-small") guiEditSetMasked(edit__reg_tab_password, true) guiEditSetMasked(edit__reg_tab_Repassword, true) guiSetVisible(wdwLogin_Pannel,true) --guiSetInputEnabled(true) showCursor(true) --Изменение надписей: guiSetText(reg_tab_error_msg, "") --Поле ошибки в Reg табе guiSetText(login_tab_error_msg, "") --Поле ошибки в Login табе local username, password = loadLoginFromXML() if not( username == "" or password == "") then guiCheckBoxSetSelected ( checkbox_save, true ) guiSetText ( edit_Login, tostring(username)) guiSetText ( edit_password, tostring(password)) else guiCheckBoxSetSelected ( checkbox_save, false ) guiSetText ( edit_Login, tostring(username)) guiSetText ( edit_password, tostring(password)) end --Эвенты addEventHandler("onClientGUIClick",btn_Login,onClickBtnLogin) addEventHandler("onClientGUIClick",btn_reg_tab_register,onClickBtnRegister) if GuestEnable == true then addEventHandler("onClientGUIClick",btnGuest,onClickGuest) end --else --destroyElement(wdwLogin_Pannel) --guiSetInputEnabled(false) --wdwLogin_Pannel = nil --showCursor(false) end end function start_cl_resource() --При старте open_log_reg_pannel() end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),start_cl_resource) addEventHandler("onPlayerJoin",getResourceRootElement(getThisResource()),start_cl_resource) function loadLoginFromXML() --Загрузка логина и пароля из XML local xml_save_log_File = xmlLoadFile ("files/xml/userdata.xml") if not xml_save_log_File then xml_save_log_File = xmlCreateFile("files/xml/userdata.xml", "login") end local usernameNode = xmlFindChild (xml_save_log_File, "username", 0) local passwordNode = xmlFindChild (xml_save_log_File, "password", 0) if usernameNode and passwordNode then return xmlNodeGetValue(usernameNode), xmlNodeGetValue(passwordNode) else return "", "" end xmlUnloadFile ( xml_save_log_File ) end function saveLoginToXML(username, password) --Сохрание логина и пароля в XML local xml_save_log_File = xmlLoadFile ("files/xml/userdata.xml") if not xml_save_log_File then xml_save_log_File = xmlCreateFile("files/xml/userdata.xml", "login") end if (username ~= "") then local usernameNode = xmlFindChild (xml_save_log_File, "username", 0) if not usernameNode then usernameNode = xmlCreateChild(xml_save_log_File, "username") end xmlNodeSetValue (usernameNode, tostring(username)) end if (password ~= "") then local passwordNode = xmlFindChild (xml_save_log_File, "password", 0) if not passwordNode then passwordNode = xmlCreateChild(xml_save_log_File, "password") end xmlNodeSetValue (passwordNode, tostring(password)) end xmlSaveFile(xml_save_log_File) xmlUnloadFile (xml_save_log_File) end addEvent("saveLoginToXML", true) addEventHandler("saveLoginToXML", getRootElement(), saveLoginToXML) function resetSaveXML() --Сохрание логина и пароля в XML local xml_save_log_File = xmlLoadFile ("files/xml/userdata.xml") if not xml_save_log_File then xml_save_log_File = xmlCreateFile("files/xml/userdata.xml", "login") end if (username ~= "") then local usernameNode = xmlFindChild (xml_save_log_File, "username", 0) if not usernameNode then usernameNode = xmlCreateChild(xml_save_log_File, "username") end end if (password ~= "") then local passwordNode = xmlFindChild (xml_save_log_File, "password", 0) if not passwordNode then passwordNode = xmlCreateChild(xml_save_log_File, "password") end xmlNodeSetValue (passwordNode, "") end xmlSaveFile(xml_save_log_File) xmlUnloadFile (xml_save_log_File) end addEvent("resetSaveXML", true) addEventHandler("resetSaveXML", getRootElement(), resetSaveXML)
  20. Sigue dandome el error | El server.log ya pesa 10MB y el resource lo inicié hace 2 minutos. [2014-06-02 18:52:44] WARNING: colorlights\server.lua:27: Bad 'vehicle' pointer @ 'setVehicleHeadLightColor'(1)
×
×
  • Create New...