Jump to content

Search the Community

Showing results for tags 'script'.

  • 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. He echarías una mano te lo ruego? Me solucionarías estas líneas?... function debugJump() if PedControlState("jump") then Aqui el error ---- attempt to call global ´PedControlState´ (a nil value) setElementData(getLocalPlayer(), "jumping", true) setTimer(debugJump2, 650, 1) end end setTimer(debugJump, 100, 0) function debugJump2() setElementData(getLocalPlayer(), "jumping", false) end Y luego esta parece ser el mismo error que el de arriba: function debugShooting() if PedControlState("fire") then -- Error-- attempt to call global ´PedControlState´ (a nil value) local weapon = getPedWeapon(getLocalPlayer()) local noise = getWeaponNoise(weapon) or 0 setElementData(getLocalPlayer(), "shooting", noise) if shootTimer then killTimer(shootTimer) end shootTimer = setTimer(debugShooting2, 100, 1) end end setTimer(debugShooting, 100, 0) function debugShooting2() setElementData(getLocalPlayer(), "shooting", 0) shootTimer = false end
  2. Hello, I would like to ask for the help to create a system to rotate an object when I hold a certain button , It will only stop after I release objectRotation = 0; objeto = createObject ( 1852,2714,-1756.2700195313,77.559997558594, 0, 0, 0 ) function func () objectRotation = objectRotation + 1.20 setElementRotation(objeto, 0, 0, objectRotation) end function func2 () objectRotation = objectRotation - 1.20 setElementRotation(objeto, 0, 0, objectRotation) end bindKey ( "2", "down", func2 ) bindKey ( "3", "down", func )
  3. I need a scripter for my Roleplay server / server scripts %85 finished just have some small bugs. I want staff and scripter.Req: - Must know scripting.Contact : Forum: www.ngcmta.comSkype : candasnetwork Facebook: www.facebook.com/candas67
  4. when i driveing the car, then the exhaust fire. where can i download this script?
  5. Hi Everyone! Can someone help me, how can I make that, if a fire is created it outputs the chatbox the fire's position (example: "The LSPD is on fire" or "The Hospital is on fire" . The Script Files: FireC.lua local fireElement = {} addEvent("FireServer.rootFireCreate",true) addEventHandler("FireServer.rootFireCreate",getRootElement(),function(rand) local fire = createFire(FirePositions[rand][1], FirePositions[rand][2], FirePositions[rand][3], FirePositions[rand][4], FirePositions[rand][5], FirePositions[rand][6]) fireElement[#fireElement + 1] = fire end) addEventHandler ("onClientResourceStart", getRootElement(), function (res) if res ~= getThisResource() then return end triggerServerEvent("FireServer.loadMe", localPlayer, localPlayer) end) function draw() for k,v in ipairs(getElementsByType("object")) do if getElementData(v, "Fire->object") then local x, y ,z = getElementPosition(v) local wx, wy, wz = getScreenFromWorldPosition(x , y, z+1) if wx and wy then local playerx, playery, playerz = getElementPosition(getLocalPlayer()) if getDistanceBetweenPoints3D(playerx, playery, playerz, wx, wy, wz) <= 5 then dxDrawRectangle(wx-200/2,wy,200,30,tocolor(0,0,0,255/2)) dxDrawRectangle(wx-200/2+5,wy+5,190,20,tocolor(124, 197, 118,255/2)) end end end end end addEventHandler("onClientRender", root, draw) FireG.lua FirePositions = { -- X, Y, Z, Range(FireSize) [1] = {2114.1240234375, -1756.2508544922, 13.3984375, 800}, } FireS.lua local loadedPlayers = {} local fireBar = {} FireServer = {} function FireServer.start(player) loadedPlayers[#loadedPlayers + 1] = player end addEvent("FireServer.loadMe", true) addEventHandler("FireServer.loadMe", root, FireServer.start) function FireServer.FireCreate() if math.random(1, 3) == 2 then local rand = math.random(#FirePositions) if fireBar[rand] then return end for k,v in pairs(loadedPlayers) do triggerClientEvent(v, "FireServer.rootFireCreate", v, rand) fireBar[rand] = createObject(1337, FirePositions[rand][1], FirePositions[rand][2], FirePositions[rand][3] - 1) setElementAlpha(fireBar[rand], 0) setElementCollisionsEnabled(fireBar[rand], false) setElementData(fireBar[rand], "Fire->object", true) end end end setTimer(FireServer.FireCreate, 1000, 0)
  6. To fazendo um painel para trocar senha e grupo da base porem toda vez que troco pelo painel de grupo não tenho mas acesso a base só se eu dar restart na resource, tentei usar setTimer, mas começa a da lagger por causa da verificação todo momento -- Server side function GroupMTA() for index, Cord in ipairs(Bases_Colisions) do local ColBase = createColCuboid(Cord[1],Cord[2],Cord[3],Cord[4],Cord[5],Cord[6]) -- x,y,z,rx,ry,rz addEventHandler( "onColShapeHit",ColBase,EnterInBase) addEventHandler( "onColShapeLeave",ColBase,ExitInBase) setElementData(ColBase,"GangCol",NameGroup) --Nome do clã/grupo end end addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),GroupMTA) to a procura de uma forma que não fique lagger no alarme e que automaticamente quando o player troca o nome do clã/grupo ele tenha acesso a base sem reiniciar a resource
  7. Guest

    Wasted script

    Can someone help me out with script ? I need script that when my player dies it will show WASTED text like in original GTA san andreas
  8. Guest

    Need help,

    Hello , I have quick question. How to add more weapon properties ?? Because when I try to add flag 0x000010 it doesn't work. So how ? addEventHandler("onResourceStart", resourceRoot, -- resourceRoot == the resource that just started (this resource) function () setWeaponProperty("ak-47", "poor", "flags", 0x000020) end)
  9. i have this code: setTimer(function() local arfolyam = math.random(200,5130) outputChatBox("Jelenlegi árfolyam: "..arfolyam) end, 500, 0) GUIEditor.window[1] = guiCreateWindow(0.35, 0.31, 0.31, 0.28, "Aranykereskedés", true) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.label[1] = guiCreateLabel(0.02, 0.59, 0.95, 0.14, "Az arany jelenlegi árfolyama: "..arfolyam, true, GUIEditor.window[1]) but i get this error in debugscript 3: attempt to concatenate global 'arfolyam' ( a nil value) what wrong? how to fix this?
  10. --Client function addToList(account, rank, joined, lastTime, nick, online) local row = guiGridListAddRow(adminMembsList) guiGridListSetItemText(adminMembsList, row, 1, tostring(nick), false, false) guiGridListSetItemText(adminMembsList, row, 2, tostring(account), false, false) guiGridListSetItemText(adminMembsList, row, 3, tostring(rank), false, false) guiGridListSetItemText(adminMembsList, row, 4, tostring(lastTime), false, false) if (online) then guiGridListSetItemColor(adminMembsList, row, 1, 0, 255, 0) guiGridListSetItemColor(adminMembsList, row, 2, 0, 255, 0) guiGridListSetItemColor(adminMembsList, row, 3, 0, 255, 0) guiGridListSetItemColor(adminMembsList, row, 4, 0, 255, 0) else guiGridListSetItemColor(adminMembsList, row, 1, 255, 0, 0) guiGridListSetItemColor(adminMembsList, row, 2, 255, 0, 0) guiGridListSetItemColor(adminMembsList, row, 3, 255, 0, 0) guiGridListSetItemColor(adminMembsList, row, 4, 255, 0, 0) end end addEvent("groupSystem.addToList", true) addEventHandler("groupSystem.addToList", root, addToList) --Server function printManagment(player) if (player) then player = client end local group = getPlayerGroup(client) for ind, data in pairs(GAC) do if (data[1] == group) then local rank, joined, lastTime = GAC[ind][2], GAC[ind][3],GAC[ind][4], GAC[ind][5] triggerClientEvent(client, "groupSystem.addToList", client, tostring(ind), rank, joined, lastTime, getAccountPlayer(getAccount(ind)), getGroupBankAmount(group)) end end end addEvent("groupSystem.print", true) addEventHandler("groupSystem.print", root, printManagment) http://prntscr.com/g4ef8q Two player connected, but shows my game name for two
  11. i got this error, but the script working fine... -.- bad argument #1 to 'len' (string expected, got boolean) how to fix this? code: function currentSongName() local radio_title = getElementData(resourceRoot, "radio.title") if string.len(radio_title) >= x*0.0625 then radio_title = string.sub(radio_title, 1, 80)..".." end for i, shading in pairs ( offsetShadings ) do dxDrawText("Radio: "..radio_title, xD+shading[1], yD+shading[2], xD, yD+textHeight, tocolor ( 0, 0, 0, 255 ), scale, font, "left", "center", false, false, true, true) end dxDrawText("Radio: #ffffff"..radio_title, xD, yD, xD, yD+textHeight, tocolor ( 70, 215, 0, 255 ), scale, font, "left", "center", false, false, true, true) end addEventHandler('onClientRender', root, currentSongName)
  12. I created a Brown Streak mod. And the dff&txd working fine, but the .col does not working. I got a warning in debugscript 3: mod.lua:14: Bad 'number' pointer @ engineReplaceCOL'(2) This is the mod.lua code: function replaceModel() local txd colsok = engineLoadCOL ( "v43.col" ) engineReplaceCOL ( colsok, 538) txd = engineLoadTXD ( "v43.txd" ) engineImportTXD ( txd, 538 ) dff = engineLoadDFF ( "v43.dff" ) engineReplaceModel ( dff, 538 ) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) addCommandHandler ( "reloadcar", replaceModel ) What wrong? How to fix this?
  13. Presiso de um Scripter Para MTA Urgente se alguem estiver interessado ai me contate via PM vlw ai
  14. local movingOffsetX, movingOffsetY = 0, 0 local isMoving = false bindKey('m', 'down', function() showCursor(not isCursorShowing()); end ) function drawRadar() showPlayerHudComponent("radar", false) if disableGTASAhealth then showPlayerHudComponent("health", false) end if disableGTASAarmor then showPlayerHudComponent("armour", false) end if disableGTASAoxygen then showPlayerHudComponent("breath", false) end if (not isPlayerMapVisible()) then if (isCursorShowing() and isMoving) then local cursorX, cursorY = getCursorPosition(); cursorX = cursorX * sx; cursorY = cursorY * sy; xFactor = cursorX - movingOffsetX; yFactor = cursorY - movingOffsetY; end local mW, mH = dxGetMaterialSize(rt) local x, y = getElementPosition(localPlayer) local X, Y = mW/2 -(x/(6000/worldW)), mH/2 +(y/(6000/worldH)) local camX,camY,camZ = getElementRotation(getCamera()) dxSetRenderTarget(rt, true) if alwaysRenderMap or getElementInterior(localPlayer) == 0 then dxDrawRectangle(xFactor, yFactor, worldW, worldH, 0xFF5E656B) dxDrawImage(X - worldW/2, mH/5 + (Y - worldH/2), worldW, worldH, "image/world.jpg", camZ, (x/(6000/worldW)), -(y/(6000/worldH)), tocolor(255, 255, 255, 255)) end dxSetRenderTarget() dxDrawRectangle((10)*xFactor, sy-((200+10))*yFactor, (300)*xFactor, (184)*yFactor, tocolor(0, 0, 0, 175)) dxDrawImage((10+5)*xFactor, sy-((200+5))*yFactor, (300-10)*xFactor, (175)*yFactor, rt, 0, 0, 0, tocolor(255, 255, 255, 255)) local rx, ry, rz = getElementRotation(localPlayer) local lB = (15)*xFactor local rB = (15+290)*xFactor local tB = sy-(205)*yFactor local bB = tB + (175)*yFactor local cX, cY = (rB+lB)/2, (tB+bB)/2 +(35)*yFactor local toLeft, toTop, toRight, toBottom = cX-lB, cY-tB, rB-cX, bB-cY for k, v in ipairs(getElementsByType("blip")) do local bx, by = getElementPosition(v) local actualDist = getDistanceBetweenPoints2D(x, y, bx, by) local maxDist = getBlipVisibleDistance(v) if actualDist <= maxDist and getElementDimension(v)==getElementDimension(localPlayer) and getElementInterior(v)==getElementInterior(localPlayer) then local dist = actualDist/(6000/((worldW+worldH)/2)) local rot = findRotation(bx, by, x, y)-camZ local bpx, bpy = getPointFromDistanceRotation(cX, cY, math.min(dist, math.sqrt(toTop^2 + toRight^2)), rot) local bpx = math.max(lB, math.min(rB, bpx)) local bpy = math.max(tB, math.min(bB, bpy)) local bid = getElementData(v, "customIcon") or getBlipIcon(v) local _, _, _, bcA = getBlipColor(v) local bcR, bcG, bcB = 255, 255, 255 if getBlipIcon(v) == 0 then bcR, bcG, bcB = getBlipColor(v) end local bS = getBlipSize(v) dxDrawImage(bpx -(blip*bS)*xFactor/2, bpy -(blip*bS)*yFactor/2, (blip*bS)*xFactor, (blip*bS)*yFactor, "image/blip/"..bid..".png", 0, 0, 0, tocolor(bcR, bcG, bcB, bcA)) end end if renderNorthBlip then local rot = -camZ+180 local bpx, bpy = getPointFromDistanceRotation(cX, cY, math.sqrt(toTop^2 + toRight^2), rot) --get position local bpx = math.max(lB, math.min(rB, bpx)) local bpy = math.max(tB, math.min(bB, bpy)) --cap position to screen local dist = getDistanceBetweenPoints2D(cX, cY, bpx, bpy) --get distance to the capped position local bpx, bpy = getPointFromDistanceRotation(cX, cY, dist, rot) --re-calculate position based on new distance if bpx and bpy then --if position was obtained successfully local bpx = math.max(lB, math.min(rB, bpx)) local bpy = math.max(tB, math.min(bB, bpy)) --cap position just in case dxDrawImage(bpx -(blip*2)/2, bpy -(blip*2)/2, blip*2, blip*2, "image/blip/4.png", 0, 0, 0) --draw north (4) blip end end dxDrawImage(cX -(blip*2)*xFactor/2, cY -(blip*2)*yFactor/2, (blip*2)*xFactor, (blip*2)*yFactor, "image/player.png", camZ-rz, 0, 0) end end addEventHandler("onClientRender", root, drawRadar) addEventHandler('onClientClick', getRootElement(), function(button, state, cursorX, cursorY) if (not isPlayerMapVisible()) then local cursorX, cursorY = getCursorPosition(); if (button == 'left' and state == 'down') then if (cursorX >= xFactor and cursorX <= xFactor + worldW and cursorY >= yFactor and cursorY <= yFactor + worldH) then isMoving = true; movingOffsetX = cursorX - xFactor; movingOffsetY = cursorY - yFactor; end else isMoving = false; end end end ) No errors/warnings in debugscript 3, what the problem with this?
  15. now the radar "move" but... not the way I want it bug video: this is the code: local movingOffsetX, movingOffsetY = 0, 0 local isMoving = false bindKey('m', 'down', function() showCursor(not isCursorShowing()); end ) function drawRadar() showPlayerHudComponent("radar", false) if disableGTASAhealth then showPlayerHudComponent("health", false) end if disableGTASAarmor then showPlayerHudComponent("armour", false) end if disableGTASAoxygen then showPlayerHudComponent("breath", false) end if (not isPlayerMapVisible()) then if (isCursorShowing() and isMoving) then local cursorX, cursorY = getCursorPosition(); cursorX = cursorX * sx; cursorY = cursorY * sy; xFactor = cursorX - movingOffsetX; yFactor = cursorY - movingOffsetY; end local mW, mH = dxGetMaterialSize(rt) local x, y = getElementPosition(localPlayer) local X, Y = mW/2 -(x/(6000/worldW)), mH/2 +(y/(6000/worldH)) local camX,camY,camZ = getElementRotation(getCamera()) dxSetRenderTarget(rt, true) if alwaysRenderMap or getElementInterior(localPlayer) == 0 then dxDrawRectangle(xFactor, yFactor, worldW, worldH, 0xFF5E656B) dxDrawImage(X - worldW/2, mH/5 + (Y - worldH/2), worldW, worldH, "image/world.jpg", camZ, (x/(6000/worldW)), -(y/(6000/worldH)), tocolor(255, 255, 255, 255)) end dxSetRenderTarget() dxDrawRectangle((10)*xFactor, sy-((200+10))*yFactor, (300)*xFactor, (184)*yFactor, tocolor(0, 0, 0, 175)) dxDrawImage((10+5)*xFactor, sy-((200+5))*yFactor, (300-10)*xFactor, (175)*yFactor, rt, 0, 0, 0, tocolor(255, 255, 255, 255)) local rx, ry, rz = getElementRotation(localPlayer) local lB = (15)*xFactor local rB = (15+290)*xFactor local tB = sy-(205)*yFactor local bB = tB + (175)*yFactor local cX, cY = (rB+lB)/2, (tB+bB)/2 +(35)*yFactor local toLeft, toTop, toRight, toBottom = cX-lB, cY-tB, rB-cX, bB-cY for k, v in ipairs(getElementsByType("blip")) do local bx, by = getElementPosition(v) local actualDist = getDistanceBetweenPoints2D(x, y, bx, by) local maxDist = getBlipVisibleDistance(v) if actualDist <= maxDist and getElementDimension(v)==getElementDimension(localPlayer) and getElementInterior(v)==getElementInterior(localPlayer) then local dist = actualDist/(6000/((worldW+worldH)/2)) local rot = findRotation(bx, by, x, y)-camZ local bpx, bpy = getPointFromDistanceRotation(cX, cY, math.min(dist, math.sqrt(toTop^2 + toRight^2)), rot) local bpx = math.max(lB, math.min(rB, bpx)) local bpy = math.max(tB, math.min(bB, bpy)) local bid = getElementData(v, "customIcon") or getBlipIcon(v) local _, _, _, bcA = getBlipColor(v) local bcR, bcG, bcB = 255, 255, 255 if getBlipIcon(v) == 0 then bcR, bcG, bcB = getBlipColor(v) end local bS = getBlipSize(v) dxDrawImage(bpx -(blip*bS)*xFactor/2, bpy -(blip*bS)*yFactor/2, (blip*bS)*xFactor, (blip*bS)*yFactor, "image/blip/"..bid..".png", 0, 0, 0, tocolor(bcR, bcG, bcB, bcA)) end end if renderNorthBlip then local rot = -camZ+180 local bpx, bpy = getPointFromDistanceRotation(cX, cY, math.sqrt(toTop^2 + toRight^2), rot) --get position local bpx = math.max(lB, math.min(rB, bpx)) local bpy = math.max(tB, math.min(bB, bpy)) --cap position to screen local dist = getDistanceBetweenPoints2D(cX, cY, bpx, bpy) --get distance to the capped position local bpx, bpy = getPointFromDistanceRotation(cX, cY, dist, rot) --re-calculate position based on new distance if bpx and bpy then --if position was obtained successfully local bpx = math.max(lB, math.min(rB, bpx)) local bpy = math.max(tB, math.min(bB, bpy)) --cap position just in case dxDrawImage(bpx -(blip*2)/2, bpy -(blip*2)/2, blip*2, blip*2, "image/blip/4.png", 0, 0, 0) --draw north (4) blip end end dxDrawImage(cX -(blip*2)*xFactor/2, cY -(blip*2)*yFactor/2, (blip*2)*xFactor, (blip*2)*yFactor, "image/player.png", camZ-rz, 0, 0) end end addEventHandler("onClientRender", root, drawRadar) addEventHandler('onClientClick', getRootElement(), function(button, state, cursorX, cursorY) if (not isPlayerMapVisible()) then if (button == 'left' and state == 'down') then if (cursorX >= xFactor and cursorX <= xFactor + worldW and cursorY >= yFactor and cursorY <= yFactor + worldH) then isMoving = true; movingOffsetX = cursorX - xFactor; movingOffsetY = cursorY - yFactor; end else isMoving = false; end end end ) how to fix this bug?
  16. Alguien me pasaría script De servidores Roleplay? es para abrir un server RP
  17. local movingOffsetX, movingOffsetY = 0, 0 local isMoving = false bindKey('m', 'down', function() showCursor(not isCursorShowing()); end ) function drawRadar() showPlayerHudComponent("radar", false) if disableGTASAhealth then showPlayerHudComponent("health", false) end if disableGTASAarmor then showPlayerHudComponent("armour", false) end if disableGTASAoxygen then showPlayerHudComponent("breath", false) end if (not isPlayerMapVisible()) then if (isCursorShowing() and isMoving) then local cursorX, cursorY = getCursorPosition(); cursorX = cursorX * sx; cursorY = cursorY * sy; xFactor = cursorX - movingOffsetX; yFactor = cursorY - movingOffsetY; end local mW, mH = dxGetMaterialSize(rt) local x, y = getElementPosition(localPlayer) local X, Y = mW/2 -(x/(6000/worldW)), mH/2 +(y/(6000/worldH)) local camX,camY,camZ = getElementRotation(getCamera()) dxSetRenderTarget(rt, true) if alwaysRenderMap or getElementInterior(localPlayer) == 0 then dxDrawRectangle(xFactor, yFactor, worldW, worldH, 0xFF5E656B) dxDrawImage(X - worldW/2, mH/5 + (Y - worldH/2), worldW, worldH, "image/world.jpg", camZ, (x/(6000/worldW)), -(y/(6000/worldH)), tocolor(255, 255, 255, 255)) end dxSetRenderTarget() dxDrawRectangle((10)*xFactor, sy-((200+10))*yFactor, (300)*xFactor, (184)*yFactor, tocolor(0, 0, 0, 175)) dxDrawImage((10+5)*xFactor, sy-((200+5))*yFactor, (300-10)*xFactor, (175)*yFactor, rt, 0, 0, 0, tocolor(255, 255, 255, 255)) local rx, ry, rz = getElementRotation(localPlayer) local lB = (15)*xFactor local rB = (15+290)*xFactor local tB = sy-(205)*yFactor local bB = tB + (175)*yFactor local cX, cY = (rB+lB)/2, (tB+bB)/2 +(35)*yFactor local toLeft, toTop, toRight, toBottom = cX-lB, cY-tB, rB-cX, bB-cY for k, v in ipairs(getElementsByType("blip")) do local bx, by = getElementPosition(v) local actualDist = getDistanceBetweenPoints2D(x, y, bx, by) local maxDist = getBlipVisibleDistance(v) if actualDist <= maxDist and getElementDimension(v)==getElementDimension(localPlayer) and getElementInterior(v)==getElementInterior(localPlayer) then local dist = actualDist/(6000/((worldW+worldH)/2)) local rot = findRotation(bx, by, x, y)-camZ local bpx, bpy = getPointFromDistanceRotation(cX, cY, math.min(dist, math.sqrt(toTop^2 + toRight^2)), rot) local bpx = math.max(lB, math.min(rB, bpx)) local bpy = math.max(tB, math.min(bB, bpy)) local bid = getElementData(v, "customIcon") or getBlipIcon(v) local _, _, _, bcA = getBlipColor(v) local bcR, bcG, bcB = 255, 255, 255 if getBlipIcon(v) == 0 then bcR, bcG, bcB = getBlipColor(v) end local bS = getBlipSize(v) dxDrawImage(bpx -(blip*bS)*xFactor/2, bpy -(blip*bS)*yFactor/2, (blip*bS)*xFactor, (blip*bS)*yFactor, "image/blip/"..bid..".png", 0, 0, 0, tocolor(bcR, bcG, bcB, bcA)) end end if renderNorthBlip then local rot = -camZ+180 local bpx, bpy = getPointFromDistanceRotation(cX, cY, math.sqrt(toTop^2 + toRight^2), rot) --get position local bpx = math.max(lB, math.min(rB, bpx)) local bpy = math.max(tB, math.min(bB, bpy)) --cap position to screen local dist = getDistanceBetweenPoints2D(cX, cY, bpx, bpy) --get distance to the capped position local bpx, bpy = getPointFromDistanceRotation(cX, cY, dist, rot) --re-calculate position based on new distance if bpx and bpy then --if position was obtained successfully local bpx = math.max(lB, math.min(rB, bpx)) local bpy = math.max(tB, math.min(bB, bpy)) --cap position just in case dxDrawImage(bpx -(blip*2)/2, bpy -(blip*2)/2, blip*2, blip*2, "image/blip/4.png", 0, 0, 0) --draw north (4) blip end end dxDrawImage(cX -(blip*2)*xFactor/2, cY -(blip*2)*yFactor/2, (blip*2)*xFactor, (blip*2)*yFactor, "image/player.png", camZ-rz, 0, 0) end end addEventHandler("onClientRender", root, drawRadar) addEventHandler('onClientClick', getRootElement(), function(button, state, cursorX, cursorY) if (not isPlayerMapVisible()) then local cursorX, cursorY = getCursorPosition(); if (button == 'left' and state == 'down') then if (cursorX >= xFactor and cursorX <= xFactor + worldW and cursorY >= yFactor and cursorY <= yFactor + worldH) then isMoving = true; movingOffsetX = cursorX - xFactor; movingOffsetY = cursorY - yFactor; end else isMoving = false; end end end ) why not move the radar? i do not get errors/warnings in debugscript 3 and i don't know what wrong..
  18. I downloaded this radar: https://community.multitheftauto.com/index.php?p=resources&s=details&id=10673 And how can i make this movable? For example, i press F5 button on my keyboard, and the radar become movable, and when i press F5 again, the radar again can not be moved. How to? Sorry, for my very-very bad english!
  19. [Alright, first of all: I just joined the Forums, so if i do anything wrong, just tell me.] Ok, so i got a problem, it's about an event i want to trigger on a certain amount of zombie's, or on a certain timer, that's all fine and such.. But, i want to merge some event's into a resource called "zombies", like the 'onZombieWasted' event, but then for a seperated Event, What i mean with that is i want to have a new 'onNemesisWasted' event working together with the 'onZombieWasted', but they need to sync up with the (if possible exported) createZombie function from the "zombies" resource. And i am aiming to make it to a elementData trigger, that i locally created as for example: local Nemesis = export.zombies:createZombie(etc,etc..), So when i check for that element's data on the name 'Nemesis' by existence (as in: if ( isElement ( Nemesis ) ) then) and in combination on the 'onNemesisWasted'- event to check if that export of createZombie (ped works aswel) is dead or not, after all of that if the createZombie (ped) is actually dead, then i wan't it to trigger the reward system together with the other piece's of code. To clear out this idea and problem, i also recorded the ZTown Nemesis Event Script and also post the 2 main scripts that hold me from finishing the Nemesis: The Video of me, quickly explaining what, how, and showing the problem: "youtube" And the 2 script's, there both Server-Side, The Nemesis.lua is changed to test it's functionality and quick testing, but feel free to change the code and re-post it here to function with 'onNemesisWasted' additions!.. the first setTimer(function() is there to prevent complication problems from other zombie resource's and scripts, just delaying it for better run's. Also, the second setTimer(function() is just to delay it's Blip creation and Attaching to prevent the Blip not being attached to the createZombie named nemesis. Nemesis.lua (start/event): function nemesisON() setTimer(function() if ( not isElement ( Nemesis ) ) then local nemesis = exports.zombies:createZombie ( 2343, 57, 26.5, 90, 38, 0, 0, nemesis, 0, "hunting", true ) setPedHeadless(nemesis, true) exports.extrahealth:setElementExtraHealth ( nemesis, 150 ) setElementData ( nemesis, "nemesis", true ) setTimer(function() myBlip = createBlipAttachedTo ( nemesis, 23 ) outputChatBox ('#FFFFFF[#7CFC00ZTown#FFFFFF]: #00BFFF A #00FFFFNemesis #00BFFFHas been spawned inside ZTown! #FFFFFF(#7CFC00Nemesis Boss Event#FFFFFF)', root, 255, 255, 255, true) triggerClientEvent(root, "event", root, "start") end,2500,1) end end,2500,1) end addEventHandler ( "onResourceStart", getRootElement(), nemesisON) monemesi.lua (check/reward): addEvent ( "onNemesisWasted", true ) addEventHandler ( "onNemesisWasted", root, function ( killer ) if ( isElement ( Nemesis ) ) then givePlayerMoney(killer,math.random(5000,25000)) killer = getPlayerName(killer) destroyElement ( myBlip ) outputChatBox ('#FFFFFF[#7CFC00ZTown#FFFFFF]: #00BFFF The #00FFFFNemesis #00BFFFHas been killed! #FFFFFF(#7CFC00Nemesis-Boss Event#FFFFFF)', root, 255, 255, 255, true) triggerClientEvent(root, "event", root, "stop") end end ) I hope sombady could find a way to make this function correctly, because i have try'ed loads of ways, and the way to use slothbot together with zombies resource... nahh, won't work, they wil keep fighting together like d*cks. EDIT: if ( isElement ( Nemesis ) ) = nemesis, i already changed that, but right after i posted it, derp.. Gr.xboxxxxd
  20. I need a script type. I have a Hydra and I would like to give one skin and another. For example, the MiG-29 and F-16. Please help!
  21. http://imgur.com/a/og3e5 this is the problem, how to fix this? code: local screenW, screenH = guiGetScreenSize() addEventHandler("onClientRender", root, function() local x, y, z = getElementPosition(localPlayer) local location = getZoneName ( x, y, z ) dxDrawImage(screenW * 0.0076, screenH * 0.7300, screenW * 0.2194, screenH * 0.2422, "mapbg.png", 360, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText(location, screenW * 0.0965, screenH * 0.7370, screenW * 0.2250, screenH * 0.7567, tocolor(118, 224, 90, 255), 1.00, "default-bold", "left", "center", false, false, true, false, false) end ) addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () setPlayerHudComponentVisible( "area_name", false ) end) local sx, sy = guiGetScreenSize() local rt = dxCreateRenderTarget(290, 175) local xFactor, yFactor = sx/1366, sy/768 local yFactor = xFactor function findRotation(x1,y1,x2,y2) local t = -math.deg(math.atan2(x2-x1,y2-y1)) if t < 0 then t = t + 360 end; return t; end function getPointFromDistanceRotation(x, y, dist, angle) local a = math.rad(90 - angle); local dx = math.cos(a) * dist; local dy = math.sin(a) * dist; return x+dx, y+dy; end function drawRadar() showPlayerHudComponent("radar", false) if disableGTASAhealth then showPlayerHudComponent("health", false) end if disableGTASAarmor then showPlayerHudComponent("armour", false) end if disableGTASAoxygen then showPlayerHudComponent("breath", false) end if (not isPlayerMapVisible()) then local mW, mH = dxGetMaterialSize(rt) local x, y = getElementPosition(localPlayer) local X, Y = mW/2 -(x/(6000/worldW)), mH/2 +(y/(6000/worldH)) local camX,camY,camZ = getElementRotation(getCamera()) dxSetRenderTarget(rt, true) if alwaysRenderMap or getElementInterior(localPlayer) == 0 then dxDrawRectangle(0, 0, mW, mH, 0xFF5E656B) dxDrawImage(X - worldW/2, mH/5 + (Y - worldH/2), worldW, worldH, "image/world.jpg", camZ, (x/(6000/worldW)), -(y/(6000/worldH)), tocolor(255, 255, 255, 255)) end dxSetRenderTarget() -- dxDrawRectangle((10)*xFactor, sy-((200+10))*yFactor, (300)*xFactor, (200)*yFactor, tocolor(0, 0, 0, 175)) dxDrawImage((10+5)*xFactor, sy-((200+5))*yFactor, (300-10)*xFactor, (175)*yFactor, rt, 0, 0, 0, tocolor(255, 255, 255, 255)) (this not the full code)
  22. A muito tempo atras joguei um servidor SAMP onde ao comprar vip, o player tinha diversas vantagens e uma delas era um salario. o Jogador ganhava 3k a cada 1 hora online. existe um script parecido pro mta ?
  23. Preciso de ajuda nesse script. Ele mostra o blip mostrando o local da base, so aparece quem esta no "Group" so que nao da certo, nao sei o que estou fazendo de errado BaseBlibs = {} setTimer(function() groupNames = getElementData(source,"Group") if BaseBlibs[player] then for i,blip in pairs(BaseBlibs[player])do destroyElement(blip) end BaseBlibs[player] = false end if not BaseBlibs[player] then BaseBlibs[player] = {} end local ownerAccount = getAccountName(getPlayerAccount(source)) local baseName = getBaseNameFromOwnerAccount(ownerAccount) local baseExpired,day,month,year,daysRemaining,maxautos,maxaircrafts = isBaseExpired(baseName) local colshapeb = getBaseColshape(baseName) if not groupNames and isElement(groupNames) then return end BaseBlibs = {} if colshapeb and isElement(colshapeb) then local players = getElementsWithinColShape(colshapeb,"player") for i, player in pairs(players) do if groupNames == getElementData(player,"Group") then BaseBlibs = createBlipAttachedTo(baseCol,52,2,255,255,255,255,0,99999,player) table.insert(blipss[player],blipp) end end end end,1000,0)
  24. https://community.multitheftauto.com/index.php?p=resources&s=details&id=3251 I downloaded this script, but when i move a player to jail, he can access the FR GUI, and "escape" from jail. How can i disable FR GUI access from imprisoned peoples?
  25. Boa Tarde pessoal preciso de ajuda nessa função if getPlayerCurrentSlots() + getItemSlots(itemName) <= getPlayerMaxAviableSlots() then -- AVISO AQUI! local col = getElementData(getLocalPlayer(),"currentCol") if #getElementsWithinColShape(col,"player") > 1 or getNetworkStats().packetlossLastSecond > 1 then return end x,y,z = getElementPosition(getLocalPlayer()) if pcount ~= nil and pcount < getTickCount() then pcount = getTickCount() + 2000 x,y,z = getElementPosition(getLocalPlayer()) outputChatBox("Wait... Press '" ..tostring(key).. "' (you must not move!)",255,255,255) return false elseif pcount == nil then pcount = getTickCount() + 2000 x,y,z = getElementPosition(getLocalPlayer()) return false end local x1,y1,z1 = getElementPosition(getLocalPlayer()) if x1 ~= x or y1 ~= y or z1 ~= z then pcount = nil return false end pcount = nil triggerServerEvent("onPlayerTakeItemFromGround", getLocalPlayer(), itemName, col) setElementData(getLocalPlayer(),"loot",false) setElementData(getLocalPlayer(),"currentCol",false) disableMenu() else startRollMessage2("Inventory","Inventory is full!",255,0,0) end end O AVISO NA LINHA 1: attempt to perform arithmetic on a boollean value Obrigado desde de já
×
×
  • Create New...