SaNoR

Members
  • Content Count

    22
  • Joined

  • Last visited

  • Days Won

    1

SaNoR last won the day on October 15

SaNoR had the most liked content!

Community Reputation

9 Neutral

About SaNoR

  • Rank
    Civilian

Recent Profile Visitors

276 profile views
  1. SaNoR

    Problem with setTimer

    https://wiki.multitheftauto.com/wiki/Introduction_to_Scripting_the_GUI#Relative_and_Absolute
  2. SaNoR

    Problem with setTimer

    local sw, sh = guiGetScreenSize() local jumpTimer = 0 local reload = 3000 function jump() if getTickCount() - jumpTimer > reload then local vehicle = getPedOccupiedVehicle(localPlayer) if(vehicle)then local sx, sy, sz = getElementVelocity(vehicle) setElementVelocity(vehicle, sx, sy, sz+0.33) end jumpTimer = getTickCount() end end addEventHandler("onClientRender", root, function() local now = getTickCount() local endTime = jumpTimer + reload local elapsedTime = now - jumpTimer local duration = endTime - jumpTimer local progress = elapsedTime / duration local width = interpolateBetween(0, 0, 0, 200, 0, 0, progress, "Linear") dxDrawRectangle(sw/2 - 100, sh - 100, 200, 20, tocolor(0, 0, 0, 180)) dxDrawRectangle(sw/2 - 100, sh - 100, width, 20, tocolor(0, 255, 0, 180)) end) bindKey("lshift", "down", jump)
  3. SaNoR

    Vehicle engine starter

    function engine() local vehicle = getPedOccupiedVehicle(localPlayer) if isElement(vehicle) and getPedOccupiedVehicleSeat(localPlayer) == 0 then local state = getVehicleEngineState(vehicle) if not state then startTimer = setTimer( function() if isElement(vehicle) and getPedOccupiedVehicleSeat(localPlayer) == 0 then setVehicleEngineState(vehicle, true) end end , 2000, 1) else setVehicleEngineState(vehicle, false) end end end function resetEngine() if isTimer(startTimer) then killTimer(startTimer) end end bindKey("2", "down", engine) bindKey("2", "up", resetEngine)
  4. SaNoR

    GHOSTMODE FOR PEDS

    setElementCollisionsEnabled Note: Disabling a peds collisions will cause some problems, such as it being unable to move. setElementCollidableWith
  5. SaNoR

    [HELP] CallRemote

    https://wiki.multitheftauto.com/wiki/Template:Error_codes_for_callRemote_and_fetchRemote Try without "mtasa://" callRemote ( "XXX.XXX.XX.XXX:XXXXX",getResourceFromName('runcode'),'httpRun',finishedCallback,"outputChatBox('Text',root)" )
  6. SaNoR

    Vehicle Component Sync Question

    Server side: addCommandHandler("vcp", function(player) local vehicle = getPedOccupiedVehicle(player) if isElement(vehicle) then triggerClientEvent(root, "syncVehicleComponents", vehicle) end end) Client side: addEvent("syncVehicleComponents", true) addEventHandler("syncVehicleComponents", root, function() if isElement(source) and getElementType(source) == "vehicle" then local x, y, z = getVehicleComponentPosition(source, "wheel_rf_dummy") setVehicleComponentPosition(source, "wheel_rf_dummy", x+0.15, y, z) local x, y, z = getVehicleComponentPosition(source, "wheel_rb_dummy") setVehicleComponentPosition(source, "wheel_rb_dummy", x+0.15, y, z) local x, y, z = getVehicleComponentPosition(source, "wheel_lf_dummy") setVehicleComponentPosition(source, "wheel_lf_dummy", x-0.15, y, z) local x, y, z = getVehicleComponentPosition(source, "wheel_lb_dummy") setVehicleComponentPosition(source, "wheel_lb_dummy", x-0.15, y, z) end end)
  7. SaNoR

    Max stats on cycling/bmx skill while testing on map

    addEventHandler("onClientVehicleEnter", root, function(player, seat) if getElementModel(source) == 481 then setPedStat(player, 229, 1000) setPedStat(player, 230, 1000) end end)
  8. SaNoR

    [HELP] Admins Online

    GetOnlineAdmins
  9. SaNoR

    Server side variable to client side dxDraw

    triggerServerEvent("getshops", getRootElement()) Attach trigger to button or "onClientRender"
  10. SaNoR

    Server side variable to client side dxDraw

    Server: function getShops() for k, v in ipairs(shops) do triggerClientEvent("getshopsClient", root, shops[k][4]) end end addEvent("getshops", true) addEventHandler("getshops", getRootElement(), getShops) Client: local cost = 0 addEvent("getshopsClient", true) addEventHandler("getshopsClient", root, function(value) cost = value end) ... dxDrawText("#ffffffCost: #6ad622"..cost.. " $" ,x/2+ 10, y/2+index*58+18.5, panelSize[1], 25*2.3, tocolor(66, 244, 220, 255), 0.8, font2, "left", "top", false, false, false, true) ...
  11. SaNoR

    How to prevent outputChatBox Spam in a for?

    function func() local text = "" for index, player in ipairs(getElementsByType("player")) do if getElementData(player,"Money") == 10000 then local len = string.len(text) local name = getPlayerName(player) if len == 0 then text = name elseif len > 0 and len <= 256 then if (len + string.len(tostring(", "..name))) > 256 then outputChatBox(text, player) text = name else text = text..", "..name end end end end if string.len(text) > 0 then outputChatBox(text, player) end end
  12. SaNoR

    Difficulties with Lua patterns

    You are welcome 😉
  13. SaNoR

    Difficulties with Lua patterns

    Yes
  14. SaNoR

    i need help :(

    dxDrawRectangle(screenWidth/3.3595, screenHeight/2.4406, screenWidth/2.4710, screenHeight/5.4961, tocolor(0, 0, 0, alpha))