Jump to content

-.Paradox.-

Members
  • Posts

    1,239
  • Joined

  • Last visited

Everything posted by -.Paradox.-

  1. -.Paradox.-

    hud

    Topic name says "your own hud" and the link you posted is just a random hud to evade getting your codes removed or banned.
  2. -.Paradox.-

    hud

    Yeah sure. Still a poor system
  3. -.Paradox.-

    hud

    And now you're cloning my hud... And as always noone is doing anything about it, poor system.
  4. Woovie's code -- List of vehicle models that are compatible with the jetHUD local compatibleModels = { 592, 566, 511, 548, 512, 593, 425, 520, 417, 487, 553, 488, 497, 563, 476, 447, 519, 460, 469, 513 } local sw, sh = guiGetScreenSize() local iw, ih = 514, 514 local lineW = 2 local jetRender = dxCreateRenderTarget ( iw, ih, true ) local jetRender2 = dxCreateRenderTarget ( iw, ih, true ) local color = tocolor(255, 0, 0) -- Returns true if the local player is piloting a vehicle compatible with the jetHUD, false otherwise -- TODO: Check that the player is in the pilot's seat (no MTA function available?) function isPilotingCompatibleVehicle() local vehicle = getPedOccupiedVehicle(localPlayer) if not vehicle then return false end local vehicleModel = getElementModel(vehicle) for _, compatibleModel in ipairs(compatibleModels) do if vehicleModel == compatibleModel then return true end end return false end -- Changes the camera position on pre-render (to avoid stuttering) local function clientPreRender() if not isPilotingCompatibleVehicle() then return end local vehicle = getPedOccupiedVehicle(localPlayer) local cameraX, cameraY, cameraZ = getPositionFromElementOffset(vehicle, 0, -7, 4) local lookAtX, lookAtY, lookAtZ = getPositionFromElementOffset(vehicle, 0, 0, 2) local _, rotY= getElementRotation(vehicle) setCameraMatrix(cameraX, cameraY, cameraZ, lookAtX, lookAtY, lookAtZ, (rotY*-1)) end addEventHandler("onClientPreRender", root, clientPreRender) -- Renders the HUD local function clientRender() if not isPilotingCompatibleVehicle() or not jetRender then return end local vehicle = getPedOccupiedVehicle(localPlayer) dxSetRenderTarget ( jetRender, true ) local x, y, z = getElementPosition ( vehicle ) local rx, ry, rz = getElementRotation ( vehicle ) local sx, sy, sz = getElementVelocity ( vehicle ) local speed = ( sx^2 + sy^2 + sz^2 ) ^ ( 0.5 ) local mps = speed * 50 local kmh = speed * 180 local mph = speed * 111.847 --speed dxDrawLine ( 1, 200, 1, 220, color, lineW ) dxDrawLine ( 51, 200, 51, 220, color, lineW ) dxDrawLine ( 1, 200, 51, 200, color, lineW ) dxDrawLine ( 1, 220, 51, 220, color, lineW ) dxDrawText ( math.round(kmh, 2), 1, 201, 49, 219, color, 1, "clear", "center", "center", true, false, false, false, false ) --altitude dxDrawLine ( 463, 200, 463, 220, color, lineW ) dxDrawLine ( 513, 200, 513, 220, color, lineW ) dxDrawLine ( 463, 220, 513, 220, color, lineW ) dxDrawLine ( 463, 200, 513, 200, color, lineW ) dxDrawText ( math.round(z, 2), 464, 201, 512, 219, color, 1, "clear", "center", "center", true, false, false, false, false ) --pitch rx --yaw rz --200 pixels, 40 degrees, every 5 pixels = 1 degree local pixelOffset = 5 local rotmod = ( rz % 1 ) * pixelOffset local rotcal = math.floor( 200 - rotmod ) / pixelOffset for i=0,rotcal do if (i % 2 == 0) then dxDrawLine ( ( ( ( iw / 2 ) - 100 ) + rotmod + i * pixelOffset ), 40, ( ( ( iw / 2 ) - 100 ) + rotmod + i * pixelOffset ), 35, color, lineW ) else dxDrawLine ( ( ( ( iw / 2 ) - 100 ) + rotmod + i * pixelOffset ), 40, ( ( ( iw / 2 ) - 100 ) + rotmod + i * pixelOffset ), 30, color, lineW ) end end dxDrawText ( math.round(rz, 2), (iw/2)-25, 51, (iw/2)+25, 71, color, 1, "clear", "center", "center", true, false, false, false, false ) dxDrawLine ( (iw/2)-10, 50, (iw/2), 40, color, lineW ) dxDrawLine ( (iw/2)+10, 50, (iw/2), 40, color, lineW ) --level crosshairs dxDrawLine ( (iw/2)-30, 220, (iw/2)+30, 220, color, lineW ) dxDrawLine ( (iw/2), 220, (iw/2), 200, color, lineW ) dxSetRenderTarget() --roll ry ( for rotating pitch ) --400 pixels, 40 degrees, 10 pixels = 1 degree dxSetRenderTarget(jetRender2, true) local pixelOffset = 10 local height = 300 local rotmod = ( rx % 1 ) * pixelOffset local rotcal = math.floor( height - rotmod ) / pixelOffset for i=0,rotcal do if (i % 2 == 0) then dxDrawLine ( 65, ( ( ( iw / 2 ) - ( height / 2 ) ) + rotmod + i * pixelOffset ), 75, ( ( ( iw / 2 ) - ( height / 2 ) ) + rotmod + i * pixelOffset ), color, lineW ) dxDrawLine ( (iw-65), ( ( ( iw / 2 ) - ( height / 2 ) ) + rotmod + i * pixelOffset ), (iw-75), ( ( ( iw / 2 ) - ( height / 2 ) ) + rotmod + i * pixelOffset ), color, lineW ) else dxDrawLine ( 65, ( ( ( iw / 2 ) - ( height / 2 ) ) + rotmod + i * pixelOffset ), 70, ( ( ( iw / 2 ) - ( height / 2 ) ) + rotmod + i * pixelOffset ), color, lineW ) dxDrawLine ( (iw-65), ( ( ( iw / 2 ) - ( height / 2 ) ) + rotmod + i * pixelOffset ), (iw-70), ( ( ( iw / 2 ) - ( height / 2 ) ) + rotmod + i * pixelOffset ), color, lineW ) end end dxSetRenderTarget() dxDrawImage ( (sw/2)-(iw/2), (sh/2)-(ih/2), iw, ih, jetRender ) dxDrawImage ( (sw/2)-(iw/2), (sh/2)-(ih/2), iw, ih, jetRender2,(ry*-1) ) end addEventHandler("onClientRender", root, clientRender) function math.round(number, decimals, method) decimals = decimals or 0 local factor = 10 ^ decimals if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor else return tonumber(("%."..decimals.."f"):format(number)) end end function getPositionFromElementOffset(element,offX,offY,offZ) local m = getElementMatrix ( element ) -- Get the matrix local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] -- Apply transform local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2] local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3] return x, y, z -- Return the transformed point end addEventHandler("onClientPlayerVehicleExit", localPlayer, function() setCameraTarget(localPlayer) end) addEventHandler("onClientResourceStop", localPlayer, function() setCameraTarget(localPlayer) end)
  5. -.Paradox.-

    Staff

    It's from Grafuroam client side scripts, and he didn't manage to make the server side so he just copied the server side from random codes in a random topic. Remove the clientside.
  6. For hats/helmets try https://wiki.multitheftauto.com/wiki/CJ ... 5CHats_(16) And to replace water texture use engineApplyShaderToWorldTexture
  7. I made this along time ago, try it(opens and close with 'shop') Client: GUI = { Button = {}, Window = {}, Gridlist = {} } local weaponItems = { {'Bat', 500, 5, 500}, {'Chainsaw', 5000, 9, 1}, {'Knife', 500, 4, 500}, {'Katana', 3000, 8, 500}, {'Shovel', 5000, 6, 1}, {'Colt-45', 1000, 23, 500}, {'Silenced Pistol', 2500, 22, 500}, {'Desert Eagle', 2000, 24, 500}, {'Sawn-Off Shotgun', 4700, 26, 500}, {'Shotgun', 5000, 25, 500}, {'SPAZ-12', 4000, 27,500}, {'Uzi', 7500, 28, 500}, {'Tec-9', 7500, 32, 500}, {'MP5', 10500, 29, 500}, {'AK-47', 5000, 30, 500}, {'M4', 9000, 31, 500}, {'Country Rifle', 3000, 33, 500}, {'Sniper Rifle', 6000, 34, 500}, {'Rocket Launcher', 10000, 35, 500}, {'Heat-Seeking RPG', 10000, 36, 500}, {'Grenade', 3500, 16, 500}, {'Molotov Cocktails', 1500, 18, 500}, {'Satchel Charges', 1500, 39, 50}, {'Tear Gas', 300, 17, 500}, } addEventHandler('onClientResourceStart', resourceRoot, function() GUI.Window[1] = guiCreateWindow(510, 337, 287, 336, "Shop", false) guiSetAlpha(GUI.Window[1], 1.00) GUI.Gridlist[1] = guiCreateGridList(9, 24, 268, 255, false, GUI.Window[1]) guiGridListAddColumn(GUI.Gridlist[1], "ID", 0.2) guiGridListAddColumn(GUI.Gridlist[1], "Weapons", 0.4) guiGridListAddColumn(GUI.Gridlist[1], "$", 0.2) for i, v in pairs(weaponItems) do -- Note v is a table value. local weaponName = v[1] local weaponCost = v[2] local weaponID = v[3] local weaponAmmo = v[4] local hiddenData = {weaponAmmo} local theRow = guiGridListAddRow(GUI.Gridlist[1]) guiGridListSetItemText(GUI.Gridlist[1], theRow, 1, weaponID, false, false) guiGridListSetItemText(GUI.Gridlist[1], theRow, 2, weaponName, false, false) guiGridListSetItemText(GUI.Gridlist[1], theRow, 3, weaponCost, false, false) guiGridListSetItemData(GUI.Gridlist[1], theRow, 1, hiddenData) end GUI.Button[1] = guiCreateButton(180, 289, 87, 38, "Close", false, GUI.Window[1]) GUI.Button[2] = guiCreateButton(19, 287, 87, 39, "Buy", false, GUI.Window[1]) guiSetVisible(GUI.Window[1], false) showCursor(false) end ) function enableOrDisableShop() if guiGetVisible(GUI.Window[1]) == false then guiSetVisible(GUI.Window[1], true) showCursor(true) updateWeaponGridList() else guiSetVisible(GUI.Window[1], false) showCursor(false) end end addCommandHandler("shop", enableOrDisableShop) function updateWeaponGridList() guiGridListClear(GUI.Gridlist[1]) for i, v in pairs(weaponItems) do -- Note v is a table value. local weaponName = v[1] local weaponCost = v[2] local weaponID = v[3] local weaponAmmo = v[4] local hiddenData = {weaponAmmo} local theRow = guiGridListAddRow(GUI.Gridlist[1]) guiGridListSetItemText(GUI.Gridlist[1], theRow, 1, weaponID, false, false) guiGridListSetItemText(GUI.Gridlist[1], theRow, 2, weaponName, false, false) guiGridListSetItemText(GUI.Gridlist[1], theRow, 3, weaponCost, false, false) guiGridListSetItemData(GUI.Gridlist[1], theRow, 1, hiddenData) end end addEventHandler("onClientGUIClick", guiRoot, function() if source == GUI.Button[2] then local row = guiGridListGetSelectedItem(GUI.Gridlist[1]) if row then local weaponID = guiGridListGetItemText(GUI.Gridlist[1], row, 1) local weaponName = guiGridListGetItemText(GUI.Gridlist[1], row, 2) local weaponCost = guiGridListGetItemText(GUI.Gridlist[1], row, 3) local hiddenData = guiGridListGetItemData(GUI.Gridlist[1], row, 1) local weaponAmmo = hiddenData[1] triggerServerEvent("onWeaponBought", localPlayer, weaponName, weaponCost, weaponID, weaponAmmo) end elseif source == GUI.Button[1] then enableOrDisableShop() end end) Server: addEvent("onWeaponBought", true) addEventHandler("onWeaponBought", root, function(weaponName, weaponCost, weaponID, weaponAmmo) if getPlayerMoney (source) >= tonumber(weaponCost) then takePlayerMoney (source, weaponCost) giveWeapon ( source, weaponID, weaponAmmo ) outputChatBox('You have just bought #FFFFFF('..weaponName..')!', source, 255, 0, 0, true) else outputChatBox('This weapon require #FFFFFF$'..tonumber(weaponCost)..'#FF0000.', source, 255, 0, 0, true) end end)
  8. ConvertTextToSpeech attachElements ConvertTextToSpeech ?
  9. -.Paradox.-

    Bug

    I was messing with Velocity til i ended up like that lol. Is it a bug or something?
  10. Those who you call kids can understand what debug says.. And i don't see any point of stealing your hud, Who can't make a simple hud?
  11. function dualSilenced( ) setWeaponProperty(23,"pro","flags",0x000800) setWeaponProperty(23,"pro","flags",0x000002) setWeaponProperty(23,"pro","flags",0x000008) setWeaponProperty(23,"pro","maximum_clip_ammo",34) end addCommandHandler("dualsilenced", dualSilenced) This should work
  12. Why this? addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel)
  13. -.Paradox.-

    MTA Crash

    Processor: Intel® Core2 Duo CPU T6670 @ 2.20GHz (2 CPUs), ~2.2GHz It's a medium end processor as far as i know
×
×
  • Create New...