Jump to content

DuFraN

Members
  • Posts

    84
  • Joined

  • Last visited

Everything posted by DuFraN

  1. Hey guys i have a problem with this function and decimals, my problem really is the decimals, how can remove decimals?. x1,y1,z1 = getElementPosition (Base) x2,y2,z2 = getElementPosition (Marcador_Entrega) distancia = getDistanceBetweenPoints3D (x1,y1,z1,x2,y2,z2) outputChatBox("Distancia:"..distancia) the result is: Distancia: 4515.64548 how can remove the decimals?.
  2. Gracias pero ya lo solucione, esto es viejo, ya había buscado la solución por otro lado pero igual gracias por tratar de brindarme ayuda.
  3. Hi guys, i have a problem, can't get a table value, here is my table. local Tabla_Marcadores = { { [1]={2893,-911,10,"cylinder",5,255,150,0,255},{2993,-911,10,"cylinder",5,255,150,0,255} }, { [2]={2793,-911,10,"cylinder",5,255,150,0,255},{2693,-911,10,"cylinder",5,255,150,0,255} } } i want calculate a random value, later calculate the first and second table of the random value and also introduce these arguments of the table here: createMarker. Can someone give me an example?
  4. Tomas eso tampoco me funciona, lo que quiero hacer es calcular un valor al azar de la tabla (TablaMarcadores) y luego tomar los valores de dicha tabla para luego aplicarlos a los markers, cada valor tiene 2 tablas insertadas quiero calcular el marker1 y marker 2. no se si me entiendan
  5. Hola, termine mi job de camionero, todo funciona bien pero quiero hacerlo mas agradable añadiendo rutas al azar, Asus me explico un poco, entendi pero a lo ultimo me perdi un poco local Tabla_Marcadores = { { [1]={2893,-911,10,"cylinder",5,255,150,0,255},{2993,-911,10,"cylinder",5,255,150,0,255} }, { [2]={2793,-911,10,"cylinder",5,255,150,0,255},{2693,-911,10,"cylinder",5,255,150,0,255} } } Eso creo que esta bien, el problema es este, no se como seleccionar una tabla de un valor dado al zar, ejemplo. valor = math.random(1, #Tabla_Marcadores) infoMarker = Tabla_Marcadores[valor][1] El me dijo que el [1] es la tabla insertada en el valor random de Tabla_Marcadores, pero cuando quiero aplicar este valor al createMarker en el debug me da argumento malo, lo estoy aplicando mal? Marcador = createMarker(infoMarker)
  6. Gracias, tengo otra duda si por casualidad el vehiculo esta vacio?, como la obtengo?
  7. Hola, tengo un problema con este evento, lo que pasa es que no se como obtener la cuenta de tal jugador cuando un vehiculo explote ya que el source de este evento es un vehiculo, si alguien sabe que me ayude
  8. Hola, lo que pasa es que estoy empezando a hacer un sistema de compra de carros pero como no se mucho de SQL estoy intentandolo por comandos, y me da un error en el primer valor de la tabla (cuenta_nombre) y no se porque hay alguien que me diga por que? function ea() tabla = executeSQLQuery("CREATE TABLE IF NOT EXISTS VE_Carros (Cuenta TEXT, Numero_De_Carros NUMERIC, Modelo NUMERIC)") end addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),ea) function comprar(playerSource,command,numero_de_carros,modelo) local cuenta = getPlayerAccount(playerSource) local cuenta_nombre = getAccountName(cuenta) local numbert = tonumber(numero_de_carros) local modelo2 = tonumber(modelo) if numero_de_carros and modelo then outputChatBox(cuenta_nombre.." "..numbert.." "..modelo2) executeSQLQuery("INSERT INTO VE_Carros(Cuenta,Numero_De_Carros,Modelo) VALUES(?,?,?)",cuenta_nombre,numbert,modelo2) end end addCommandHandler("comprarcarro",comprar) PD: el error es Database query failed: no such column: dufran
  9. when i finish the route and I want to do another route this doesn't work because error at line 11 "bad element pointer destroyElement" something.
  10. Eso pensé pero es que son 6 markers, no habría que crear una tabla en otro tabla?, algo así no comprendo mucho
  11. hey guys, i have a problem, when I do the truck route for the first time the script work perfectly but the second time doesn't work, help me. function crear_ruta() Marcador_1 = createMarker(2842,-1847,10,"cylinder",5,255,150,0,255) function Cuando_Toque(hitPlayer) vehicle = getPedOccupiedVehicle ( hitPlayer ) if hitPlayer == getLocalPlayer() then if source == Marcador_1 then destroyElement(source) Marcador_2 = createMarker(2893,-911,10,"cylinder",5,255,150,0,255) elseif source == Marcador_2 then destroyElement(source) Marcador_3 = createMarker(2774,-54,35,"cylinder",5,255,150,0,255) elseif source == Marcador_3 then destroyElement(source) Marcador_4 = createMarker(2466,324,31,"cylinder",5,255,150,0,255) elseif source == Marcador_4 then destroyElement(source) Marcador_5 = createMarker(1769,280,18,"cylinder",5,255,150,0,255) elseif source == Marcador_5 then destroyElement(source) Marcador_6 = createMarker(1701,999,10,"cylinder",5,255,150,0,255) elseif source == Marcador_6 then destroyElement(source) triggerServerEvent("XD",localPlayer,hitPlayer) setTimer(outputChatBox,1000,1,"Has completado la ruta, como recompenza obtienes 10000!.",255,255,255) end end end addEventHandler ( "onClientMarkerHit", getRootElement(), Cuando_Toque ) end addEvent("Cuando_Toque",true) addEventHandler("Cuando_Toque",root,crear_ruta) error at line 11.
  12. Hola, hice un job de camionero, me funciona bien pero quiero añadirle mas rutas al azar, cada ruta tiene 6 markers, me podrían dar un ejemplo? o darme el link a una pagina donde lo expliquen asi aprendo.
  13. DuFraN

    Tengo una duda

    Gracias castillo, este me funciona a la perfección
  14. DuFraN

    Tengo una duda

    Gracias Alex!, me hice una maquina virtual y funciona con todos los juegos menos con mta
  15. Hay alguna forma de crear un "jugador"?, osea es que a la hora de hacer scripts me resulta difícil testearlos ya que solo tengo una pc, hay alguna forma?
  16. DuFraN

    getAccountData

    Thanks guys, this work.
  17. Hi guys, i have a problem, I like to show it only to players with getAccountData(account,"Language",1), how can I do this? function onChat(player,_,...) local msg = table.concat({...}," ") local nick = getPlayerName(player) local account = getPlayerAccount(player) local Language = getAccountData(account,"Language") if Language == 1 then outputChatBox("[spanish]"..nick..": #ffffff"..msg,player,255,255,255,true) -- only to players with getAccountData(account,"Language",1) end end addCommandHandler("Language",onChat) Regards, DuFraN.
  18. DuFraN

    onPlayerLogin

    Hi guys, I have a problem. addCommandHandler("onPlayerLogin",getRootElement(),function) i have a triggerEvent in this function, why Why when someone join this will appear to everyone?, as I do so only to the source player? triggerClientEvent("onPlayerLoginPanel",source)
×
×
  • Create New...