-
Posts
186 -
Joined
-
Last visited
-
Days Won
4
Everything posted by AngelAlpha
-
change ipairs to pairs in function clickInv
-
Use setVehicleComponentVisible
-
click on middle mouse button)
-
engineImportTXD
-
[QUESTION] Attaching moving objects to a vehicle
AngelAlpha replied to NovaCrew's topic in Scripting
Use attachElements and then setElementAttachedOffsets with render event -
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
-
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
-
getGroundPosition
-
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);
-
How I can persist position data? Persist position data! [HELP]
AngelAlpha replied to Murilo_apa's topic in Scripting
setAccountData(getPlayerAccount(pl), "save:lastpos", toJSON({x, y, z})) -
How I can persist position data? Persist position data! [HELP]
AngelAlpha replied to Murilo_apa's topic in Scripting
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) -
Посмотри, может в дебаге ошибки (/debugscript 3) И я посмотрел, там нужен ресурс custom_coronas
-
if getPedWeapon(source, 1) == 24 and getPedAmmoInClip (source, 1) ~= 0 then Тry this
-
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 )
- 6 replies
-
- 1
-
- triggerevent
- help
-
(and 1 more)
Tagged with:
-
setElementData(vehicle, "vehicle:upgrades", { turbo = true })
-
попробуй поставить двухсторонние полигоны Картинка перейди в режим полигонов, выдели весь кузов и поставь ему двухсторонние полигоны
-
-- 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 )
-
доступа нет
-
setTimer(function() print ("1") end, 7000, 1)
-
MTA Province. Артефакты интерфейса.
AngelAlpha replied to Zahrumka's topic in Помощь / Отчеты об ошибках
Я думаю, это все таки проблема скрипта -
Покажи, о каком мерцании идет речь
-
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
- 1 reply
-
- 1
-
addEventHandler("onVehicleExplode", root, function() setTimer(destroyElement,3000,1,source) end)
-
лучше прикреплять к 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) Если сделать так, то одно событие работает только на маркера которые созданы именно данным ресурсом
-
Problem with logging in to the servers
AngelAlpha replied to NikolayRacer132's topic in Помощь / Отчеты об ошибках
Выключи посторонние программы