Search the Community

Showing results for tags 'side'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
  • Archive
  • Private Bugtracker

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Gang


Location


Occupation


Interests

Found 8 results

  1. Client side: function showPlayerFuel() hidePlayerFuel(true); fuelFrame = guiCreateStaticImage( 0.72, 0.79, 0.05, 0.20, "images/Fuel_Gage.png", true) fuelBar1 = guiCreateStaticImage( 0.742, 0.811, 0.021, 0.17, "images/Fuel_Dot.png", true) guiBringToFront ( fuelFrame ) end addEvent("FullTank", true ) addEventHandler("FullTank", resourceRoot, showPlayerFuel) addEvent("fullRefill", true) addEventHandler("fullRefill",resourceRoot, showPlayerFuel) addEvent("fuelGageShow", true) addEventHandler("fuelGageShow", resourceRoot, showPlayerFuel) function CurrentFuelIn ( currentFuel ) local sizex = currentFuel["sizex"] local sizey = currentFuel["sizey"] local posx = currentFuel["posx"] local posy = currentFuel["posy"] hidePlayerFuel(true); fuelBar1 = guiCreateStaticImage( tonumber(posx), tonumber(posy), tonumber(sizex), tonumber(sizey), "images/Fuel_Dot.png", true) fuelFrame = guiCreateStaticImage( 0.72, 0.79, 0.05, 0.20, "images/Fuel_Gage.png", true) if(posy and posy > 0.9) then if not warningdot1 then warningdot1 = guiCreateStaticImage( 0.7288, 0.912, 0.014, 0.016, "images/warning_dot.png", true) end if((Posy or 0) >= 0.981) then setVehicleEngineState(getPedOccupiedVehicle(localPlayer),false) else outputChatBox("-- You Are Quite Low On Fuel | Refuel at Area 69", 255, 50, 50, true) playSoundFrontEnd(4) end end end addEvent("CurrentFuel", true) addEventHandler("CurrentFuel", resourceRoot, CurrentFuelIn) function startExit ( vehicle,seat ) if seat == 0 and fuelBar1 then local x, y = guiGetSize( fuelBar1, true ) local Posx, Posy = guiGetPosition ( fuelBar1, true ) local fTbl = {} fTbl.sizex = x fTbl.sizey = y fTbl.posx = Posx fTbl.posy = Posy triggerServerEvent('onGetFuel',vehicle,fTbl) hidePlayerFuel() if(fuelTimer) then killTimer(fuelTimer) fuelTimer = false; end end end addEventHandler("onClientPlayerVehicleExit", localPlayer, startExit ) function vehEntered ( veh,seat ) if seat == 0 and isElement(fuelBar1) then local Posx, Posy = guiGetPosition ( fuelBar1, true ) if(Posy and Posy >= 0.981) then setVehicleEngineState(veh,false) end end if(isTimer(fuelTimer)) then killTimer(fuelTimer); fuelTimer = nil; end fuelTimer = setTimer ( decFuel1, 2000, 0) end addEventHandler("onClientPlayerVehicleEnter", localPlayer, vehEntered ) function decFuel1() local PlayerInCar = getPedOccupiedVehicle( getLocalPlayer() ) if (PlayerInCar and getVehicleController(PlayerInCar) == localPlayer and not isPedDead(localPlayer) ) then if(not fuelBar1) then showPlayerFuel(); return; end local x, y = guiGetSize( fuelBar1, true ) local Posx, Posy = guiGetPosition ( fuelBar1, true ) local NewY,NewPosY if not Posy then return end if((isElementWithinColShape(localPlayer,safeZone) or isElementWithinSafeArea(localPlayer)) and Posy > 0.812) then NewY = y + 0.009 NewPosY = Posy - 0.009 if(warningdot1) then destroyElement(warningdot1) warningdot1 = nil playSoundFrontEnd(1) end elseif(Posy < 0.981) then local velo = getActualVelocity( PlayerInCar ) local val = (velo < 5 and 0) or (velo < 100 and 0.0007) or 0.0010 -- 6 / 9 NewY = y - val NewPosY = Posy + val if(Posy and (Posy > 0.885 and Posy < 0.95) and not warningdot1) then warningdot1 = guiCreateStaticImage( 0.7288, 0.912, 0.014, 0.016, "images/warning_dot.png", true) playSoundFrontEnd(4) outputChatBox("Your vehicle tank is about to run out.", 255, 100, 100); end elseif (Posy >= 0.981 and getVehicleEngineState(PlayerInCar)) then setVehicleEngineState(PlayerInCar,false) callServerFunction('setVehicleEngineState',PlayerInCar,false) end if(NewY) then guiSetSize(fuelBar1, x, NewY, true) end if(NewPosY) then guiSetPosition(fuelBar1, Posx, NewPosY, true ) end elseif(fuelTimer) then hidePlayerFuel() end end function hidePlayerFuel(bDontDestroyTimer) if(fuelFrame) then destroyElement(fuelFrame) fuelFrame = nil; end if(fuelBar1) then destroyElement(fuelBar1) fuelBar1 = nil; end if(warningdot1) then destroyElement(warningdot1); warningdot1 = nil; end if(not bDontDestroyTimer and isTimer(fuelTimer)) then killTimer(fuelTimer); fuelTimer = nil; end end addEvent("jacked", true ) addEventHandler("jacked", resourceRoot, hidePlayerFuel ) function getActualVelocity( element ) if(element) then x,y,z = getElementVelocity(element) end return math.sqrt(x^2 + y^2 + z^2) * 161 end Server side: function startExit ( vehicle,seat ) if seat == 0 and fuelBar1 then local x, y = guiGetSize( fuelBar1, true ) local Posx, Posy = guiGetPosition ( fuelBar1, true ) local fTbl = {} fTbl.sizex = x fTbl.sizey = y fTbl.posx = Posx fTbl.posy = Posy triggerServerEvent('onGetFuel',vehicle,fTbl) hidePlayerFuel() if(fuelTimer) then killTimer(fuelTimer) fuelTimer = false; end end end function vehEntered ( veh,seat ) if seat == 0 and isElement(fuelBar1) then local Posx, Posy = guiGetPosition ( fuelBar1, true ) if(Posy and Posy >= 0.981) then setVehicleEngineState(veh,false) end end if(isTimer(fuelTimer)) then killTimer(fuelTimer); fuelTimer = nil; end fuelTimer = setTimer ( decFuel1, 2000, 0) end function decFuel1() local PlayerInCar = getPedOccupiedVehicle( getLocalPlayer() ) if (PlayerInCar and getVehicleController(PlayerInCar) == localPlayer and not isPedDead(localPlayer) ) then if(not fuelBar1) then showPlayerFuel(); return; end local x, y = guiGetSize( fuelBar1, true ) local Posx, Posy = guiGetPosition ( fuelBar1, true ) local NewY,NewPosY if not Posy then return end if((isElementWithinColShape(localPlayer,safeZone) or isElementWithinSafeArea(localPlayer)) and Posy > 0.812) then NewY = y + 0.009 NewPosY = Posy - 0.009 if(warningdot1) then destroyElement(warningdot1) warningdot1 = nil playSoundFrontEnd(1) end elseif(Posy < 0.981) then local velo = getActualVelocity( PlayerInCar ) local val = (velo < 5 and 0) or (velo < 100 and 0.0007) or 0.0010 -- 6 / 9 NewY = y - val NewPosY = Posy + val if(Posy and (Posy > 0.885 and Posy < 0.95) and not warningdot1) then warningdot1 = guiCreateStaticImage( 0.7288, 0.912, 0.014, 0.016, "images/warning_dot.png", true) playSoundFrontEnd(4) outputChatBox("Your vehicle tank is about to run out.", 255, 100, 100); end elseif (Posy >= 0.981 and getVehicleEngineState(PlayerInCar)) then setVehicleEngineState(PlayerInCar,false) callServerFunction('setVehicleEngineState',PlayerInCar,false) end if(NewY) then guiSetSize(fuelBar1, x, NewY, true) end if(NewPosY) then guiSetPosition(fuelBar1, Posx, NewPosY, true ) end elseif(fuelTimer) then hidePlayerFuel() end end function hidePlayerFuel(bDontDestroyTimer) if(fuelFrame) then destroyElement(fuelFrame) fuelFrame = nil; end if(fuelBar1) then destroyElement(fuelBar1) fuelBar1 = nil; end if(warningdot1) then destroyElement(warningdot1); warningdot1 = nil; end if(not bDontDestroyTimer and isTimer(fuelTimer)) then killTimer(fuelTimer); fuelTimer = nil; end end addEvent("jacked", true ) addEventHandler("jacked", resourceRoot, hidePlayerFuel ) function getActualVelocity( element ) if(element) then x,y,z = getElementVelocity(element) end return math.sqrt(x^2 + y^2 + z^2) * 161 end
  2. Hi! My problem is that on the client side the object is seen by only one person who has tried it out and I want everyone to see the object on the server. Client Side: local rx,ry,rz = getElementPosition(getElementData(localPlayer,"cage")) local cx,cy,cz = getVehicleComponentPosition(getElementData(localPlayer,"cage"),"static_p01") local x,y,z = rx + cx, ry + cy+3, 0.8 local a,b = getScreenFromWorldPosition(x,y,z) local magnet = createObject(1301, rx-0.6, ry-5, rz+4, 0, 0, 0) setObjectScale(magnet, 0.3) setElementCollisionsEnabled(magnet, false) moveObject(magnet, 1000*60*1, rx-0.6, ry-5, rz-50) setTimer(function() destroyElement(magnet) local magnet2 = createObject(1301, rx-0.6, ry-5, rz-50, 0, 0, 0) setObjectScale(magnet2, 0.3) setElementCollisionsEnabled(magnet2, false) moveObject(magnet2, 1000*60*1, rx-0.6, ry-5, rz+4) local crate = createObject(1224, rx-0.6, ry-5, rz-50.3, 0, 0, 0) moveObject(crate, 1000*60*1, rx-0.6, ry-5, rz+3.3) setElementCollisionsEnabled(crate, false) setTimer(function() usedMagnet = false end, 1000*60*1, 1) end, 1000*60*1, 1) In principle I should only use this server site: setElementVisibleTo
  3. This is the code: function stimers(thePlayer) if getElementData(thePlayer,"asdasd") == true then local lejartimer1 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","10 mins!") local lejartimer2 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","9 mins!") end,60000, 1) local lejartimer3 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","8 mins!") end,120000, 1) local lejartimer4 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","7 mins!") end,180000, 1) local lejartimer5 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","6 mins!") end,240000, 1) local lejartimer6 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","5 mins!") end,300000, 1) local lejartimer7 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","4 mins!") end,360000, 1) local lejartimer8 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","3 mins") end,420000, 1) local lejartimer9 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","2 mins") end,480000, 1) local lejartimer10 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","1 mins") end,540000, 1) local lejartimer11 = setTimer(function() setElementVisibleTo(mark, thePlayer, false) setElementData(thePlayer, "asdasd", false) local pos = positions[math.random(1,#positions)] setElementPosition ( mark, pos.x,pos.y,pos.z ) end,600000, 1) end,100,1) --- elseif getElementData(thePlayer,"asdasd") == false then if isTimer ( lejartimer1 ) then killTimer ( lejartimer1 ) end if isTimer ( lejartimer2 ) then killTimer ( lejartimer2 ) end if isTimer ( lejartimer3 ) then killTimer ( lejartimer3 ) end if isTimer ( lejartimer4 ) then killTimer ( lejartimer4 ) end if isTimer ( lejartimer5 ) then killTimer ( lejartimer5 ) end if isTimer ( lejartimer6 ) then killTimer ( lejartimer6 ) end if isTimer ( lejartimer7 ) then killTimer ( lejartimer7 ) end if isTimer ( lejartimer8 ) then killTimer ( lejartimer8 ) end if isTimer ( lejartimer9 ) then killTimer ( lejartimer9 ) end if isTimer ( lejartimer10 ) then killTimer ( lejartimer10 ) end end end addEvent("ctimers",true) addEventHandler("ctimers", root,stimers) Why not working the killTimers? How to fix this?
  4. function test() setElementPosition ( mark, pos.x,pos.y,pos.z ) end addEventHandler("onMarkerHit", mark, test) this is the code. if i hit the marker, the element position change for all players.. how to fix this? sorry for my bad english.
  5. This is the code: When i type twice " /asd " the marker position does not change.. How to fix this?
  6. This is the code: And i get this warnings: bad argument @ 'stopSound' [expected sound at argument 1, got nil] and bad argument @ 'detachElement' [expected element at argument 1, got nil] .. -.- how to fix this?
  7. I tried triggering, but does not working :c How to get my account name in client side?
  8. -- client -- local displayWidth, displayHeight = guiGetScreenSize(); local notificationData = {}; local notificationFont = dxCreateFont('files/fonts/roboto.ttf', 12 * 2, false); local iconsFont = dxCreateFont('files/fonts/icons.ttf', 12 * 2, false); addEventHandler('onClientRender', root, function() for k, v in pairs(notificationData) do if (v.State == 'fadeIn') then local alphaProgress = (getTickCount() - v.AlphaTick) / 650; local alphaAnimation = interpolateBetween(0, 0, 0, 255, 0, 0, alphaProgress, 'Linear'); if (alphaAnimation) then v.Alpha = alphaAnimation; else v.Alpha = 255; end if (alphaProgress > 1) then v.Tick = getTickCount(); v.State = 'openTile'; end elseif (v.State == 'fadeOut') then local alphaProgress = (getTickCount() - v.AlphaTick) / 650; local alphaAnimation = interpolateBetween(255, 0, 0, 0, 0, 0, alphaProgress, 'Linear'); if (alphaAnimation) then v.Alpha = alphaAnimation; else v.Alpha = 0; end if (alphaProgress > 1) then notificationData = {}; end elseif (v.State == 'openTile') then local tileProgress = (getTickCount() - v.Tick) / 350; local tilePosition = interpolateBetween(v.StartX, 0, 0, v.EndX, 0, 0, tileProgress, 'Linear'); local tileWidth = interpolateBetween(0, 0, 0, v.Width, 0, 0, tileProgress, 'Linear'); if (tilePosition and tileWidth) then v.CurrentX = tilePosition; v.CurrentWidth = tileWidth; else v.CurrentX = v.EndX; v.CurrentWidth = v.Width; end if (tileProgress > 1) then v.State = 'fixTile'; setTimer(function() v.Tick = getTickCount(); v.State = 'closeTile'; end, string.len(v.Text) * 45 + 5000, 1); end elseif (v.State == 'closeTile') then local tileProgress = (getTickCount() - v.Tick) / 350; local tilePosition = interpolateBetween(v.EndX, 0, 0, v.StartX, 0, 0, tileProgress, 'Linear'); local tileWidth = interpolateBetween(v.Width, 0, 0, 0, 0, 0, tileProgress, 'Linear'); if (tilePosition and tileWidth) then v.CurrentX = tilePosition; v.CurrentWidth = tileWidth; else v.CurrentX = v.StartX; v.CurrentWidth = 0; end if (tileProgress > 1) then v.AlphaTick = getTickCount(); v.State = 'fadeOut'; end elseif (v.State == 'fixTile') then v.Alpha = 255; v.CurrentX = v.EndX; v.CurrentWidth = v.Width; end roundedRectangle(v.CurrentX, 20, 25 + v.CurrentWidth, 25, tocolor(0, 0, 0, 150 * v.Alpha / 255), _, true); dxDrawRectangle(v.CurrentX, 20, 25, 25, tocolor(0, 0, 0, 255 * v.Alpha / 255), true); if (v.Alpha == 255) then dxDrawText(v.Text, v.CurrentX + 25 + 10, 20, v.CurrentX + 25 + 10 + v.CurrentWidth - 20, 20 + 25, tocolor(255, 255, 255, 255), 0.40, notificationFont, 'center', 'center', true, false, true); end if (v.Type == 'error') then dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(215, 90, 90, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true); elseif (v.Type == 'warning') then dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(220, 180, 80, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true); elseif (v.Type == 'info') then dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(85, 180, 245, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true); elseif (v.Type == 'success') then dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(80, 205, 105, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true); end end end ) addEvent('addNotification', true); function addNotification(text, type) if (text and type) then if (notificationData ~= nil) then table.remove(notificationData, #notificationData); end table.insert(notificationData, { StartX = (displayWidth / 2) - (25 / 2), EndX = (displayWidth / 2) - ((dxGetTextWidth(text, 0.40, notificationFont) + 20 + 25) / 2), Text = text, Width = dxGetTextWidth(text, 0.40, notificationFont) + 20, Alpha = 0, State = 'fadeIn', Tick = 0, AlphaTick = getTickCount(), CurrentX = (displayWidth / 2) - (25 / 2), CurrentWidth = 0, Type = type or 'info' } ); playSoundFrontEnd(11); end end addEventHandler('addNotification', root, addNotification); function roundedRectangle(x, y, w, h, borderColor, bgColor, postGUI) if (x and y and w and h) then if (not borderColor) then borderColor = tocolor(0, 0, 0, 200); end if (not bgColor) then bgColor = borderColor; end --> Background dxDrawRectangle(x, y, w, h, bgColor, postGUI); --> Border dxDrawRectangle(x + 2, y - 1, w - 4, 1, borderColor, postGUI); -- top dxDrawRectangle(x + 2, y + h, w - 4, 1, borderColor, postGUI); -- bottom dxDrawRectangle(x - 1, y + 2, 1, h - 4, borderColor, postGUI); -- left dxDrawRectangle(x + w, y + 2, 1, h - 4, borderColor, postGUI); -- right end end -- server -- function addNotification(player, text, type) if (player and text and type) then exports["notices"]:addNotification("Test","success"); triggerClientEvent(player, 'addNotification', player, text, type); end end addEventHandler("onResourceStart", addNotification, player, text, type)