Jump to content

Search the Community

Showing results for tags 'مسأعده في كود بسيط'.

  • 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
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 1 result

  1. سلأم عليكم أبي لما ينتهي الشريط يجي أنميشن ذأ الي توصلت له من الويكي Client: local screenWidth, screenHeight = guiGetScreenSize () -- Get the screen resolution (width and height) function isElementMoving(theElement) if isElement (theElement) then return Vector3( getElementVelocity(theElement) ).length ~= 0 end return false end local screenWidth, screenHeight = guiGetScreenSize () local x,y = guiGetScreenSize() local show = true setElementData(localPlayer, "thirsty", 60) function drawHud() if (show==true) then local thirsty = getElementData(localPlayer, "thirsty") dxDrawRectangle(683, 107, 196, 30, tocolor(0, 0, 0, 150)) dxDrawRectangle(x-326, 34+80, thirsty*3, 17, tocolor(1, 96, 253, 255)) dxDrawText("Fatigue", 745, 115, 825, 140, tocolor(255, 255, 255), 1, "default-bold", "center") end end addEventHandler("onClientRender", root, drawHud) addEvent("onLocalPlayerStartsMoving") addEvent("onLocalPlayerStopsMoving") local localPlayerMoving = false local deadSpeed = 0.01 setTimer(function () local vx, vy, vz = getElementVelocity(localPlayer) local speed = (vx^2 + vy^2 + vz^2)^0.5 if not localPlayerMoving and speed > deadSpeed then -- if starts moving localPlayerMoving = true triggerEvent("onLocalPlayerStartsMoving", localPlayer) elseif localPlayerMoving and speed <= deadSpeed then -- if stops moving localPlayerMoving = false triggerEvent("onLocalPlayerStopsMoving", localPlayer) end end, 100, 0) -- Usage example: addEventHandler("onLocalPlayerStartsMoving", localPlayer, function() ---------------dxDrawRectangle(473, 109, 92, 27, tocolor(0, 0, 0, 150)) end) addEventHandler("onLocalPlayerStopsMoving", localPlayer, function() -----------------setElementData(localPlayer, "thirsty", 60) end) setTimer(function() -------if not isElementMoving(localPlayer) then return end local under1 = getElementData(localPlayer, "thirsty") setElementData(localPlayer, "thirsty", under1-1) end, 900, 0) addEventHandler("onClientRender", root, setTimer) function die() local piageci = getElementData(localPlayer, "thirsty") if (piageci==0) then setElementData(localPlayer, "thirsty", 60) triggerServerEvent ("san1", localPlayer) end end addEventHandler("onClientElementDataChange", root, die) -- Hide the hud when the resource is started local components = { "weapon", "ammo", "health", "clock", "money", "breath", "armour", "wanted" } addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () for _, component in ipairs( components ) do setPlayerHudComponentVisible( component, false ) end end) function fixhud() setPlayerHudComponentVisible( component, false ) end addCommandHandler("fixhud", fixhud) Server: addEvent("san1", true) addEventHandler ("san1",root, function ( ) if not getElementData(thePlayer, "sitting") then setPedAnimation(thePlayer, "ped", "seat_down", -1, false, false, false, false) setElementData(thePlayer, "sitting", true) else setPedAnimation(thePlayer) removeElementData(thePlayer, "sitting") end end)
×
×
  • Create New...