Jump to content

Search the Community

Showing results for tags 'help'.

  • 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

  1. oad-- *** THESE ARE THE SETTINGS. MODIFY IN META.XML *** reloadTime = 6000 -- for Rhino reloadTimeHydra = 4000 -- for Hydra reloadTimeHunter = 3000 -- for Hunter range = 2 -- To increase range, set this value to 1. To decrease range, use 3. My code is optimized for 2. --*** BETTER NOT TOUCH BELOW *** event = nil fired = false drawHandler = nil armedVehicles = {[425]=true, [520]=true, [432]=true} w, h = guiGetScreenSize() height = nil endY = nil r, g = 255, 0 time = 0 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] 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 end function onStart() height = math.ceil(h / 50) if height < 19 then height = 19 end endY = math.ceil((h/100)*6) corona = createMarker (0, 0, -10, "corona", 1.0, 200, 100, 0, 150) bindKey ( "mouse1", "down", toggleRhino ) bindKey("vehicle_fire", "down", toggleHunter) bindKey("vehicle_secondary_fire", "down", toggleHunter) color = tocolor(255, 255, 255, 200) end addEventHandler("onClientResourceStart", resourceRoot, onStart) function entering( thePlayer, seat ) if thePlayer == localPlayer then toggleControl ( "vehicle_fire", true ) toggleControl ( "vehicle_secondary_fire", true ) local model = getElementModel ( source ) if model == 432 or model == 425 or model == 520 then drawHandler = addEventHandler("onClientRender", root, reloadFinished) end if model == 432 then toggleControl ( "vehicle_fire", false ) toggleControl ( "vehicle_secondary_fire", false ) addEventHandler("onClientRender", root, marker) event = true end end end addEventHandler("onClientVehicleEnter", getRootElement(), entering) function exit( thePlayer, seat ) if thePlayer == localPlayer then local model = getElementModel ( source ) if model == 432 then if event ~= nil then removeEventHandler("onClientRender", root, marker) event = nil end toggleControl ( "vehicle_fire", true ) toggleControl ( "vehicle_secondary_fire", true ) end end end addEventHandler("onClientVehicleExit", getRootElement(), exit) addEventHandler("onClientElementDestroy", getRootElement(), function () if (getElementModel(source) == 432 and getVehicleController(source) == localPlayer) then if event ~= nil then removeEventHandler("onClientRender", root, marker) event = nil end toggleControl ( "vehicle_secondary_fire", true ) end end) function wasted() if source == localPlayer then if event ~= nil then removeEventHandler("onClientRender", root, marker) event = nil end toggleControl ( "vehicle_fire", true ) toggleControl ( "vehicle_secondary_fire", true ) end end addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), wasted ) function clientResourceStop() toggleControl ( "vehicle_fire", true ) toggleControl ( "vehicle_secondary_fire", true ) end addEventHandler( "onClientResourceStop", getResourceRootElement(getThisResource()), clientResourceStop ) function toggleRhino() if fired == false then if isPedInVehicle ( localPlayer ) and not isCursorShowing() then local veh = getPedOccupiedVehicle ( localPlayer ) if (veh) then if ( getElementModel ( veh ) == 432 ) then fired = true local turX, turY, turZ = getElementPosition(veh) local cx,cy,cz = getVehicleComponentPosition( veh, "misc_a" ) local x, y, z = getVehicleComponentPosition( veh, "misc_c" ) local barrelX, barrelY, barrelZ = getPositionFromElementOffset(veh,cx,cy,cz) local muzzleX, muzzleY, muzzleZ = getPositionFromElementOffset(veh,x,y,z) local velX = (muzzleX - barrelX) /range local velY = (muzzleY - barrelY) /range local velZ = (muzzleZ - barrelZ) /range local vx, vy, vz = getElementVelocity(veh) setElementVelocity (veh, vx+(((velX/3)*(-1))/50), vy+(((velY/3)*(-1))/50), vz+(((velZ/3)*(-1))/50) ) bullet = createProjectile(veh, 21, muzzleX, muzzleY, muzzleZ, 1, nil, 0, 0, 0, velX, velY, velZ) createExplosion(turX, turY, turZ-10, 8, false, 0.5, false) removeEventHandler("onClientRender", root, reloadFinished) drawHandler = nil start = getTickCount() drawHandler = addEventHandler("onClientRender", root, reload) time = 6000 soundTimer = setTimer(function() local sound = playSound("reload.mp3") setSoundVolume(sound, 0.1) end, (reloadTime-1000), 1) end end end end end function toggleHunter(control) if isPedInVehicle(localPlayer) then local model = getElementModel(getPedOccupiedVehicle(localPlayer)) if model == 425 and fired == false and control == "vehicle_fire" then fired = true setTimer(function() toggleControl ( "vehicle_fire", false ) end, 100, 1) setTimer(function() toggleControl ( "vehicle_fire", true ) fired = false end, reloadTimeHunter, 1) removeEventHandler("onClientRender", root, reloadFinished) drawHandler = nil start = getTickCount() drawHandler = addEventHandler("onClientRender", root, reload) time = 3000 elseif model == 520 and fired == false and control == "vehicle_secondary_fire" then fired = true setTimer(function() toggleControl ( "vehicle_secondary_fire", false ) end, 100, 1) setTimer(function() toggleControl ( "vehicle_secondary_fire", true ) fired = false end, reloadTimeHydra, 1) removeEventHandler("onClientRender", root, reloadFinished) drawHandler = nil start = getTickCount() drawHandler = addEventHandler("onClientRender", root, reload) time = 4000 end end end function reload() if not isPedInVehicle(localPlayer) then removeEventHandler("onClientRender", root, reload) drawHandler = nil end setMarkerColor ( corona, 255, 0, 0, 100 ) local getTime = (getTickCount()) - start local height = math.ceil(h / 50) if height < 19 then height = 19 end dxDrawRectangle (0, h-endY-height-6, height+6, endY, tocolor(0,0,0,150), false) local endY = math.ceil((h/100)*6) endY = endY - 4 if getTime <= time then endY = (getTime/time)*endY else removeEventHandler("onClientRender", root, reload) drawHandler = nil drawHandler = addEventHandler("onClientRender", root, reloadFinished) if getElementModel(getPedOccupiedVehicle(localPlayer)) ~= 432 then local sfx = playSFX ( "genrl", 136, 72 ) setSoundVolume (sfx, 1) end setMarkerColor ( corona, r, g, 0, 150 ) start = nil fired = false end dxDrawRectangle (2, h-endY-height-8, height+2, endY, tocolor(220,0,0,150), false) end function reloadFinished() if not isPedInVehicle(localPlayer) then removeEventHandler("onClientRender", root, reloadFinished) drawHandler = nil else dxDrawRectangle (0, h-endY-height-6, height+6, endY, tocolor(0,0,0,150), false) dxDrawRectangle (2, h-endY-height-4, height+2, endY-4, tocolor(220,0,0,150), false) end end function marker() if not isPedInVehicle(localPlayer) then removeEventHandler("onClientRender", getRootElement(), marker) if isTimer(soundTimer) then killTimer(soundTimer) end fired = false drawHandler = nil setElementPosition (corona, 0, 0, -10) else local vx, vy, vz = nil, nil, nil local cx, cy, cz = nil, nil, nil local veh = getPedOccupiedVehicle ( localPlayer ) if veh then local x, y, z = getVehicleComponentPosition( veh, "misc_a" ) cx, cy, cz = getPositionFromElementOffset( veh, x, y, z ) x, y, z = getVehicleComponentPosition( veh, "misc_c" ) vx, vy, vz = getPositionFromElementOffset( veh, x, y, z ) if vx ~= nil then local velX = (vx - cx) /range local velY = (vy - cy) /range local velZ = (vz - cz) /range local vx1, vy1 = cx + (velX * 50 * 0.1), cy + (velY * 50 * 0.1) local vx2, vy2 = cx + (velX * 50 * 0.2), cy + (velY * 50 * 0.2) local vx3, vy3 = cx + (velX * 50 * 0.3), cy + (velY * 50 * 0.3) local vx4, vy4 = cx + (velX * 50 * 0.5), cy + (velY * 50 * 0.5) local vx5, vy5 = cx + (velX * 50 * 0.6), cy + (velY * 50 * 0.6) local vx6, vy6 = cx + (velX * 50 * 0.7), cy + (velY * 50 * 0.7) local vx7, vy7 = cx + (velX * 50 * 0.8), cy + (velY * 50 * 0.8) local m1 = cz + (velZ * 50 * 0.1) - ((getGravity()*2400*0.01)/2) local m2 = cz + (velZ * 50 * 0.2) - ((getGravity()*2400*0.04)/2) local m3 = cz + (velZ * 50 * 0.3) - ((getGravity()*2400*0.09)/2) local m4 = cz + (velZ * 50 * 0.5) - ((getGravity()*2400*0.25)/2) local m5 = cz + (velZ * 50 * 0.6) - ((getGravity()*2400*0.36)/2) local m6 = cz + (velZ * 50 * 0.7) - ((getGravity()*2400*0.49)/2) local m7 = cz + (velZ * 50 * 0.8) - ((getGravity()*2400*0.64)/2) local hit, mx, my, mz, elementHit = processLineOfSight (cx, cy, cz, vx1, vy1, m1, true, true, true, true, true, false, false, false, veh) if hit == false then hit, mx, my, mz, elementHit = processLineOfSight (vx1, vy1, m1, vx2, vy2, m2, true, true, true, true, true, false, false, false, veh) if hit == false then hit, mx, my, mz, elementHit = processLineOfSight (vx2, vy2, m2, vx3, vy3, m3, true, true, true, true, true, false, false, false, veh) if hit == false then hit, mx, my, mz, elementHit = processLineOfSight (vx3, vy3, m3, vx4, vy4, m4, true, true, true, true, true, false, false, false, veh) if hit == false then hit, mx, my, mz, elementHit = processLineOfSight (vx4, vy4, m4, vx5, vy5, m5, true, true, true, true, true, false, false, false, veh) if hit == false then hit, mx, my, mz, elementHit = processLineOfSight (vx5, vy5, m5, vx6, vy6, m6, true, true, true, true, true, false, false, false, veh) if hit == false then hit, mx, my, mz, elementHit = processLineOfSight (vx6, vy6, m6, vx7, vy7, m7, true, true, true, true, true, false, false, false, veh) if hit == false then mx, my, mz = vx7, vy7, m7 end end end end end end end local dist = getDistanceBetweenPoints3D ( vx, vy, vz, mx, my, mz ) if dist < 50 then r = 5.1 * dist g = 255 elseif dist >= 50 then r = 255 g = 255 - ((dist-50) * 5.1) end setElementPosition (corona, mx, my, mz) setMarkerColor ( corona, r, g, 0, 150 ) if not drawHandler then drawHandler = addEventHandler("onClientRender", root, reloadFinished) end end end end end function projectileSound ( creator ) local zeType = getProjectileType( source ) if zeType == 21 then if getElementType(creator) == "vehicle" then if getElementModel(creator) == 432 then local velX, velY, velZ = getElementVelocity(source) local cx, cy, cz = getVehicleComponentPosition( creator, "misc_c" ) cx, cy, cz = getPositionFromElementOffset(creator, cx, cy, cz) fxAddTankFire(cx, cy, cz, velX, velY, velZ) local sound1 = playSFX3D ( "genrl", 45, 2, cx, cy, cz ) local sound2 = playSFX3D ( "genrl", 45, 3, cx, cy, cz ) local sound3 = playSFX3D ( "genrl", 45, 4, cx, cy, cz ) setSoundMaxDistance( sound1, 300 ) setSoundMaxDistance( sound2, 300 ) setSoundMaxDistance( sound3, 200 ) setSoundVolume(sound1, 2) setSoundVolume(sound2, 2) setSoundVolume(sound3, 2) --setElementModel(source, 342) end end end end addEventHandler( "onClientProjectileCreation", getRootElement(), projectileSound ) I'm aiming to make a crosshair that will work fine with this, but I haven't been successful. Can you help me.
  2. radar script is really cool. I want to use it on my server but I want it to work with acl. So the clan's radar will not show the people in that clan, it will only be visible if someone else enters it. Can you help me do this please? local screenX, screenY = guiGetScreenSize() local angle = 0 local visible = false local lineVisible = false local tick = getTickCount() local radares = {} local elementsDetected = {} -- local radius = 20 -- radius local centerPos = {-1344.0895996094, -42.202056884766, 10, 10} -- Edit position of radar: x, y, z, height local radarColshape = createColCircle(centerPos[1], centerPos[2], radius) -- function attachRadarToElement(element) if isElement(element) then centerPos = element end end function createRadar(posX, posY, size) table.insert(radares, {x = posX, y = posY, s = size, r = (size - (size*40/300))/2}) end createRadar(screenX - 366, screenY - 318, 300) local function linear(t, b, c, d) return c * t / d + b end function radar() local now = getTickCount() if now-tick >= 50 then tick = getTickCount() angle = angle < 360 and angle + 2 or 0 end if visible then for _, v in ipairs(radares) do dxDrawImage(v.x, v.y, v.s, v.s, "images/radar.png") local centerX, centerY = v.x+v.s/2, v.y+v.s/2 for i = -30, 1 do local alpha = 8.5*i local endX = math.cos( math.rad( angle + i*2 ) ) * v.r local endY = -math.sin( math.rad( angle + i*2 ) ) * v.r local lineX, lineY = centerX, centerY dxDrawLine(lineX, lineY, endX + lineX, endY + lineY, tocolor(0, 255, 0, alpha), 7) end for element, b in pairs(elementsDetected) do local elapsedTime = now - b[1] if elapsedTime < 3000 then local alpha = linear(elapsedTime, 255, -255, 3000) local hip = (v.r*b[3])/radius local x, y = math.cos(b[2]) * hip, math.sin(b[2]) * hip dxDrawImage(centerX-8+x, centerY-8-y, 16, 16, "images/56.png", _, _, _, tocolor(255, 255, 255, alpha)) else elementsDetected[element] = nil end end end end end addEventHandler("onClientRender", root, radar) -- addEventHandler("onClientPreRender", root, function() local centerX, centerY, centerZ, height if not isElement(centerPos) then centerX, centerY, centerZ, height = unpack( centerPos ) else centerX, centerY, centerZ = getElementPosition(centerPos) height = 10 end if lineVisible then for i = 1, 360, 45 do local endX = math.cos( math.rad( i ) ) * radius local endY = math.sin( math.rad( i ) ) * radius dxDrawLine3D(centerX, centerY, centerZ + height, endX + centerX, endY + centerY, centerZ + height, tocolor(255, 255, 0, 150), 7) dxDrawLine3D(endX + centerX, endY + centerY, centerZ, endX + centerX, endY + centerY, centerZ+height, tocolor(255, 255, 0, 150), 7) end local endX, endY = math.cos( math.rad( angle ) ) * radius, math.sin( math.rad( angle ) ) * radius local endX2, endY2 = math.cos( math.rad( angle - 10 ) ) * radius, math.sin( math.rad( angle - 10 ) ) * radius local middleZ = (centerZ + height) dxDrawLine3D(centerX, centerY, middleZ, endX + centerX, endY + centerY, middleZ, tocolor(255, 0, 0, 150), 3) dxDrawLine3D(centerX, centerY, middleZ, endX2 + centerX, endY2 + centerY, middleZ, tocolor(255, 0, 0, 150), 3) dxDrawLine3D( endX + centerX, endY + centerY, middleZ, endX2 + centerX, endY2 + centerY, middleZ, tocolor(255, 0, 0, 150), 3) end local elements = getElementsWithinColShape(radarColshape) for e = 1, #elements do local x, y, z = getElementPosition(elements[e]) local hipotenusa = ( (x-centerX)^2 + (y-centerY)^2 ) ^ .5 local eAngle = math.acos( (x-centerX) / hipotenusa ) eAngle = (y-centerY) < 0 and math.pi*2 - eAngle or eAngle --local xFrom, yFrom = math.cos(eAngle)*hipotenusa, math.sin(eAngle)*hipotenusa --dxDrawLine3D(centerX, centerY, 7, xFrom + centerX, yFrom + centerY, z, tocolor(0, 255, 0, 150), 3) -- To see where the element is supposed to be if eAngle >= math.rad( angle - 10 ) and eAngle <= math.rad ( angle ) then if visible and not elementsDetected[elements[e]] then playSoundFrontEnd(5) end elementsDetected[elements[e]] = {getTickCount(), eAngle, hipotenusa} end end end ) addCommandHandler("radar2", function() visible = not visible end ) addCommandHandler("radarline", function() lineVisible = not lineVisible end )
  3. I had mta open and was connected to a server but was alt-tabbed out of the game for around 20 minutes and when I alt-tabbed back in to the game I was greeted by an error saying I had DLL Injectors and could not connect to the server, So I assumed it was a glitch and could be fixed by realunching MTA but after launching mta when I tried to connect back to the server I was greeted by a CD47 Ban with description of using DLL Injector. The ban was only for an hour so that's not the problem I wanted to know which process caused the ban to try and avoid this in the feature, I was hoping there would be like a log or something that I could see to indicate what caused it? Because I did not have any DLL Injector open and neither Injected anything into the game. For now my I think it might have been the MSI Afterburner and Rivatuners overlay but I'm not sure. tl;dr I got banned for dll injector and I want to know which process caused it.
  4. ------- HK 417 ------- mermi = 500 id = 31 addEvent("m4al",true) addEventHandler("m4al",root,function() if getTickCount() - (tick[source] or 0) >= SECONDS * 864000 then giveWeapon(source,id,mermi) tick[source] = getTickCount() outputChatBox("[!]#ff3300 HK 417 Markalı Silahını Kuşandın.",source,0,255,0,true) else outputChatBox("[!]#ff3300 [1 Haftalık Stok] 4 Saat Sonra Tekrar Alabilirsin.",source,0,255,0,true) end end ) ------- SNIPER ------- mermi3 = 15 id3 = 34 addEvent("sniperal",true) addEventHandler("sniperal",root,function() if getTickCount() - (tick[source] or 0) >= SECONDS * 864000 then giveWeapon(source,id3,mermi3) tick[source] = getTickCount() outputChatBox("[!]#ff3300 Bora 12 Markalı Uzun Namlu'lu Silahını Kuşandın.",source,0,255,0,true) else outputChatBox("[!]#ff3300 [1 Haftalık Stok] 4 Saat Sonra Tekrar Alabilirsin.",source,0,255,0,true) end end ) Hi, I can only use one. When I try to use the other, the timer activates and prevents me from picking up the other weapon. I will be glad if you help
  5. GUIEditor = { gridlist = {}, staticimage = {} } addEventHandler("onClientResourceStart", resourceRoot, function () local screenW, screenH = guiGetScreenSize() win = guiCreateStaticImage((screenW - 554) / 2, (screenH - 477) / 2, 554, 477, "s/panel.png", false) guiSetVisible(win,false) local screenW2, screenH2 = guiGetScreenSize() PlayerList = guiCreateStaticImage((screenW2 - 342) / 2, (screenH2 - 415) / 2, 342, 415, "s/PlayerList.png", false) guiSetVisible(PlayerList,false) GridPlayer = guiCreateGridList(23, 59, 188, 346, false, PlayerList) c = guiGridListAddColumn(GridPlayer, "Player", 0.9) SendWe = guiCreateStaticImage(215, 59, 101, 32, "s/SendWe.png", false, PlayerList) Close = guiCreateStaticImage(215, 117, 101, 32, "s/Close.png", false, PlayerList) GUIEditor.staticimage[1] = guiCreateStaticImage(216, 315, 104, 90, "s/logo.png", false, PlayerList) for _,player in ipairs ( getElementsByType("player") ) do local row = guiGridListAddRow(GridPlayer) guiGridListSetItemText(GridPlayer,row,1,getPlayerName(player),false,false) end Grid = guiCreateGridList(16, 71, 277, 400, false, win) guiGridListAddColumn(Grid, "name", 0.2) guiGridListAddColumn(Grid, "id", 0.2) guiGridListAddColumn(Grid, "ammo", 0.2) guiGridListAddColumn(Grid, "price", 0.2) for k,v in ipairs(Weapons) do local row = guiGridListAddRow(Grid) guiGridListSetItemText(Grid,row,1, v[1],false,false) guiGridListSetItemText(Grid,row,2, v[2],false,false) guiGridListSetItemText(Grid,row,3, v[3],false,false) guiGridListSetItemText(Grid,row,4, v[4],false,false) guiGridListSetItemText(Grid,row,5, v[5],false,false) guiGridListSetItemText(Grid,row,6, v[6],false,false) guiGridListSetItemText(Grid,row,7, v[7],false,false) guiGridListSetItemText(Grid,row,8, v[8],false,false) guiGridListSetItemText(Grid,row,9, v[9],false,false) guiGridListSetItemText(Grid,row,10, v[10],false,false) guiGridListSetItemText(Grid,row,11, v[11],false,false) guiGridListSetItemText(Grid,row,12, v[12],false,false) guiGridListSetItemText(Grid,row,13, v[13],false,false) Close1 = guiCreateStaticImage(215, 117, 101, 32, "s/Close.png", false, win) -- I want it to close the window. I tried several ways but no result. Buy = guiCreateStaticImage(320, 95, 200, 60, "s/Buy.png", false, win) Send = guiCreateStaticImage(320, 224, 200, 60, "s/Send.png", false, win) GUIEditor.staticimage[4] = guiCreateStaticImage(352, 339, 170, 132, "s/logo.png", false, win) end end) I want it to close the window. I tried several ways but no result.
  6. Hello, I want to make a repository for groups but I am not very knowledgeable. My goal thing is a locker or warehouse where they can store weapons. I would be very happy if you help
  7. Hello, I want to know how can I detect when a bot dies? But, not when someone kills it, only when it dies, for example when it jumped off a cliff, or another bot killed it, i mean, only detect when it dies in a general way and give a reward by dropping a pickup.
  8. Hello everyone. I am creating a skins store, but I would like to know how I can save each skin I buy in a list, as items since there are many skins. Is there a way to create a save system for each skin? saving it by id? I don't know if I explain myself well.
  9. I've been playing MTA on and off on 2715x1527x32 and it was always above 60 fps, today I changed my resolution to 1920x1080x32 before launching the game and when I did that my game got limited to 10 fps. When that I happened I decided to go back to my old resolution however that didn't fix the fps issue. I tried to reinstall the game and it still didn't work, I even changed the bit level in properties but that keeps getting unchecked after I run the game, I also tried running the game on CPU 0 but but there was no hope. I tried all of the resolutions in the drop-box list and still didn't work apart from the 720x480x32 and lower. The game used to run butter smooth but now I can't even play it because ever since I updated that resolution today. How can I resolve this issue? Thanks
  10. Sziasztok! Írnék egy munka kódot de valami baj van és nem értem mi a baj. ---Server side for i, player in ipairs(getElementsByType("player")) do setElementData(player, "Jobveh", false) end local vehpos = { [1] = {2742.76416, -2468.74683, 13.64844}, [2] = {2742.69360, -2460.06079, 13.64844}, }; local Deliverypos = { } local Marker = createMarker(2744.14453, -2453.91431, 13.86226, "cylinder", 3, 255) local VehIDJobs = {609, 499}, addEventHandler("onMarkerHit", resourceRoot, function(hitElement, mDim) if (mDim) then if (source == Marker) then if (getElementType(hitElement) == "player") then if not (getElementType(HitElement, "Jobveh")) then local Veh for i, spot in pairs(vehpos) do createVehicle(609, spot[1], spot[2], spot[3]) setElementData(hitElement, "Jobveh", Jobveh) veh = true break; end end if (veh) then end end end end end end
  11. Let's talk script security. It might be a taboo topic for some but it shouldn't, at all. In fact, the more people talk about this and unite to discuss and create robust, safe and well-coded scripts, the better the MTA resource development community will be. Rules: Main article: https://wiki.multitheftauto.com/wiki/Script_security The key points are there, but the code examples don't suffice, and the implementations will vary depending on the gamemode and resources. Pinned information: Coming soon Notes: - I'm not perfect and everyone makes mistakes. Please correct me when I'm wrong. - Eventually if this becomes a popular topic, I am willing to incorporate translations of certain explanations into other languages in this OP, as I know a majority of the MTA community doesn't master the English language and prefers to communicate and read in other languages.
  12. Xwaw

    Nitro value

    Hello Is it possible to somehow check the value of how much NOS you have in the vehicle because I am looking for but not which do not seem to work as if they were not at all. I need this value to make a bar that will show how much nitro the vehicle has.
  13. Nesse script abaixo se você arrastar o item do inventario chamado "chavedefenda" ele executa uma função eu gostaria q esse item roubasse cada pneu do carro ou seja o jogador chega perto do pneu e arrasta a chave de fenda pro carro ai ele começa a roubar o pneu do carro quando ele termina de roubar o pneu vai pro inventario e o pneu do carro some automaticamente o mesmo serve pra quando o jogador tem o pneu no inventario ai arrasta a chave de fenda pro carro fazendo assim ele coloca o pneu de volta no carro ou seja se ele tiver o pneu no inventario e o carro não tiver um ou mais pneus ele coloca o pneu no lugar e ele sai do inventario do jogador quem conseguir fazer pra mim elseif getElementType(target) == "vehicle" then --Interação com veículos if item == "toolbox" then --Reparar o veículos drop = false local health = getElementHealth(target) if health >= 1000 then sendNotification(player, "error", "O veículo não precisa de reparo.") return false end local result = takeItem(player, slot, "toolbox", 1) if result then closeInventory(player) setPedAnimation(player, "OTB", "betslp_loop", 0, true, true, false) toggleControl(player, "fire", false) toggleControl(player, "jump", false) setElementFrozen(target, true) toggleAllControls(player, false) playSound3D(target, "fix.mp3", 20) sendProgressbar(player, 15, "Reparando o veículo...") cooldown[player] = setTimer(function() setPedAnimation( player, "ped", "facanger", 0, false, false, false) toggleControl(player, "fire", true) toggleControl(player, "jump", true) setElementFrozen(target, false) toggleAllControls(player, true) setElementHealth(target, 1000) fixVehicle(target) cooldown[player] = nil sendNotification(player, "success", "Veículo reparado com sucesso.") end, 1000*15, 1) else sendNotification(player, "error", "Ocorreu um erro ao usar este item.") end elseif item == "chavedefenda" then drop = false local theVehicle = getPedOccupiedVehicle ( player ) if ( theVehicle ) then sendNotification(player, "error", "Desça do veiculo primeiro") return false end local result = takeItem(player, slot, "chavedefenda", 1) if result then closeInventory(player) setPedAnimation(player, "OTB", "betslp_loop", 0, true, true, false)--animação roubando toggleControl(player, "fire", false) toggleControl(player, "jump", false) setElementFrozen(target, true) toggleAllControls(player, false) sendProgressbar(player, 15, "Roubando o pneu...") cooldown[player] = setTimer(function() setPedAnimation( player, "ped", "facanger", 0, false, false, false) toggleControl(player, "fire", true) toggleControl(player, "jump", true) setElementFrozen(target, false) toggleAllControls(player, true) --setElementData(target, "Gasolina", gasolina + 25) cooldown[player] = nil sendNotification(player, "success", "você roubou o pneu do veiculo com sucesso") end, 1000*15, 1) else sendNotification(player, "error", "Ocorreu um erro ao usar este item") end end end
  14. Hi I wanted to learn how to create my own shaders for this game from lighting starting to moving texture on the wall. I would really like someone to give me a link to a page where I can find all the functions or if someone wants to explain to me what it is all about
  15. Esses 2 helicópteros contem armas q meus players que forem pilotar eles vão querer usar em algum momento eu gostaria de bloquear esses armamentos do meu servidor como eu poderia fazer isso?
  16. EU SIMPLESMENTE GOSTARIA QUE QUEM TIVESSE NAS ACLS VIPS [ DIAMANTE, OURO, PRATA, BRONZE ] TIVESSE MAIS SLOTS NA GARAGEM O SCRIPT É ASSIM createEventHandler ("MST.onPlayerBuyVehicle", getRootElement (), function (player, selecionado, cor_1, cor_2, cor_3, cor_4) if selecionado then local accName = getAccountName (getPlayerAccount (player)) local result = dbPoll (dbQuery (db, "SELECT * FROM Veiculos WHERE Conta = ? AND Modelo = ?", accName, selecionado.model), -1) if #result == 0 then if getAllPlayerVehicles (player) >= config.gerais.veiculosmax then --eu sei q é aqui q impede que o jogador compre mais carros message (player, "Você já possui a quantidade máxima de veículos", "error") return end local money = getPlayerMoney (player) if money >= selecionado.price then local id = NovoID () local cor = cor_1..", "..cor_2..", "..cor_3..", "..cor_4 local t_1, t_2, t_3, t_4, t_5, t_6, t_7, t_8, t_9, t_10, t_11, t_12, t_13, t_14, t_15 = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 local tunning = t_1..", "..t_2..", "..t_3..", "..t_4..", "..t_5..", "..t_6..", "..t_7..", "..t_8..", "..t_9..", "..t_10..", "..t_11..", "..t_12..", "..t_13..", "..t_14..", "..t_15 dbExec (db, "INSERT INTO Veiculos VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", accName, id, selecionado.name, selecionado.model, "Guardado", cor, tunning, "Não", 0, "SemPlaca", selecionado.price, 1000, 100) message (player, "Você comprou o veículo "..selecionado.name.." por R$"..convertNumber(selecionado.price)..",00.", "success") takePlayerMoney (player, selecionado.price) triggerClientEvent (player, "MST.onPlayerCloseEvents", player) else message (player, "Você não possui dinheiro suficiente.", "error") end else message (player, "Você já possui esse veículo.", "error") end else message (player, "Selecione algum veículo da lista.", "error") end end) --aqui é a função a cima q verifica os carros q o jogador tem na garagem function getAllPlayerVehicles (player) local accName = getAccountName (getPlayerAccount (player)) local result = dbPoll (dbQuery (db, "SELECT * FROM Veiculos WHERE Conta = ?", accName), -1) return #result end --aqui e no arquivo de configuração config = { gerais = { veiculosmax = 2, -- Veículos Máximos que o Jogador vai poder ter na Garagem. elementfuel = "Gasolina", -- Element Data de Gasolina do seu Servidor. elementid = "ID", -- Element Data de ID do seu Servidor. infobox = "addBox", -- Evento da sua Infobox. distancia = 30, -- Distancia do Player e do Veículo. (Guardar Veículo) velocitymax = 400, -- Velocidade Máximas de todos os Veículos. acls = {"Console"}, -- ACL's Administradoras do seu Servidor. },
  17. Preciso de uma ajuda em algo meio q simples basicamente eu preciso q não deixe o jogador retirar o outro do veiculo caso já tenha alguém dirigindo o veiculo por exemplo eu vou roubar o carro do cara e basicamente não conseguir preciso q isso sirva pra todos os veículos q tenha como roubar. Outro exemplo seria o carro tem um motorista mais está destrancado ai vem um iniciante no servidor e tenta roubar o carro do cara ele não irá conseguir pegar o carro somente quando o caso estiver sem nenhum jogador dentro
  18. ERROR EN LA CONSOLA: ERROR: items/itemsS.lua:671: attempt to index global 'trash' (a nil value) El error me aparece cada vez que inicio el server y cada vez que le hago restart a cualquier script, no entiendo, me tiene cabezón. Resalto la línea 671 del error en amarrillo. (línea del supuesto error) local sistemaitems function loadTrash() local query = dbQuery(connection, "SELECT * FROM bins;" ) local result, numrows = dbPoll(query, -1) if (result and numrows > 0) then for index, trashPos in pairs(result) do trashPos = fromJSON(trash["pos"]) or "[[ 0,0,0,0,0,0,0,0 ]]" sistemaitems = createObject(1359, trashPos[1],trashPos[2], trashPos[3]-0.4, trashPos[4], trashPos[5], trashPos[6]) setElementData(sistemaitems, "sistemaID", trash['id']) setElementInterior(sistemaitems, trashPos[7]) setElementDimension(sistemaitems, trashPos[8]) end end end addCommandHandler("papelera", function(playerSource, cmd) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(playerSource)), aclGetGroup("Console")) then local x, y, z = getElementPosition(playerSource) local rx, ry, rz = getElementRotation(playerSource) local int = getElementInterior(playerSource) local Dim = getElementDimension(playerSource) local Query, _, insertID = dbQuery(connection,"INSERT INTO bins (pos) VALUES(?)", toJSON({x, y, z, rx, ry, rz, int ,Dim})) local checkQuery, _, insertID = dbPoll ( Query, -1 ) if checkQuery then outputChatBox("#7cc776[Inventario] #ffffff Papelera creada.", playerSource, 255,255, 255, true) sistemaitems = createObject(1359, x, y, z-0.4, rx, ry, rz) setElementData(sistemaitems, "sistemaID", insertID) setElementInterior(sistemaitems, int) setElementDimension(sistemaitems, Dim) end end end) El código es parte de un sistema de papelera para desechar items, todo lo demás corre muy bien. Será algún problema con mi sistema de ID?
  19. Stardust

    Kicked: VF #2

    Hi, my friend is having an issue with connecting to all servers in MTA. Error message came on display: Disconnected: You were kicked by (VF #2 03030000) https://imgur.com/a/ZGv5euu Anyone here can help me point out the solution? I'm new in this and trying to fix the problem, thanks!
  20. Sziasztok! Olyan kérdésem lenne, hogy valaki tudna-e legalább útba igazítani, hogyan tudnék egy 3D pozíciónáló scriptet készíteni, mint pl. SeeMTA-n a kiegészítőknél. Válaszokat előre köszönöm.
  21. hello im using 3ds max studios 2010 and trying to create animations but when i try to exports dont show my animation: prints: https://imgur.com/a/zqL8lcu
  22. function giveV(player, car_id) if player and isElement(player) then if car_id and type(car_id) == 'number' then local _,i = hasV(player, car_id) local garagem = getElementData(player, 'conce.garage') or {} if i then outputChatBox('Você já tem este carro!') --infobox return false else table.insert(garagem, {id = car_id}) setElementData(player, 'conce.garagem', garagem) outputChatBox('Você adquiriu um '..vehicle[car_id].name..'.') --infobox return true end else outputDebugString('Aguardando arg #2 válido para a function hasV') return false end else outputDebugString('Aguardando arg #1 válido para a function hasV') return false end end I'm struggling to make a dealership script, but the giveV function doesn't add the car to the garage list even if the checks pass. Can anyone help?
  23. السلام عليكم ورحمة الله وبركاتة يعطيكم العافية انا عندي مشكلة ولا قدرت اعرف حلها . وقلت خلني اسالكم هنا يمكن تساعدوني والله تعبت وانا ادور حل ولا لقيت المشكلة باختصار : الفاكشنات الي في السيرفر ما يقدرون يتواصلون مع بعض عن طريق راديو الفاكشن الي تستخدم له الامر /dep بعض المرات تقدر تسمع الي في الفاكشن الثاني ولو حاولت ترد عليهم ما يسمعونك ياليت تساعدوني الي عنده خبرة في سيرفرات الحياة الواقعية بيفهم انا وش اقول ..
  24. Someone knows how to convert map from samp to mta, maintaining the position of objects. I know this works, so much so that it has already converted maps from various games like Vice City, GTA 4, GTA 3 etc. Could someone help me?
  25. I can't verify if the vehicle's id is the same as the spawned one and if it's going to destroy it! 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 i.vidC == vid then if i.vh and isElement(i.vh) then destroyElement(i.vh) return false; end end end vehicleSV = createVehicle(vid, x,y,z,_,_,r) warpPedIntoVehicle(source, vehicleSV) table.insert(spawnedV, {vidC = vid, vh = vehicleSV}) end); This is my current code...
×
×
  • Create New...