Jump to content

Enargy,

Members
  • Posts

    1,102
  • Joined

Everything posted by Enargy,

  1. Al parecer te muestra booleano porque no hay ningún dato almacenado. function getVehicleByID(id) local v = false for i, veh in ipairs (getElementsByType("vehicle")) do if ( getVehicleID( veh ) == tonumber( id ) ) then v = veh break end end return v end
  2. https://forum.multitheftauto.com/viewtopic.php?f=145&t=99785
  3. Por qué no lo haces en el lado del cliente y así evitándote esos errores?.
  4. Enargy,

    Top

    Si te fijas, los valores de setAccountData se guardan en una base de datos de SQL... Pero no es lo mismo acceder a la base de datos del servidor que en lugar de tus propias creadas desde los resouces.
  5. De hecho tienes que arreglar el error y así a alguien le resulte de muy utilidad, en lugar de tener topics sin sentidos.
  6. Intenta con esto ahora: local n = 0 -- Contador de rutas local tR = #rutas -- Obtenemos el total de rutas local marker = {} local theFirstTime = {} function nuevaRuta(nm) local x, y, z = rutas[nm][1], rutas[nm][2], rutas[nm][3] marker[nm] = createMarker ( x, y, z, "checkpoint", 10, 255, 255, 255, 255 ) end function siguienteRuta(player, nm) if ( n <= tR ) then local lastMarker = nm - 1 if isElement(marker[lastMarker]) then -- Si existe un marcador antes de crear uno nuevo. destroyElement(marker[lastMarker]) marker[lastMarker] = nil end nuevaRuta(nm) else destruirRuta(player) end end function destruirRuta(player) outputChatBox ( "Has acabado la ruta loco" ) destroyElement(marker[tR]) theFirstTime[player] = nil marker[tR] = nil n = 0 end addEventHandler("onMarkerHit", resourceRoot, function(elem) if getElementType(elem) == "vehicle" then if getVehicleName(elem) ~= "Trashmaster" then return end local thePlayer = getVehicleController(elem) if thePlayer then if isElement(marker[n]) then n = n + 1 siguienteRuta(thePlayer, n) end end end end) addEventHandler("onVehicleExit", root, function(player, seat) if getVehicleName(source) ~= "Trashmaster" then return end if isElement(marker[n]) then destroyElement(marker[n]) marker[n] = nil end end) addEventHandler("onVehicleEnter", root, function(player, seat) if getVehicleName(source) ~= "Trashmaster" then return end if ( theFirstTime[player] == nil ) then theFirstTime[player] = true else nuevaRuta(n) return end n = n + 1 nuevaRuta(n) end) Los markers tienen un ultimo argumento que es la visibilidad para un elemento en especifico, como no lo estas colocando, siempre va a estar predefinido como getRootElement() es decir, será siempre visible para todos. Coloca el player como ultimo argumento del createMarker. Leete mas la wiki.
  7. Me tome de hacerlo por ti, no lo he probado pero si no es lo que buscas nose como ayudarte. local n = 1 -- Contador de rutas local tR = #rutas -- Obtenemos el total de rutas local marker = {} local theFirstTime = {} function nuevaRuta(nm) local x, y, z = rutas[nm][1], rutas[nm][2], rutas[nm][3] marker[nm] = createMarker ( x, y, z, "checkpoint", 10, 255, 255, 255, 255 ) end function siguienteRuta(nm) if ( n <= tR ) then local lastMarker = nm - 1 if isElement(marker[lastMarker]) then -- Si existe un marcador antes de crear uno nuevo. destroyElement(marker[lastMarker]) marker[lastMarker] = nil end nuevaRuta(nm) else destruirRuta() end end function destruirRuta() outputChatBox ( "Has acabado la ruta loco" ) destroyElement(marker[nm]) marker[nm] = nil n = 0 end addEventHandler("onMarkerHit", resourceRoot, function(elem) if getElementType(elem) == "vehicle" then if getVehicleName(elem) ~= "Trashmaster" then return end local thePlayer = getVehicleController(elem) if thePlayer then if isElement(marker[n]) then siguienteRuta(n + 1) end end end end) addEventHandler("onVehicleExit", root, function(player, seat) if getVehicleName(source) ~= "Trashmaster" then return end if isElement(marker[n]) then destroyElement(marker[n]) marker[n] = nil end end) addEventHandler("onVehicleEnter", root, function(player, seat) if getVehicleName(source) ~= "Trashmaster" then return end if ( theFirstTime[player] == nil ) then theFirstTime[player] = true else siguienteRuta(n + 1) return end nuevaRuta(n) end end)
  8. Almacena la variable 'n' cuando se baje del auto, luego cuando se vuelva a subir que el conteo de tablas comience por el numero que hay en esa variable.
  9. Que comience desde la primera ruta o las no ha tomado aun?
  10. Te he dado la función de los markers arriba, si no es eso nose que es.
  11. Estas diciendo una cosa y luego otra, dijiste que querías contar las rutas al jugador y ahora que el marcador no se borre al bajarte del auto; entonces no lo elimines al bajarte.
  12. Lo que quieres es contar la cantidad de rutas marcadas o las que faltan?
  13. Intenta con esto: local n = 0 -- Contador de rutas local tR = #rutas -- Obtenemos el total de rutas local marker = {} function nuevaRuta ( player ) if player then if ( n <= tR ) then if isElement(marker[n]) then -- Si existe un marcador antes de crear uno nuevo. destroyElement(marker[n]) marker[n] = nil end n = n + 1 local x, y, z = rutas[n][1], rutas[n][2], rutas[n][3] marker[n] = createMarker ( x, y, z, "checkpoint", 10, 255, 255, 255, 255 ) else outputChatBox ( "Has acabado la ruta loco" ) destroyElement(marker[n-1]) marker[n-1] = nil n = 0 end end return false end
  14. Ah, eso me pasaba hace años cuando tenia el GTA no original , pero ahora no me pasa y aunque no uso esa radio y la tengo desactivada no sabría decirte.
  15. if ( isObjectInACLGroup("user."..(getAccountName(getPlayerAccount(players))), aclGetGroup(aclName))) then outputChatBox("#2971D5[#4E5861MP#2971D5]#FFFFFF: "..getPlayerName(thePlayer).." #2971D5 > #FFFFFF " .. getPlayerName(toPlayer) .. "#FFFFFF: " .. pmMessage, players, 255, 255, 255, true) break end
  16. local n = 1 -- Contador de rutas local x, y, z = rutas[n][1], rutas[n][2], rutas[n][3] n = n + 1 if rutas[n] == nil then outputChatBox("Esta es la ultima ruta!") n = 1 return end
  17. Enargy,

    ID system

    Si, pero no es deleteAccount sino removeAccount.
  18. Enargy,

    Tables

    is that an unfinished string or it's normal? 131931,3131,13131" Of couse it does not normal.
  19. Enargy,

    problem

    addEventHandler("onClientRender", getRootElement(), function () local theTeam = getTeamFromName("Army") if not theTeam then return end for k,v in ipairs(getPlayersInTeam(theTeam)) do if v ~= localPlayer then dxDrawTextOnElement(v,"Army",1,20,0,255,0,255,1,"bankgothic") end end end)
  20. Enargy,

    ID system

    Loopea getAccounts y usas el índice como una key y las almacenas.
  21. La variable sy tiene como valor 600 asi que divido entre 600 dara 1 y no pasaria nada.. Obviamente te dará uno a ti porque tienes esa resolución, pero a diferencia de otras esta va a variar. Por ejemplo yo uso la 1024 x 768 y divido las dos unidades por 1600 x 1200 y me queda el texto dentro del rectángulo, pero reducido e incluyendo el texto. local sx, sy = guiGetScreenSize(); local screenX, screenY = (sx / 1600 ), (sy / 1200); local fontsize = screenY * 1.0; addEventHandler("onClientRender", root, function() dxDrawRectangle(screenX*250, screenX*250, screenX*500, screenX*30, tocolor(0, 0, 0, 255), false); dxDrawText("Yo soy GaBoX!", screenX*250 + 5, screenX*250 + 5, 0, 0, nil, fontsize); dxDrawText("Numero de scripts: 20", screenX*250 + screenX*500 - 130, screenY*250 + 5, 0, 0, nil, fontsize); end)
×
×
  • Create New...