Jump to content

AngelAlpha

Members
  • Posts

    186
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by AngelAlpha

  1. change ipairs to pairs in function clickInv
  2. Use setVehicleComponentVisible
  3. click on middle mouse button)
  4. Use attachElements and then setElementAttachedOffsets with render event
  5. addCommandHandler("gramode", function () graMode = not graMode if graMode then outputChatBox("graMode is true", 255, 255, 255, true) else outputChatBox("graMode is false", 255, 255, 255, true) end end ) for example
  6. addEventHandler ("onClientClick", root, function(btn, state) if btn ~= "left" or state ~= "down" then return end if isMouseInPosition (xx*594, yy*396, xx*235, yy*300) then -- click 1-st button elseif isMouseInPosition (xx*840, yy*396, xx*235, yy*300) then -- click 2-nd button end end) function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) return ( ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) ) end isMouseInPosition wiki function
  7. addEvent('onPlayerRequestSpawnV', true) addEventHandler('onPlayerRequestSpawnV', root, function(vid) local x,y,z = getElementPosition(source); local _,_,r = getElementRotation(source); local spawnedV = getElementData(source, 'conce.garagem.spawneds') or {}; for i,v in ipairs(spawnedV) do if v.vidC == vid then if v.vh and isElement(v.vh) then destroyElement(v.vh) return false; end end end vehicleSV = createVehicle(vid, x,y,z,_,_,r) warpPedIntoVehicle(source, vehicleSV) table.insert(spawnedV, {vidC = vid, vh = vehicleSV}) end);
  8. setAccountData(getPlayerAccount(pl), "save:lastpos", toJSON({x, y, z}))
  9. function save (pl) local x, y, z = getElementPosition(pl) setAccountData(getPlayerAccount(pl), "save:lastpos", toJSON(x, y, z)) end function load (pl) local pos = getAccountData(getPlayerAccount(pl), "save:lastpos") if not pos then return end setElementPosition (pl, fromJSON(pos)) end addEventHandler ("onPlayerLogin", root, function() load (source) end) addEventHandler ("onPlayerQuit", root, function () save (source) end) addEventHandler ("onResourceStop", resourceRoot, function() for i, v in ipairs (getElementsByType("player")) do save(v) end end)
  10. Посмотри, может в дебаге ошибки (/debugscript 3) И я посмотрел, там нужен ресурс custom_coronas
  11. if getPedWeapon(source, 1) == 24 and getPedAmmoInClip (source, 1) ~= 0 then Тry this
  12. try this local sX, sY = guiGetScreenSize ( ) local onEmoji4 = {}; local plyEmoji4 = getElementsByType ( "player" ) local showEmoji4 = false function onEmoji4Render ( ) local cx, cy, cz = getCameraMatrix () for p in pairs (onEmoji4) do if ( isElement(p) ) then local x, y, z = getPedBonePosition.. --- -- blag blah blah local dEmoji4 = getDistanceBetweenPoints3D ( cx... -- blag blah blah if ( dEmoji4 < 100 ) then if ( isLineOfSightClear ( cx, cy... -- blag blah blah if (getElementData (p, "Emoji4") == true) then local sx, sy = getScreenFromWorldPosition...-- blag blah blah if ( sx ) and ( sy ) then local sEmoji4 = 400 / ...-- blag blah blah dxDrawImage ( sx - ( sEmoji4 / 2 ), sy - ( sEmoji4 / 2 ), sEmoji4, sEmoji4, "T_UI_Message_Icon_Aisatsu_BC.webp", 0, 0, 0, tocolor ( 255, 255, 255, 255 ) ) end end end end end end end function attachEmoji4 ( Emoji4 ) if not Emoji4 or not isElement ( Emoji4 ) then return end onEmoji4[Emoji4] = true addEventHandler ( "onClientRender", root, onEmoji4Render ) setTimer(function() removeEventHandler ( "onClientRender", root, onEmoji4Render ) end, 2000, 1) end addEvent( "StartEmoji", true ) addEventHandler( "StartEmoji", root, attachEmoji4 )
  13. setElementData(vehicle, "vehicle:upgrades", { turbo = true })
  14. попробуй поставить двухсторонние полигоны Картинка перейди в режим полигонов, выдели весь кузов и поставь ему двухсторонние полигоны
  15. -- Client local theButton = guiCreateButton(100, 200, 80, 40, "Toggle Engine On/Off", false) function handleButton (button,state) if ( button == "left" and state == "up" ) then if ( source == theButton ) then triggerServerEvent("toggleEngine", resourceRoot ) outputDebugString ( tostring ( source ) .. " clicked." ) end end end addEventHandler("onClientGUIClick", theButton, handleButton) -- Server function switchEngine () local theVehicle = getPedOccupiedVehicle ( client ) if theVehicle and getVehicleController ( theVehicle ) == client then local state = getVehicleEngineState ( theVehicle ) setVehicleEngineState ( theVehicle, not state ) end end addEvent("toggleEngine", true) addEventHandler ("toggleEngine", resourceRoot, switchEngine) addCommandHandler ("engine", switchEngine )
  16. setTimer(function() print ("1") end, 7000, 1)
  17. Покажи, о каком мерцании идет речь
  18. you can use mask shader. profile = dxCreateTexture( "assets/images/profile.png" ) shader = dxCreateShader ( "assets/archives/shader.fx" ) dxSetShaderValue ( shader, "sPicTexture", profile) dxSetShaderValue ( shader, "sMaskTexture", profile) function render() dxDrawImage( x, y, width, height, shader, 0, 0, 0, color ) end
  19. AngelAlpha

    setTimer

    addEventHandler("onVehicleExplode", root, function() setTimer(destroyElement,3000,1,source) end)
  20. лучше прикреплять к resourceRoot. На примере маркеров function startJob () local mrk = createMarker (.....) addEventHandler ("onMarkerHit", mrk, .....) end Когда игроки начнут работать (например), то будет очень много маркеров (mrk) и событий прикрепленных к ним. local mrks = {} function startJob (pl) mrks[pl] = createMarker (.....) end function func (pl) if source == mrks[pl] then ....... end end addEventHandler ("onMarkerHit", resourceRoot, func) Если сделать так, то одно событие работает только на маркера которые созданы именно данным ресурсом
×
×
  • Create New...