Jump to content

Vic_RattleHead

Members
  • Posts

    63
  • Joined

  • Last visited

Everything posted by Vic_RattleHead

  1. Esto es solo un ejemplo, tu le pondras el evento que necesitas para la funcion: EDIT = guiCreateEdit( x, y, z, w ,h, "Ejemplo", true ) function Armas() local ID = getPedWeapon( localPlayer ) local ARMA = getWeaponNameFromID( ID ) local AMMO = getPedTotalAmmo( localPlayer ) guiSetText ( EDIT, "Arma Actual: "..ARMA.."Munición: "..AMMO, true ) end
  2. Hola, solo debes utilizar lo siguiente: getPedWeapon getWeaponNameFromID getPedTotalAmmo guiSetText
  3. Disculpa la demora, la verdad no me funciono ninguno, logre hacerlo funcionar el problema ahora es que no remueve el evento en algunas ocaciones: -- COMO ME FUNCIONO: COLSHAPES = { { -2882.6452636719, 1897.1723632813, 0, 1000, 1000, 1000 }, { -363.17227172852, -416.40063476563, 0, 1000, 700, 500 }, { -3034.3217773438, -2238.9357910156, 1, 1150, 1300, 900 } } function AREAS( player, matchingDimension ) local DIMENSION = getElementDimension( player ) if getElementType( player ) and DIMENSION == 1 then killPed( player ) outputChatBox( "**FUISTE ASESINADO POR ABANDONAR LA ZONA INFECTADA**", player, 255, 0, 0 ) end end for k, data in ipairs( COLSHAPES ) do local x = data[1] local y = data[2] local z = data[3] local px = data[4] local py = data[5] local pz = data[6] COLS = createColCuboid( x, y, z, px, py, pz ) addEventHandler( "onColShapeLeave", COLS , AREAS ) end -- MARKERS QUE REMUEVEN EL EVENTO DE LAS COLSHAPES AL ENTRAR EN ELLAS NK_MARKERS = { { -2674.0002441406, 1986.3414306641, 62.21745300293, "cylinder",60, 255, 0, 0, 255 }, { -2462.0129394531, 2137.16796875, 11.354687690735, "cylinder",10, 255, 0, 0, 255 }, { 272.48095703125, -380.62576293945, 9.785270690918, "cylinder",10, 255, 0, 0, 255 }, { -112.59156799316, -121.5378036499, 4.1171875, "cylinder",60, 255, 0, 0, 255 }, { -1997.6311035156, -1543.4739990234, 84.066291809082, "cylinder",10, 255, 0, 0, 255 }, { -2259.7023925781, -1555.4602050781, 490.1413269043, "cylinder",10, 255, 0, 0, 255 } } for k, MK in ipairs ( NK_MARKERS ) do local mx = MK[1] local my = MK[2] local mz = MK[3] local mtype = MK[4] local msize = MK[5] local mr = MK[6] local mg = MK[7] local mb = MK[8] local ma = MK[9] NK_MARK = createMarker( mx, my, mz, mtype, msize, mr, mg, mb, ma ) setElementDimension( NK_MARK, 1 ) end function NOKILL( player, matchingDimension ) removeEventHandler( "onColShapeLeave", COLS, AREAS ) end addEventHandler( "onMarkerHit", NK_MARK, NOKILL ) y otra pregunta como logro que al terminar la cancion continue con otra aleatoriamente intente esto pero solo cambia de cancion al reiniciar el recurso: SONG = { [1] = {"SOUNDS/SONGG.mp3"}, [2] = {"SOUNDS/SONGG2.mp3"}, [3] = {"SOUNDS/SONGG3.mp3"}, [4] = {"SOUNDS/SONGG4.mp3"}, [5] = {"SOUNDS/SONGG5.mp3"} } --CANCION addEventHandler("onClientResourceStart", resourceRoot, function(source) local CANCION = playSound3D( unpack ( SONG [ math.random ( #SONG ) ] ) , 899.67602539063, 7366.8427734375, 9.5646343231201, true ) setSoundMaxDistance(CANCION, 190 ) setSoundVolume ( CANCION, 1.0 ) setElementDimension(CANCION, 5) end )
  4. Hola, gracias por responder, intente remover los eventos pero luego se podía salir de la zona con vida intente lo siguiente para que funcionara, creó las 3 zonas pero solo cumple la función en una zona, la ultima : COLSHAPES = { { -2882.6452636719, 1897.1723632813, 0, 1000, 1000, 1000 }, { -363.17227172852, -416.40063476563, 0, 1000, 700, 500 }, { -3034.3217773438, -2238.9357910156, 1, 1150, 1300, 900 } } for k, data in ipairs( COLSHAPES ) do local x = data[1] local y = data[2] local z = data[3] local px = data[4] local py = data[5] local pz = data[6] COLS = createColCuboid( data[1], data[2], data[3], data[4], data[5], data[6] ) end function AREAS( player, matchingDimension ) local DIMENSION = getElementDimension( player ) if getElementType( player ) and DIMENSION == 1 then killPed( player ) outputChatBox( "**FUISTE ASESINADO POR ABANDONAR LA ZONA INFECTADA**", player, 255, 0, 0 ) end end addEventHandler( "onColShapeLeave", COLS, AREAS ) La verdad no se mucho sobre tablas, pero me serviría los consejos
  5. Hola, yo estoy creando un server multigamemode en este momento estoy creando uno en donde no puedes salir de alguna de las 3 zonas, para eso utilice createColCuboid y onColShapeLeave es un panel donde escoges a que zona entrar, si abandonas la zona mueres hasta ahi todo bien, el problema es que cuando selecciono otra zona el jugador muere por que salio de la zona anterior como soluciono esto ? ya intente varias cosas: local AREAA = createColCuboid ( -2882.6452636719, 1897.1723632813, 0, 1000, 1000, 1000 ) function AREAS( player, matchingDimension ) local DIMENSION = getElementDimension( player ) if getElementType( player ) and DIMENSION == 1 then killPed( player ) outputChatBox( "**FUISTE ASESINADO POR ABANDONAR LA ZONA INFECTADA**", player, 255, 0, 0 ) end end addEventHandler("onColShapeLeave", AREAA, AREAS ) local AREAB = createColCuboid ( -363.17227172852, -416.40063476563, 0, 1000, 700, 500 ) function AREAS2( player, matchingDimension ) local DIMENSION = getElementDimension( player ) if getElementType( player ) and DIMENSION == 1 then killPed( player ) outputChatBox( "**FUISTE ASESINADO POR ABANDONAR LA ZONA INFECTADA**", player, 255, 0, 0 ) end end addEventHandler("onColShapeLeave", AREAB, AREAS2 ) local AREAC = createColCuboid ( -3034.3217773438, -2238.9357910156, 1, 1150, 1300, 900 ) function AREAS3( player, matchingDimension ) local DIMENSION = getElementDimension( player ) if getElementType( player ) and DIMENSION == 1 then killPed( player ) outputChatBox( "**FUISTE ASESINADO POR ABANDONAR LA ZONA INFECTADA**", player, 255, 0, 0 ) end end addEventHandler("onColShapeLeave", AREAC, AREAS3 )
  6. Is the same, is visible after downloading
  7. Not work, the "setCameraPosition" appears only after downloading, i dont know what the problem
  8. I try what you said , but does not work
  9. Hi, i have a problem the "setCameraPosition" appears only after downloading, I want to happen in the download addEventHandler("onPlayerJoin", root, function() outputChatBox("**Please wait, download in progress**", source, 255, 0, 0) fadeCamera(source, true) setCameraMatrix(source, 2003, -881, 130, 1832, -1249, 64) end )
  10. Eso pensé yo, y lo del fadeCamera se lo que es intente dejando solo el setCameraMatrix pero la pantalla se quedo en negro incluso después de descargar por completo ,ya no se como hacer que se vea el setCameraMatrix mientras se descargan los archivos, lo he visto en otros servidores y la verdad es una buena idea.
  11. No entendí muy bien lo de los loops, me darías un ejemplo? ademas hice lo siguiente pero no me dio resultado, al entrar la pantalla es negra, pero sale el letrero de donde esta ubicada la cámara , por lo que quiere decir que la camara si esta ubicada en el lugar desde que entro pero la pantalla es negra, y justo cuando termina de descargar aparece la imagen de la cámara: SERVER: function camera () fadeCamera(source, true, 1) setCameraMatrix(source, 2003, -881, 130, 1832, -1249, 64) end addEvent("onPlayerJoin", true) addEventHandler("onPlayerJoin", getRootElement(), camera) CLIENT: function () if isTransferBoxActive() == true then triggerServerEvent("onPlayerJoin", getLocalPlayer() ) end end
  12. No sirve, también aparece luego de que carga completo: function CAMERA() fadeCamera(source, true, 2) setCameraMatrix(source, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) end addEventHandler("onPlayerJoin", getRootElement(), CAMERA)
  13. Hola, estuve buscando una forma de que cuando el jugador se conecte al servidor automaticamente le salga diferentes lugares de San Andreas mientras le carga los archivos, así que encontré isTransferBoxActive con un ejemplo, pero me aparece la imagen luego de cargar por completo, quiero que suceda en la descarga: resourceRoot = getResourceRootElement(getThisResource()) function checkTransfer() if isTransferBoxActive() == true then fadeCamera( true, 5) setCameraMatrix( 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) end end addEventHandler("onClientResourceStart",resourceRoot,checkTransfer)
  14. Error, thePlayer y player creo que combinaste client y server side, además para que solo sea para Admin el dinero, vida y armor deben ir después de la condición, lo hice en server side: function comando ( player, command, amount ) local accountname = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Owner" ) ) then -- LA CONDICIÓN, SI ERES ADMIN ENTONCES: givePlayerMoney ( player, 250 ) setElementHealth ( player, getElementHealth(player) + 200 ) setPedArmor ( player, 100 ) end end addCommandHandler ( "comando1", comando )
  15. Si, me di cuenta del error un tiempo después aunque también era por que guiGridListSetSelectedItem no tenia un valor, ya lo pude resolver y he terminado mi recurso. ¡Muchas gracias!
  16. Intente esto pero no funciono: function Desmarcar() if guiGridlistGetSelectedItem(LS) == true or guiGridlistGetSelectedItem(SF) == true then guiGridlistSetSelectedItem(LS, 0, 0) guiGridlistSetSelectedItem(SF, 0, 0) else guiGridlistSetSelectedItem(LS, 1, 0) guiGridlistSetSelectedItem(SF, 1, 0) end end
  17. No, me explico: es una ventana, con 3 gridlist -Los Santos -San Fierro -Las Venturas Cada una tiene 10 rows, el script ya esta practicamente listo, el problema es que si doy click en un row de Los Santos ej: Los Santos > Unity Station, pero si decido mejor ir a San fierro > Aeropuerto, ambos rows quedan marcados, y al momento de viajar, viajan a Unity Station, lo que quiero es que solo marque el row de la gridlist seleccionada, y desmarque las demas aqui una foto:
  18. si, ya lo habia intentado, pero desmarca el row al instante, necesito es que se desmarque el row, solo si se selecciona otra gridlist diferente. function WARPSF() if ( ROWSF) then local row, col = guiGridListGetSelectedItem (SF) guiGridListSetSelectedItem ( SF, -1, -1) if ( row and col and row ~= -1 and col ~= -1 ) then local Lugares = guiGridListGetItemText (SF, row, 1) if ( Lugares == "Aeropuerto SF" ) then triggerServerEvent("WARP11", getLocalPlayer() ) guiSetVisible(VENTANA, false) showCursor(false) setElementFrozen(localPlayer, false) elseif ( Lugares == "Cranberry Station" ) then triggerServerEvent("WARP12", getLocalPlayer() ) guiSetVisible(VENTANA, false) showCursor(false) setElementFrozen(localPlayer, false) end end end end addEventHandler("onClientGUIClick", GO, WARPSF)
  19. Cree un panel de viajes por todo San Andreas, tiene 3 gridlist. LS, SF, LV el problema es que cuando selecciono un row de LS, pero luego selecciono un ROW de SF me quedan ambos seleccionados, como logro que solo quede marcado un solo gridlist, osea que desmarque las gridlists seleccionadas anteriormente.
  20. INTENTE LO SIGUIENTE PERO NO DA RESULTADO AL HACER CLICK SOBRE EL MEMO ME CREA EL AUTO Y ME WARPEA A EL Y APARECE EL ERROR: Bad argument @ 'setVehiclePlateText' [Expected string at argument 2, got nil] CLIENT: function PLACAOFICIAL() local r, c = guiGridListGetSelectedItem(LISTCAR) if (r ~= 1 and c ~= 0) and MATRICULABOTON and PLACATEXT and ACEPTARPLACA then triggerServerEvent("PLACA", getLocalPlayer()) end end SERVER: function SPAWN_BUGATTI(thePlayer) setVehiclePlateText( carro, text ) local money = getPlayerMoney(source) if money > 299 then takePlayerMoney(source, 300) carro = createVehicle(tonumber(411), 528.84295654297, -1287.8753662109, 16.701047897339 ) warpPedIntoVehicle(source, carro) outputChatBox("Compraste un Bugatti por $50000",thePlayer, 0, 255, 0) outputChatBox("¡¡GRACIAS POR TU COMPRA!!",thePlayer, 0, 255, 0) else outputChatBox("Necesitas $50000 para adquirir el vehiculo.",thePlayer, 255, 0, 0) end end addEvent("SPAWN1", true) addEventHandler("SPAWN1", getRootElement(), SPAWN_BUGATTI ) addEvent("PLACA",true) addEventHandler("PLACA", getRootElement(),SPAWN_BUGATTI) Y necesito que la placa se cree antes de spawnear el auto es decir: selecciono row, boton matricula, introduzco nombre, acepto, compro, spawneo y la placa tendría el nombre que coloque anteriormente.
  21. Bueno solucione el problema getPlayerMoney debía estar con source, ahora existe un botón que dice "matricula" y abre una ventana con un memo y el botón aceptar como logro que lo que se escriba ahí sea el nombre de la matricula del vehiculo? se que debo usar getVehiclePlateText, pero no se como lograr que el jugador cree su propia matricula.
  22. Perfecto gracias con eso mismo pude agregar la imagen del auto, ahora quiero que se compre el coche pero no sirve lo que hice, incluso ya no me crea el auto, que esta mal? function SPAWN_BUGATTI(thePlayer) local money = getPlayerMoney(thePlayer) if money > 300 then takePlayerMoney(thePlayer, 300) carro = createVehicle(tonumber(411), 528.84295654297, -1287.8753662109, 16.701047897339 ) warpPedIntoVehicle(source, carro) outputChatBox("Compraste un Bugatti por $50000",thePlayer, 0, 255, 0) outputChatBox("¡¡GRACIAS POR TU COMPRA!!",thePlayer, 0, 255, 0) else outputChatBox("Necesitas $50000 para adquirir el vehiculo.",thePlayer, 255, 0, 0) destroyElement(carro, SPAWN_BUGATTI) end end
  23. Gracias, logre que al presionar "COMPRAR" aparezca el vehiculo, pero como hago para que al seleccionar la row "BUGATTI" y luego presionar "COMPRAR" aparezca?
  24. Hola, hace poco volví y decidí seguir aprendiendo como crear mis propios recursos, así que hice una gui sencilla para un panel de autos, una gridlist y 2 botones comprar y cerrar, como logro que al seleccionar el row y luego darle "comprar" aparezca el coche, gracias. CLIENT: function PANEL() COMPRAR = guiCreateButton(0.41, 0.55, 0.12, 0.11, "COMPRAR", true) guiSetProperty(COMPRAR, "NormalTextColour", "FFAAAAAA") CERRAR = guiCreateButton(328, 251, 96, 69, "CERRAR", false) addEventHandler("onClientGUIClick",CERRAR, CERRAR1) guiSetProperty(CERRAR, "NormalTextColour", "FFAAAAAA") LISTA = guiCreateGridList(0.17, 0.29, 0.23, 0.37, true) guiGridListAddColumn(LISTA, "CARS", 0.9) guiGridListAddRow(LISTA) guiGridListSetItemText(LISTA, 0, 1, "BUGATTI", false, false) showCursor(true) end addCommandHandler("carro", PANEL) function CERRAR1 () destroyElement(COMPRAR) destroyElement(LISTA) destroyElement(CERRAR) showCursor(false) end function SPAWNCAR() guiGridListSetSelectedItem ( LISTA, 1, 0)
×
×
  • Create New...