Jump to content

aka Blue

Members
  • Posts

    2,106
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by aka Blue

  1. aka Blue

    Help Ha

    I think making a table of the markers, looping it and adding the event inside the loop is faster and a better solution because all 'onMarkerHit' do the same function. Making tons of variables makes things more difficult
  2. aka Blue

    Help Ha

    I simplified that. I dont know if it works but you can try it! --mission five-- cardrivepoints = 0 markersTable = { { {231.41704, 1877.68689, 17.64063 -1, "cylinder", 4, 0 ,255 ,0, 255}, {231.41704, 1877.68689, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {231.41704, 1877.68689, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, {231.41704, 1877.68689, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {231.41704, 1877.68689, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, }, { {231.85756, 1892.57666, 17.64063 -1, "cylinder", 4, 0 ,255 ,0, 255}, {231.85756, 1892.57666, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {231.85756, 1892.57666, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, {231.85756, 1892.57666, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {231.85756, 1892.57666, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, }, { {229.22476, 1906.36658, 17.64063 -1, "cylinder", 4, 0 ,255 ,0, 255}, {229.22476, 1906.36658, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {229.22476, 1906.36658, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, {229.22476, 1906.36658, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {229.22476, 1906.36658, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, }, { {212.10025, 1908.91870, 17.64063 -1, "cylinder", 4, 0 ,255 ,0, 255}, {212.10025, 1908.91870, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {212.10025, 1908.91870, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, {212.10025, 1908.91870, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {212.10025, 1908.91870, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, }, { {192.29828, 1911.02271, 17.64063 -1, "cylinder", 4, 0 ,255 ,0, 255}, {192.29828, 1911.02271, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {192.29828, 1911.02271, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, {192.29828, 1911.02271, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {192.29828, 1911.02271, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, }, } veh5 = {} markers_obj = {} -- Recomendo que evite posições decimais muito grandes. Use só até 3 casas decimais. localitionveh55 = { [1] = {493, 238.55833, 1925.76343, 17.6480, 0, 0, 270}, [2] = {493, 238.55833, 1925.76343, 17.6480, 0, 0, 270}, [3] = {493, 238.55833, 1925.76343, 17.6480, 0, 0, 270}, [4] = {493, 238.55833, 1925.76343, 17.6480, 0, 0, 270}, [5] = {493, 238.55833, 1925.76343, 17.6480, 0, 0, 270}, -- O primeiro, quinto e sexto valor das posições não estão sendo usados. Recomendo que delete-os. } i = 1 -- contador global function inicio5 () if isElement (veh5[client]) then -- Client = localPlayer, somente neste caso. destroyElement (veh5[client]) veh5[client] = nil end local vx ,vy, vz, vrot = localitionveh55[ i ][ 2 ], localitionveh55[ i ][ 3 ], localitionveh55[ i ][ 4 ], localitionveh55[ i ][ 7 ] i = i + 1 if i > #localitionveh55 then -- se i > 5, então: i = 1 end Trabalho = true veh5[client] = createVehicle ( 433, vx, vy, vz, 0, 0, vrot ) warpPedIntoVehicle (client, veh5[client]) outputChatBox ("#ffff00Drive the veh5icle to the checkpoint. Note: You cannot leave the car during the mission.", client, 0, 0, 0, true) function createAllMarkers() for i=1, #markersTable do local v = markersTable[i] markers_obj[i] = createMarker( unpack(v) ) addEventHandler( "onMarkerHit", markers_obj[i], function() if veh5[source] and isElement(veh5[source]) then cardrivepoints = cardrivepoints+1 outputChatBox("Funcionando!",source,0,0,0,true) else end end ) end end local player2 = client addEventHandler ( "onVehicleExplode", veh5[client], function () if (veh5[player2]) and isElement(veh5[player2]) then destroyElement (source) takePlayerMoney ( player2, 5000 ) outputChatBox("Mission failed, your veh5icle blew up.", player2 , 255, 0, 0) end end) end addEvent ("iniciaJob5", true) -- Cria o evento "iniciaJob e permite que ele seja chamado pelo client. addEventHandler ("iniciaJob5", getRootElement(), inicio5) -- Executa essa função quando o evento "iniciaJob" for chamado. function completed(source) if cardrivepoints >= 5 then outputChatBox("#00ff00Mission passed. You successfully completed this task. You've received $10.000!",source,0,0,0,true) end end
  3. Probably you have a non original version of the game and some sounds or files are not inside.
  4. aka Blue

    .IPL to .MAP

    http://the-lost-city.fr1.co/conversion-h1.htm
  5. You can use this functions: getVehicleComponentPosition -- Get wheel position createEffect -- Create the smoke effect in the wheel position :)
  6. Thanks for answering! Finally I used timestamp but I would like to know how to format the value to receive a date, like... Timestamp = 15351823012 Function that returns = 12-01-2018... ¿It is possible? Thanks in advance!
  7. Hi everyone! I have a little question about datetime function I use a MySQL database and I want to know the number of days that have passed. The format of datetime is: YYYY/MM/DD HH/MM/SS Is there any function to subtract the days and know how many have passed? In MTA or Lua because I know that exists datediff but i don't want to query all the time Thanks in advance!
  8. Utilizo una función en MySQL (datetime) que básicamente te devuelve lo siguiente: 2018-11-14 14:29:33 YYYY/MM/DD HH/MM/SS Me gustaría saber si hay alguna función propia de MTA o de Lua para poder comparar los días que han pasado. Gracias de antemano! pd: llevo tiempo sin tocar este tipo de funciones. Recuerdo que existía alguna función para esto pero no la encuentro
  9. Un curro increíble sin duda, pero me decepcionó bastante el tema de construcción. En la comunidad inglesa hicieron uno que fue bastante bueno jugando con el bounding box del objeto. Espero que tengas suerte vendiendolo!
  10. C++ is not a scripting language. It's a programming language. Starting at this point, it will be so useful watch youtube videos.
  11. function llenarAlCambiar(oldModel, newModel) if ( getElementType(source) == "player" ) then setElementHealth( source, 100 ) end end addEventHandler("onElementModelChange", getRootElement(), llenarAlCambiar) Esto debería funcionar. Recuerda que es lado server.
  12. Si reinicias un script con esa función, se le reiniciará a todos. Si lo vas a hacer para jobs o algo así, deberías crear todo de 0 una vez muera o lo que sea. Supongo que tendrás alguna función que inicie el "trabajo", pues, repítela cuando muera, por ejemplo.
  13. Good and useful job. Thanks for sharing!
  14. Con -2 me funciona bien. No entiendo del todo el por qué pero lo habían sugerido en un foro de Lua y lo saqué de ahí. Con -1 no me funciona.
  15. Resuelto. Lo comparto por si alguien se calienta la cabeza alguna vez: local digitos = 1234566 function quitarUnDigito( ) return tonumber( tostring(digitos):sub(1,-2) ) end El problema era que quería un número y lo tenía que pasar a string para utilizar el :sub
  16. Llevo tiempo sin tocar estas funciones y se me ha olvidado cómo hacer ésto. Digamos que tengo un texto: 99124512314 Si deseo eliminar el último dígito, ¿qué debo utilizar? (intenté con sub, gsub pero creo que no lo ponía bien) Gracias.
  17. Si empezamos desprestigiando a servidores vamos mal.
  18. No es muy normal que digamos. ¿Puedes pasar las especificaciones de tu pc? (Ram, procesador)
  19. Si es un skin mod es bastante probable que el archivo esté corrompido y al intentar leerlo se de algún error que haga que se crashee. Yo de ti lo quitaría del servidor o lo cambiaría por otro. Suele suceder cuando no se carga bien o, simplemente, como dije arriba, está corrompido.
  20. Relax. He confused the post for sure
×
×
  • Create New...