Jump to content

AngelAlpha

Members
  • Posts

    190
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by AngelAlpha

  1. guiCreateLabel wiki Parent is GUI element to which attached other GUI element (buttons, edits, labels, gridlists and other)
  2. No parent for guiLabel
  3. function updateDX( ) local health = getElementHealth(localPlayer) local armour = getPedArmor(localPlayer) local hunger = getElementData(localPlayer, configs['Elements']['Fome']) or 0 local thirst = getElementData(localPlayer, configs['Elements']['Sede']) or 0 local stress = getElementData(localPlayer, configs['Elements']['Stress']) or 100 local radio = getElementData(localPlayer, "ae.frequencia") or 0 local x,y,z = getElementPosition(localPlayer) local street = getZoneName ( x, y, z, true ) local direction = getZoneName ( x, y, z, false ) local time = getRealTime() local hours = string.format("%02d:%02d", time.hour, time.minute) local minutes = time.minute if getPedOccupiedVehicle(localPlayer) then fuel = getElementData(getPedOccupiedVehicle(getLocalPlayer()), configs['Elements']['fuel']) or 0 speed = ( function( x, y, z ) return math.floor( math.sqrt( x*x + y*y + z*z ) * 155 ) end )( getElementVelocity( getPedOccupiedVehicle(localPlayer) ) ) end SendNUIMessage(browser, { vehicle = vehicle, talking = talking, health = health, armour = armour, thirst = thirst, hunger = hunger, street = street, radio = radio, time = hours, minutes = minutes, direction = direction, voice = voice, speed = speed, fuel = fuel }) end
  4. local time = getRealTime() local timeString = string.format("%02d:%02d", time.hour, time.minute) -- OR local timeString = os.date ("%H:%M") os.date function
  5. local sx, sy = guiGetScreenSize() local px = math.min(1, math.max(sx/1920, sy/1080)) dxDrawImage (500*px, 500*px, 256*px, 100*px, texture)
  6. AngelAlpha

    vehicle

    addEventHandler("onVehicleExplode", root, function() destroyElement(source) end) server side
  7. Вариации это misc** объекты в машине, благодаря которым у стандартного монстра например на крыше создается спойлер или фары.
  8. А что ты хочешь сделать? Для чего тебе пропускать параметры?
  9. определенного символа на сколько я знаю нет. Чат парадайса кастомный (свой, а не стандартный), и написан на dx. Чтобы сделать тень на dx надо сместить текст на 1 пиксель в сторону local startPosX, startPosY = 500, 500 dxDrawText("Привет", startPosX, startPosY, startPosX + 50, startPosY + 20, tocolor(0, 0, 0, 200), 1, "default-bold", "left", "top") -- 0, 0, 0, 200 - черная тень dxDrawText("Привет", startPosX + 1, startPosY + 1, startPosX + 1 + 50, startPosY + 1 + 20, tocolor(255, 255, 255), 1, "default-bold", "left", "top") -- Обычный текст Есть функция на вики
  10. Чтобы если твой файл попал в кэш, его не смогли изменить Верно, качается только клиентские скрипты и файлы. Но можно отключить кэширование в мете. Серверным файлам не нужно отключать кеширование, т.к. они туда и так не попадают <srcipt src="?????.lua" cache="false"/> <file src="?????.png" cache="false"/>
  11. When you double-click create edit box, when you change a data
  12. local trailers = {} local hooktruck = {} addCommandHandler ("trailers", function (thePlayer, cmd, trailernum) if not trailernum or not tonumber (trailernum) then outputChatBox ("* Syntax is: /trailers number", thePlayer, 255, 0, 0) return end local num = tonumber (trailernum) if num < 1 or num > 15 then outputChatBox ("* You can create trailer in the range from 1 to 15", thePlayer, 255, 0, 0) return end if trailers[thePlayer] then for k, trailer in pairs (trailers[thePlayer]) do if isElement (trailer) then destroyElement(trailer) end trailers[thePlayer][k] = nil end trailers[thePlayer] = {} else trailers[thePlayer] = {} end if hooktruck[thePlayer] then if isElement (hooktruck[thePlayer]) then destroyElement(hooktruck[thePlayer]) end hooktruck[thePlayer] = nil end local myVeh = getPedOccupiedVehicle (thePlayer) if not myVeh then outputChatBox ("* You need seat in vehicle", thePlayer, 255, 0, 0) return end local pos = Vector3(getElementPosition(myVeh)) for i=1, num do if i == 1 then hooktruck[thePlayer] = createVehicle (591, pos) setTimer (attachTrailerToVehicle, 200, 1, myVeh, hooktruck[thePlayer][1]) else trailers[thePlayer][i-1] = createVehicle (514, 0, 0, 10) local parent = (i == 2) and hooktruck[thePlayer] or trailers[thePlayer][i-2] setTimer (attachTrailerToVehicle, 200, 1, parent, trailers[thePlayer][i-1]) end end collectgarbage() end ) Try this code
  13. Working?
  14. local kapcsolat = exports["mysql"]:getConnection() function Garage (thePlayer) local theTeam = getPlayerTeam(thePlayer) if not theTeam or not getTeamName(theTeam) == "ORFK" then outputChatBox("Nincs engedelyed hozza") return end createVehicle(596, 1574.003, -1711.330, 5.98) outputChatBox("Sikeressen le kertred az autot") end addCommandHandler("vhs", Garage) Check this code
  15. Insert into server file addEvent ("giveMoney", true) addEventHandler ("giveMoney", root, function(...) local args = {...} local pl local money if source == resourceRoot then pl = client money = tonumber(args[1]) and args[1] or args[2] elseif getElementType(source) == "player" then pl = source money = tonumber(args[1]) and args[1] or args[2] elseif args[1] and getElementType(args[1]) == "player" then pl = args[1] money = args[2] end if not pl or not money then error ("Player or money not found!") end givePlayerMoney (pl, money) end) Universal code) P.S. I not testing
  16. show me your meta.xml
  17. By ID car - no, only ID world sound groups
  18. Ну да, тип того
  19. Создается квадратный RT (dxCreateRenderTarget), 1024*1024, можно и больше 2048*2048 но тогда будет перерасход памяти. И в нем рисуются картинки или текст через dxDrawImage/dxDrawText соответственно. И потом просто шейдером наложения накладывается на машину. А шейдер обычный с заменой текстуры и слоем накладывается на машину //-- Declare the texture. These are set using dxSetShaderValue( shader, "Tex0", texture ) texture Tex0; technique simple { pass P0 { //-- Set up texture stage 0 Texture[0] = Tex0; //-- Leave the rest of the states to the default settings } }
  20. local startTick = nil local speedAnim = 4000 local enabled = false local state = false local curAnim = 0 function shamalFunctions() startTick = getTickCount() state = true enabled = not enabled end bindKey("u", "down", shamalFunctions) addEventHandler ('onClientRender', root, function() local vehicle = getPedOccupiedVehicle(localPlayer) if not vehicle then return end if getElementModel(vehicle) ~= 519 then return end if not enabled then return end local easing = math.min(1, getEasingValue ((getTickCount()-startTick)/speedAnim, "Linear") if state then curAnim = easing else curAnim = 1 - easing end if curAnim <= 0.5 then local rx, ry, rz = getVehicleComponentRotation(vehicle, "gearflapleft") local newEasing = reMap (curAnim, 0, 0.5, 0, 1) setVehicleComponentRotation(vehicle, "gearflapleft", rx, 90*newEasing, rz) else local rx, ry, rz = getVehicleComponentRotation(vehicle, "gearflapleft") local newEasing = reMap (curAnim, 0.5, 1, 0, 1) setVehicleComponentRotation(vehicle, "gearflapleft", 90*newEasing, ry, rz) end if easing == 1 then enabled = false end end) function reMap(value, low1, high1, low2, high2) return low2 + (value - low1) * (high2 - low2) / (high1 - low1) end Testing this code
  21. local sx, sy = guiGetScreenSize() local px = math.min(1, math.max(sx/1920, sy/1080)) addEventHandler("onClientRender", root, function() local a = string.format("FPS: %d PING: %d", fps, getPlayerPing(localPlayer)) dxDrawText(a, sx - 190*px, sy - 15*px, sx, sy, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) end ) Try this
  22. AngelAlpha

    ERROR

    function syncObjects (player) local vehicle = getPedOccupiedVehicle(player); if vehicle then local occupants = getVehicleOccupants(vehicle) if occupants then for i, v in pairs (occupants) do triggerLatentClientEvent (v, "tune.sync_objects", resourceRoot, getVehicleName (vehicle),getVehicleObjects(vehicle)) end end end end Try this
  23. Shader Hud mask or shader_circle Shader Examples
  24. AngelAlpha

    WARNING

    Allow weapon ID
  25. function save(command, text) local myFile = fileExists(myPath) and fileOpen(myPath) or fileCreate(myPath) fileOpen(myPath) fileWrite ( myFile, text ) fileClose(myFile) end addCommandHandler("save", save) function writeSaved() local myFile2 = fileExists(myPath) and fileOpen(myPath) or fileCreate(myPath) size = fileGetSize(myFile2) savedText = fileRead ( myFile2, size ) outputChatBox(savedText) fileClose(myFile2) end addCommandHandler("write", writeSaved)
×
×
  • Create New...