raynner

Members
  • Content Count

    209
  • Joined

  • Last visited

Community Reputation

10 Decent

3 Followers

About raynner

  • Rank
    Chump

Details

  • Gang
    LOS RED
  • Location
    Brazil
  • Occupation
    Scripting in Lua, Scripting in Mta Lua, Zmodeler, Bikes
  • Interests
    RPG MTA Server, Real City MTA

Recent Profile Visitors

1,616 profile views
  1. rs eu odeio usar essa função ela é muito complexa em minha mente eu também tenho problemas em fazer esses cálculos felizmente outro membro já te ajudou eu me dou bem com todos os outros elementos dx menos ImageSection rs
  2. se bem me lembro dxDrawImageSection faz oque você quer
  3. você pode usar onClientVehicleCollision (client side) e enviar isto para o server side e definir uma tabela com o valor do carro e verificar quando um player entra no veículo e para o motorista se é que você entende a ideia caso você seja um scripter mediano você certamente intendera, nós poderíamos lhe fornecer um codigo pronto e funcional mais qual seria seu aprendizado nisso !
  4. Ctrl+c e Ctrl+v algo comum na comunidade Br é que nós odiamos
  5. não sei se este funciona corretamente mas você pode editá-lo caso não esteja e corrigir seus erros https://community.mtasa.com/index.php?p=resources&s=details&id=3016
  6. very nice! thank, i really am not able to do this calculation!😓
  7. eu tenho bastante experiencia nisto, bom devo a sumir que você esta usando um modelo da net ! então certamente não deve ter erros na colisão do mesmo mais por segurança eu lhe aconselho criar um novo col use 3ds max para isso eu faço meus modelos de interiores de garagem e casas nele faço o modelo pelo sketchup e importo no 3ds e de lá adiciono iluminação e até a colisão agora vamos lá mostre-nos o seu codigo para averiguar pois provavelmente a fonte do seu problema é nele
  8. this seems to work but is not correct! it does not return the correct coordinates I will leave this feature on my drive so that anyone can test it I thought first to leave it in the community more like this incomplete would not be fair radar Drive
  9. Hello first sorry for the english I have a script that I'm editing it creates a radar: minimap and a bigmap (f11) (note: it does not replace the original it creates a new one and hides the original) I added gta v gps to it and everything works correctly but to create the route I type a command / gps and it renders me an image where I click and the script gets the coordinate and creates a route! what I want is to get the coordinate by clicking on the bigmap! I tried however the most I got was to create a function that returns the value x, y, z of the world that is being rendered in the center of the map and if I move the cursor I only have changes in the floot the function that I created --[[ mapX = CursorX mapY = CursorY PosX = playerX PosY = playerY x = bigmap render x y = bigmap render y w = bigmap render w h = bigmap render h range = zoom --]] function getWorldFromMapPosition(mapX, mapY, posx, posy, x, y, w, h, range) local worldX = posx + ((mapX - (x + w / 2)) / range) / 3000 / (range/180); local worldY = posy - ((mapY - (y + h / 2)) / range) / 3000 / (range/180); return worldX, worldY end my main code I don't see the need to show others more if you need to let me know I'm testing this on line 256 Map = {} Map.__index = Map Map.instances = {} Map.damageEfect = {} local sx,sy = guiGetScreenSize() px,py = 1366,768 x,y = (sx/px), (sy/py) font = dxCreateFont("images/myriadproregular.ttf",20,true) local max,min = math.min,math.max function cstrain( value, v1, v2 ) return max(min(value,v1),v2) end function math.map(value, low1, high1, low2, high2) return low2 + (value - low1) * (high2 - low2) / (high1 - low1) end function Map.new(X,Y,W,H) local self = setmetatable({}, Map) self.x = X self.y = Y self.w = W self.h = H local pos = {getElementPosition(localPlayer)} self.posX = pos[1] self.posY = pos[2] self.posZ = pos[3] self.size = 90 self.color = {255,255,255,255} self.blipSize = x*18 self.drawRange = 220 self.map = dxCreateTexture("images/gtasa.png","dxt5") self.map2 = dxCreateTexture("images/gtasa2.png","dxt5") self.renderTarget = dxCreateRenderTarget(W, H, true) self.blips = {} for k=0, 63 do self.blips[k] = dxCreateTexture("images/icons/"..k..".png","dxt3") end if(#Map.instances == 0) then addEventHandler("onClientRender", getRootElement(), Map.render) end table.insert(Map.instances, self) return self end function Map.render() for k,v in pairs(Map.instances) do if v.visible then if not v.style then v:draw() elseif v.style == 1 then v:draw2() end end end end function Map:setVisible(bool) self.visible = bool if bool == true then self:setPosition(getElementPosition(localPlayer)) end return true end function Map:isVisible() return self.visible end function Map:setPosition(x,y,z) self.posX = x self.posY = y self.posZ = z return true end function Map:getPosition() return self.posX, self.posY, self.posZ end function Map:setColor(r,g,b,a) self.color = {r,g,b,a} return true end function Map:getColor() return self.color end function Map:setSize(value) self.size = value return true end function dxDrawEmptyRec(absX,absY,sizeX,sizeY,color,ancho) dxDrawRectangle ( absX,absY,sizeX,ancho,color ) dxDrawRectangle ( absX,absY+ancho,ancho,sizeY-ancho,color ) dxDrawRectangle ( absX+ancho,absY+sizeY-ancho,sizeX-ancho,ancho,color ) dxDrawRectangle ( absX+sizeX-ancho,absY+ancho,ancho,sizeY-ancho*2,color ) end function Map:draw() dxSetRenderTarget(self.renderTarget, true) local player = getLocalPlayer() local centerX = (self.x) + (self.w/2) local centerY = (self.y) + (self.h/2) local pr = getPedRotation(player) local mapSize = 3000 / (self.drawRange/180) local zoomwert = self.drawRange if getKeyState("=") then if self.drawRange > 120 then self.drawRange = self.drawRange - 8 end elseif getKeyState("-") then if self.drawRange < 660 then self.drawRange = self.drawRange + 8 end elseif getKeyState("arrow_l") then self.posX = self.posX - (self.drawRange/100*10) elseif getKeyState("arrow_r") then self.posX = self.posX + (self.drawRange/100*10) elseif getKeyState("arrow_u") then self.posY = self.posY + (self.drawRange/100*10) elseif getKeyState("arrow_d") then self.posY = self.posY - (self.drawRange/100*10) end local mapPosX, mapPosY = -(math.map(self.posX+3000,0,6000,0,mapSize)-self.w/2), -(math.map(-self.posY + 3000, 0, 6000, 0, mapSize)-self.h/2) --[[ local screenW, screenH = guiGetScreenSize() local mptx,mpty,mptz = getWorldFromScreenPosition ( centerX, centerY, self.drawRange ) dxDrawText(tostring(umgerechnetx1), screenW * 0.3713, screenH * 0.6276, screenW * 0.6272, screenH * 0.9154, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) --]] ----------------------------------------------------------------------------------------------------- -- draw map dxDrawRectangle(0,0,self.w,self.h,tocolor(0,120,210)) dxDrawImage(mapPosX, mapPosY, mapSize, mapSize, self.map, 0,0,0, tocolor(255,255,255)) ----------------------------------------------------------------------------------------------------- -- draw radar areas for i, area in ipairs (getElementsByType("radararea")) do local ex, ey = getElementPosition(area) local w, h = getRadarAreaSize(area) local areaX = (3000+ex) / 6000 * mapSize local areaY = (3000-ey) / 6000 * mapSize local scaledW = w / 6000*mapSize local scaledH = -(h / 6000*mapSize) areaX = areaX + mapPosX areaY = areaY + mapPosY local rr, gg, bb, alpha = 255,255,255,255 rr, gg, bb, alpha = getRadarAreaColor(area) if (isRadarAreaFlashing(area)) then alpha = alpha*math.abs(getTickCount()%1000-500)/500 end dxSetBlendMode("modulate_add") dxDrawRectangle(areaX, areaY, scaledW, scaledH,tocolor(rr,gg,bb,alpha)) dxSetBlendMode("blend") end --local minStreamPosX,maxStreamPosX,minStreamPosY,maxStreamPosY=playerX-300*px*zoomwert,playerX+300*px*zoomwert,playerY-300*py*zoomwert,playerY+300*py*zoomwert if (#wegTable > 0) then for i,wayPoint in ipairs(wegTable) do --if mapPosX<wegTable[i].posX and mapPosX >wegTable[i].posX and mapPosY<wegTable[i].posY and mapPosY>wegTable[i].posY then local ex,ey = wegTable[i].posX,wegTable[i].posY local blipX = (3000+ex) / 6000 * mapSize local blipY = (3000-ey) / 6000 * mapSize blipX = blipX + mapPosX blipY = blipY + mapPosY if wegTable[i+1] then local ex2,ey2 = wegTable[i+1].posX,wegTable[i+1].posY local blipX2 = (3000+ex2) / 6000 * mapSize local blipY2 = (3000-ey2) / 6000 * mapSize blipX2 = blipX2 + mapPosX blipY2 = blipY2 + mapPosY local umgerechnetx1, umgerechnety1 = blipX,blipY local umgerechnetx2, umgerechnety2 = blipX2,blipY2 dxDrawLine(umgerechnetx1,umgerechnety1,umgerechnetx2,umgerechnety2,gpsColorRed, zoomwert / 10 / 20) else local ex2,ey2 = lastMarkerPositionX,lastMarkerPositionY local blipX2 = (3000+ex2) / 6000 * mapSize local blipY2 = (3000-ey2) / 6000 * mapSize blipX2 = blipX2 + mapPosX blipY2 = blipY2 + mapPosY local umgerechnetx1, umgerechnety1 = blipX,blipY local umgerechnetx2, umgerechnety2 = blipX2,blipY2 dxDrawLine(umgerechnetx1,umgerechnety1,umgerechnetx2,umgerechnety2,gpsColorRed, zoomwert / 10 / 20) end --end end end --[[function getWorldFromMapPosition(mapX, mapY) self.posX, self.posY, self.posZ = getElementPosition(player) local mapX, mapY = getCursorPosition() local worldX = ((mapX - (self.posX + self.w / 2)) / self.drawRange) / 3000 / (self.drawRange/180); local worldY = ((mapY - (self.posY + self.h / 2)) / self.drawRange) / 3000 / (self.drawRange/180); outputChatBox(tostring(worldX).." | "..tostring(worldY)) --return worldX, worldY; --end--]] ----------------------------------------------------------------------------------------------------- -- draw arrow local local b = self.blipSize local ex,ey = getElementPosition(player) local blipX = (3000+ex) / 6000 * mapSize local blipY = (3000-ey) / 6000 * mapSize blipX = blipX + mapPosX blipY = blipY + mapPosY dxDrawImage(blipX-x*23/2, blipY-y*25/2,x*23,y*25, self.blips[2], (-pr)%360,0,0,tocolor(255,255,255,255)) dxSetRenderTarget() ----------------------------------------------------------------------------------------------------- -- draw render target dxDrawEmptyRec(self.x-x*5, self.y-y*5, self.w+x*10, self.h+y*10,tocolor(0,0,0,150),5) dxDrawImage(self.x, self.y, self.w, self.h, self.renderTarget,0,0,0,tocolor(unpack(self.color))) ----------------------------------------------------------------------------------------------------- -- draw blips for i, b in ipairs (getElementsByType('blip')) do if getElementDimension(b) == getElementDimension(player) and getElementInterior(b) == getElementInterior(player) then local elementAttached = getElementAttachedTo ( b ) if elementAttached ~= player then local ex, ey, ez = getElementPosition(b) local blipX = (3000+ex) / 6000 * mapSize local blipY = (3000-ey) / 6000 * mapSize blipX = blipX + mapPosX + self.x blipY = blipY + mapPosY + self.y --[[if isCursorShowing(localPlayer) then local mapX, mapY = getCursorPosition() local tx,ty = getWorldFromMapPosition(mapX, mapY, self.posX, self.posY, self.x, self.y, self.w, self.h, self.drawRange) outputChatBox(tostring(tx).." | "..tostring(ty)) end--]] if blipX < self.x then blipX = self.x end if blipX > self.x + self.w then blipX = self.x + self.w end if blipY < self.y then blipY = self.y end if blipY > self.y + self.h then blipY = self.y + self.h end local blipIcon = getBlipIcon(b) local rr,gg,bb,aa = 255,255,255,255 local blipSize = self.blipSize if (elementAttached) and (getElementType(elementAttached) == "vehicle") then blipSize = blipSize / 2 aa = 200 end local blipIcon = getBlipIcon(b) if blipIcon == 0 then rr, gg, bb, aa = getBlipColor(b) end local img = self.blips[blipIcon] if (elementAttached) and (getElementType(elementAttached) == "player") then img = self.blips[0] blipSize = blipSize / 1.6 end dxDrawImage(blipX-blipSize/2, blipY-blipSize/2, blipSize, blipSize, img,0,0,0,tocolor(rr,gg,bb,aa)) end end end end wegTable={} function Map:draw2() dxSetRenderTarget(self.renderTarget, true) local player = getLocalPlayer() local centerX = (self.x) + (self.w/2) local centerY = (self.y) + (self.h/2) local pr = getPedRotation(player) local mapSize = 3000 / (self.drawRange/180) local zoomwert = self.drawRange local _, _, camRotZ = getElementRotation(getCamera()) if getKeyState("=") then if self.drawRange > 120 then self.drawRange = self.drawRange - 8 end elseif getKeyState("-") then if self.drawRange < 260 then self.drawRange = self.drawRange + 8 end end self.posX, self.posY, self.posZ = getElementPosition(player) local playerX, playerY, playerZ = getElementPosition(player) local mapPosX, mapPosY = -(math.map(self.posX+3000,0,6000,0,mapSize)-self.w/2), -(math.map(-self.posY + 3000, 0, 6000, 0, mapSize)-self.h/2) ----------------------------------------------------------------------------------------------------- -- draw map local cx,cy,_,tx,ty = getCameraMatrix() local north = findRotation(cx,cy,tx,ty) dxDrawRectangle(0,0,self.w,self.h,tocolor(0,120,210)) dxDrawImage(mapPosX, mapPosY, mapSize, mapSize, self.map2, north, -mapSize/2 - mapPosX + self.w/2, -mapSize/2 - mapPosY + self.h/2, tocolor(255,255,255)) ----------------------------------------------------------------------------------------------------- -- draw wanted level effect if getPlayerWantedLevel(player) > 0 then if not old then old = getTickCount() wR,wG,wB = 0,0,255 end current = getTickCount () if current-old > 1500 then old = getTickCount() if wR == 255 then wR,wG,wB = 0,100,255 else wR,wG,wB = 255,0,0 end end dxDrawRectangle(0, 0, self.w, self.h,tocolor(wR,wG,wB,100)) end ----------------------------------------------------------------------------------------------------- -- draw radar areas for i, area in ipairs (getElementsByType("radararea")) do local ex, ey = getElementPosition(area) local w, h = getRadarAreaSize(area) local areaX = (3000+ex) / 6000 * mapSize local areaY = (3000-ey) / 6000 * mapSize local scaledW = w / 6000*mapSize local scaledH = -(h / 6000*mapSize) areaX = areaX + mapPosX areaY = areaY + mapPosY local rr, gg, bb, alpha = 255,255,255,255 rr, gg, bb, alpha = getRadarAreaColor(area) if (isRadarAreaFlashing(area)) then alpha = alpha*math.abs(getTickCount()%1000-500)/500 end dxSetBlendMode("modulate_add") dxDrawImage(areaX, areaY, scaledW, scaledH,self.blips[1], north, -scaledW/2 - areaX + self.w/2, -scaledH/2 - areaY + self.h/2,tocolor(rr,gg,bb,alpha)) dxSetBlendMode("blend") end ----------------------------------------------------------------------------------------------------- -- draw blips for i, b in ipairs (getElementsByType('blip')) do if getElementDimension(b) == getElementDimension(player) and getElementInterior(b) == getElementInterior(player) then local elementAttached = getElementAttachedTo ( b ) if elementAttached ~= player then local ex, ey, ez = getElementPosition(b) local bf = getBlipVisibleDistance(b) local blipIcon = getBlipIcon(b) local rr,gg,bb,aa = 255,255,255,255 local blipSize = self.blipSize local blipX, blipY = getRadarFromWorldPosition(ex,ey,-x*40, -y*40, self.w+x*80, self.h+y*80,mapSize) local Px, Py, Pz = getElementPosition(player) if getDistanceBetweenPoints2D(Px, Py, ex, ey) < 380 then --outputChatBox(getDistanceBetweenPoints2D(Px, Py, ex, ey)..' : '..bf) blipX, blipY = cstrain(blipX, 1, 258), cstrain(blipY, 1, 150) end if getDistanceBetweenPoints2D(Px, Py, ex, ey) < bf then if (elementAttached) and (getElementType(elementAttached) == "vehicle") then blipSize = blipSize / 2 aa = 200 end local blipIcon = getBlipIcon(b) if blipIcon == 0 then rr, gg, bb, aa = getBlipColor(b) end local img = self.blips[blipIcon] if (elementAttached) and (getElementType(elementAttached) == "player") then img = self.blips[0] blipSize = blipSize / 1.6 end dxDrawImage(blipX-blipSize/2, blipY-blipSize/2, blipSize, blipSize,img, 0,0,0,tocolor(rr,gg,bb,aa)) end if (elementAttached) and (getElementType(elementAttached) == "player") and getPedOccupiedVehicle(elementAttached) and getVehicleType(getPedOccupiedVehicle(elementAttached)) == "Helicopter" then dxDrawImage(blipX-x*50/2, blipY-y*50/2, x*50, y*50, "images/H.png",north-getPedRotation(elementAttached)) dxDrawImage(blipX-x*50/2, blipY-y*50/2, x*50, y*50, "images/HR.png",getTickCount()%360) end end end end --local minStreamPosX,maxStreamPosX,minStreamPosY,maxStreamPosY=playerX-300*px*zoomwert,playerX+300*px*zoomwert,playerY-300*py*zoomwert,playerY+300*py*zoomwert if (#wegTable > 0) then for i,wayPoint in ipairs(wegTable) do --if mapPosX<wegTable[i].posX and mapPosX >wegTable[i].posX and mapPosY<wegTable[i].posY and mapPosY>wegTable[i].posY then local screenW, screenH = guiGetScreenSize() if wegTable[i+1] then local umgerechnetx1, umgerechnety1 = getRadarFromWorldPosition(wegTable[i].posX,wegTable[i].posY,-x*40, -y*40, self.w+x*80, self.h+y*80,mapSize) local umgerechnetx2, umgerechnety2 = getRadarFromWorldPosition(wegTable[i+1].posX,wegTable[i+1].posY,-x*40, -y*40, self.w+x*80, self.h+y*80,mapSize) dxDrawLine(umgerechnetx1,umgerechnety1,umgerechnetx2,umgerechnety2,gpsColorRed, zoomwert / 6 / 10) else local umgerechnetx1, umgerechnety1 = getRadarFromWorldPosition(wegTable[i].posX,wegTable[i].posY,-x*40, -y*40, self.w+x*80, self.h+y*80,mapSize) local umgerechnetx2, umgerechnety2 = getRadarFromWorldPosition(lastMarkerPositionX,lastMarkerPositionY,-x*40, -y*40, self.w+x*80, self.h+y*80,mapSize) dxDrawLine(umgerechnetx1,umgerechnety1,umgerechnetx2,umgerechnety2,gpsColorRed, zoomwert / 6 / 10) end --end end end ----------------------------------------------------------------------------------------------------- -- draw arrow local local b = self.blipSize local ex,ey = getElementPosition(player) local blipX = (3000+ex) / 6000 * mapSize local blipY = (3000-ey) / 6000 * mapSize blipX = blipX + mapPosX blipY = blipY + mapPosY if getPedOccupiedVehicle(player) and getVehicleType(getPedOccupiedVehicle(player)) == "Helicopter" then dxDrawImage(blipX-x*50/2, blipY-y*50/2, x*50, y*50, "images/H.png",north-pr) dxDrawImage(blipX-x*50/2, blipY-y*50/2, x*50, y*50, "images/HR.png",getTickCount()%360) else dxDrawImage(blipX-x*23/2, blipY-y*25/2,x*23,y*25, self.blips[2], north-pr,0,0,tocolor(255,255,255,255)) end dxSetRenderTarget() ----------------------------------------------------------------------------------------------------- -- draw render target if getElementInterior(player) == 0 then dxDrawRectangle(self.x-x*5, self.y-y*5, self.w+x*10, self.h+y*10, tocolor(0, 0, 0, 150), false) dxDrawImage(self.x, self.y, self.w, self.h, self.renderTarget,0,0,0,tocolor(unpack(self.color))) else dxDrawImage(self.x, self.y, self.w, self.h, "images/lostc.png") end ----------------------------------------------------------------------------------------------------- -- draw damage effect for k, v in ipairs(Map.damageEfect) do v[3] = v[3] - (getTickCount() - v[1]) / 800 if v[3] <= 0 then table.remove(Map.damageEfect, k) else dxDrawImage(self.x, self.y, self.w, self.h, "images/mapred.png", 0, 0, 0, tocolor(255, 255, 255, v[3])) end end --dxDrawImage(self.x-x*5, self.y-y*22, self.w+x*10, self.h+y*28, "images/mapbg.png",0,0,0,tocolor(unpack(self.color))) --local zinColor = getKeyState("=") and tocolor(255,255,255,self.color[4]) or tocolor(172,211,115,self.color[4]) --dxDrawImage(self.x+x*263, self.y-y*19,x*17,y*17, "images/zin.png",0,0,0,zinColor) --local zoutColor = getKeyState("-") and tocolor(255,255,255,self.color[4]) or tocolor(172,211,115,self.color[4]) --dxDrawImage(self.x+x*285, self.y-y*19,x*17,y*17, "images/zout.png",0,0,0,zoutColor) --dxDrawText(zoneText,self.x+x*32,self.y-y*22, x*100, y*100, tocolor(unpack(self.color)), x*0.6, font,"left","top",false,false,false,true) --dxDrawRectangle(self.x-x*5, self.y-y*5, self.w+x*10, self.h+y*10, tocolor(0, 0, 0, 150), false) local zoneText = getElementInterior(player) == 0 and "#FFFFFF"..getZoneName(playerX,playerY,playerZ) or "#FFFFFF" dxDrawRectangle(self.x, self.y+self.h-y*20, self.w, self.h/8, tocolor(0, 0, 0, 80), false) dxDrawText(" "..zoneText,self.x, self.y+self.h-y*21, x*100, y*100, tocolor(255, 255, 255, 255), x*0.6, font,"left","top",false,false,false,true) end 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 getPointAway(x, y, angle, dist) local a = -math.rad(angle) dist = dist / 57.295779513082 return x + (dist * math.deg(math.sin(a))), y + (dist * math.deg(math.cos(a))) end function getRadarFromWorldPosition(bx, by, x, y, w, h, scaledMapSize) local RadarX, RadarY = x + w/2, y + h/2 local RadarD = getDistanceBetweenPoints2D(RadarX, RadarY, x, y) local px, py = getElementPosition(localPlayer) local _, _, crz = getElementRotation(getCamera()) local dist = getDistanceBetweenPoints2D(px, py, bx, by) if dist > RadarD * 6000/scaledMapSize then dist = RadarD * 6000/scaledMapSize end local rot = 180 - findRotation(px, py, bx, by) + crz local ax, ay = getPointAway(RadarX, RadarY, rot, dist * scaledMapSize/6000) return ax, ay end function onClientPlayerDamage(attacker, weapon, _, bodypart) local part = attacker and getElementType(attacker) == "player" and getPedWeaponSlot(attacker) and getPedWeaponSlot(attacker) or false if attacker and attacker ~= source and not (part == 8 or (part == 7 and weapon ~= 38)) then Map.damageEfect[#Map.damageEfect + 1] = {getTickCount(), 0, math.min(25.5 * bodypart, 255)} else Map.damageEfect[#Map.damageEfect + 1] = {getTickCount(), 0, math.min(20 * bodypart, 255)} end if #Map.damageEfect > 18 then repeat table.remove(Map.damageEfect, 1) until #Map.damageEfect < 18 end end addEventHandler("onClientPlayerDamage", localPlayer,onClientPlayerDamage) function getWorldFromMapPosition(mapX, mapY, posx, posy, x, y, w, h, range) local worldX = posx + ((mapX*10 - (x + w / 2)) / range) / 3000 / (range/180); local worldY = posy - ((mapY*10 - (y + h / 2)) / range) / 3000 / (range/180); return worldX, worldY end
  10. Algum moderador move para lixeira vou perguntar lá no gringo pq esse problema é meio avançado acredito que o pessoal aqui não vai conseguir me ajudar agradeço ai a todos
  11. Bom isto n funciona pois meu mapa F11 não é modificado e sim um script que cria um novo F11 e ele oculta o original não substitui a imagem original !
  12. Não vejo erro no seu código mas respondendo a sua pergunta sobre deixar o cara no chão usando um frame da animação é possível usando setPedAnimationProgress
  13. Olá amigos então eu estou com um problema que eu realmente não sou capaz de resolver ! Necessidade : Eu preciso pegar a posição do mundo através do cursor em cima da imagem do meu f11 personalizado Descrição completa: Eu peguei esse roteiro de um amigo mais eu acredito já telo visto pela internet e eu estou fazendo varias modificações nele eu adicionei blips as bordas e outras correções ... eu estou atualmente adicionando sistema de gps do gta v nele bom tudo já funciona porém eu coloquei para usar /gps aparece a imagem e eu clico no local porém eu quero fazer isso direto do mapa F11 eu tentei diversos cálculos mas o mais perto que eu cheguei foi obter a cordenada do mundo do centro em que o mapa esta Nota: vou deixar o código do arquivado de render aqui ele tem outros roteiros necessários para funcionar se precisar do mesmo diga eu irei disponibilizar eu não tenho problema em telo disponível pela internet afinal apenas estou aprimorando para meu servidor mais ainda esta longe de completo. Este é a função que eu fiz que me retorna a posição do mundo em que fica no centro do mapa quando eu movo ele vai pegando a cordenada do que esta no centro do render e seu eu movo o mouse ele apenas tem algumas alterações no floot da postion No codigo estou testando isso na linha 256 function getWorldFromMapPosition(mapX, mapY, posx, posy, x, y, w, h, range) local worldX = posx + ((mapX - (x + w / 2)) / range) / 3000 / (range/180); local worldY = posy - ((mapY - (y + h / 2)) / range) / 3000 / (range/180); return worldX, worldY end Map = {} Map.__index = Map Map.instances = {} Map.damageEfect = {} local sx,sy = guiGetScreenSize() px,py = 1366,768 x,y = (sx/px), (sy/py) font = dxCreateFont("images/myriadproregular.ttf",20,true) local max,min = math.min,math.max function cstrain( value, v1, v2 ) return max(min(value,v1),v2) end function math.map(value, low1, high1, low2, high2) return low2 + (value - low1) * (high2 - low2) / (high1 - low1) end function Map.new(X,Y,W,H) local self = setmetatable({}, Map) self.x = X self.y = Y self.w = W self.h = H local pos = {getElementPosition(localPlayer)} self.posX = pos[1] self.posY = pos[2] self.posZ = pos[3] self.size = 90 self.color = {255,255,255,255} self.blipSize = x*18 self.drawRange = 220 self.map = dxCreateTexture("images/gtasa.png","dxt5") self.map2 = dxCreateTexture("images/gtasa2.png","dxt5") self.renderTarget = dxCreateRenderTarget(W, H, true) self.blips = {} for k=0, 63 do self.blips[k] = dxCreateTexture("images/icons/"..k..".png","dxt3") end if(#Map.instances == 0) then addEventHandler("onClientRender", getRootElement(), Map.render) end table.insert(Map.instances, self) return self end function Map.render() for k,v in pairs(Map.instances) do if v.visible then if not v.style then v:draw() elseif v.style == 1 then v:draw2() end end end end function Map:setVisible(bool) self.visible = bool if bool == true then self:setPosition(getElementPosition(localPlayer)) end return true end function Map:isVisible() return self.visible end function Map:setPosition(x,y,z) self.posX = x self.posY = y self.posZ = z return true end function Map:getPosition() return self.posX, self.posY, self.posZ end function Map:setColor(r,g,b,a) self.color = {r,g,b,a} return true end function Map:getColor() return self.color end function Map:setSize(value) self.size = value return true end function dxDrawEmptyRec(absX,absY,sizeX,sizeY,color,ancho) dxDrawRectangle ( absX,absY,sizeX,ancho,color ) dxDrawRectangle ( absX,absY+ancho,ancho,sizeY-ancho,color ) dxDrawRectangle ( absX+ancho,absY+sizeY-ancho,sizeX-ancho,ancho,color ) dxDrawRectangle ( absX+sizeX-ancho,absY+ancho,ancho,sizeY-ancho*2,color ) end function Map:draw() dxSetRenderTarget(self.renderTarget, true) local player = getLocalPlayer() local centerX = (self.x) + (self.w/2) local centerY = (self.y) + (self.h/2) local pr = getPedRotation(player) local mapSize = 3000 / (self.drawRange/180) local zoomwert = self.drawRange if getKeyState("=") then if self.drawRange > 120 then self.drawRange = self.drawRange - 8 end elseif getKeyState("-") then if self.drawRange < 660 then self.drawRange = self.drawRange + 8 end elseif getKeyState("arrow_l") then self.posX = self.posX - (self.drawRange/100*10) elseif getKeyState("arrow_r") then self.posX = self.posX + (self.drawRange/100*10) elseif getKeyState("arrow_u") then self.posY = self.posY + (self.drawRange/100*10) elseif getKeyState("arrow_d") then self.posY = self.posY - (self.drawRange/100*10) end local mapPosX, mapPosY = -(math.map(self.posX+3000,0,6000,0,mapSize)-self.w/2), -(math.map(-self.posY + 3000, 0, 6000, 0, mapSize)-self.h/2) --[[ local screenW, screenH = guiGetScreenSize() local mptx,mpty,mptz = getWorldFromScreenPosition ( centerX, centerY, self.drawRange ) dxDrawText(tostring(umgerechnetx1), screenW * 0.3713, screenH * 0.6276, screenW * 0.6272, screenH * 0.9154, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) --]] ----------------------------------------------------------------------------------------------------- -- draw map dxDrawRectangle(0,0,self.w,self.h,tocolor(0,120,210)) dxDrawImage(mapPosX, mapPosY, mapSize, mapSize, self.map, 0,0,0, tocolor(255,255,255)) ----------------------------------------------------------------------------------------------------- -- draw radar areas for i, area in ipairs (getElementsByType("radararea")) do local ex, ey = getElementPosition(area) local w, h = getRadarAreaSize(area) local areaX = (3000+ex) / 6000 * mapSize local areaY = (3000-ey) / 6000 * mapSize local scaledW = w / 6000*mapSize local scaledH = -(h / 6000*mapSize) areaX = areaX + mapPosX areaY = areaY + mapPosY local rr, gg, bb, alpha = 255,255,255,255 rr, gg, bb, alpha = getRadarAreaColor(area) if (isRadarAreaFlashing(area)) then alpha = alpha*math.abs(getTickCount()%1000-500)/500 end dxSetBlendMode("modulate_add") dxDrawRectangle(areaX, areaY, scaledW, scaledH,tocolor(rr,gg,bb,alpha)) dxSetBlendMode("blend") end --local minStreamPosX,maxStreamPosX,minStreamPosY,maxStreamPosY=playerX-300*px*zoomwert,playerX+300*px*zoomwert,playerY-300*py*zoomwert,playerY+300*py*zoomwert if (#wegTable > 0) then for i,wayPoint in ipairs(wegTable) do --if mapPosX<wegTable[i].posX and mapPosX >wegTable[i].posX and mapPosY<wegTable[i].posY and mapPosY>wegTable[i].posY then local ex,ey = wegTable[i].posX,wegTable[i].posY local blipX = (3000+ex) / 6000 * mapSize local blipY = (3000-ey) / 6000 * mapSize blipX = blipX + mapPosX blipY = blipY + mapPosY if wegTable[i+1] then local ex2,ey2 = wegTable[i+1].posX,wegTable[i+1].posY local blipX2 = (3000+ex2) / 6000 * mapSize local blipY2 = (3000-ey2) / 6000 * mapSize blipX2 = blipX2 + mapPosX blipY2 = blipY2 + mapPosY local umgerechnetx1, umgerechnety1 = blipX,blipY local umgerechnetx2, umgerechnety2 = blipX2,blipY2 dxDrawLine(umgerechnetx1,umgerechnety1,umgerechnetx2,umgerechnety2,gpsColorRed, zoomwert / 10 / 20) else local ex2,ey2 = lastMarkerPositionX,lastMarkerPositionY local blipX2 = (3000+ex2) / 6000 * mapSize local blipY2 = (3000-ey2) / 6000 * mapSize blipX2 = blipX2 + mapPosX blipY2 = blipY2 + mapPosY local umgerechnetx1, umgerechnety1 = blipX,blipY local umgerechnetx2, umgerechnety2 = blipX2,blipY2 dxDrawLine(umgerechnetx1,umgerechnety1,umgerechnetx2,umgerechnety2,gpsColorRed, zoomwert / 10 / 20) end --end end end --[[function getWorldFromMapPosition(mapX, mapY) self.posX, self.posY, self.posZ = getElementPosition(player) local mapX, mapY = getCursorPosition() local worldX = ((mapX - (self.posX + self.w / 2)) / self.drawRange) / 3000 / (self.drawRange/180); local worldY = ((mapY - (self.posY + self.h / 2)) / self.drawRange) / 3000 / (self.drawRange/180); outputChatBox(tostring(worldX).." | "..tostring(worldY)) --return worldX, worldY; --end--]] ----------------------------------------------------------------------------------------------------- -- draw arrow local local b = self.blipSize local ex,ey = getElementPosition(player) local blipX = (3000+ex) / 6000 * mapSize local blipY = (3000-ey) / 6000 * mapSize blipX = blipX + mapPosX blipY = blipY + mapPosY dxDrawImage(blipX-x*23/2, blipY-y*25/2,x*23,y*25, self.blips[2], (-pr)%360,0,0,tocolor(255,255,255,255)) dxSetRenderTarget() ----------------------------------------------------------------------------------------------------- -- draw render target dxDrawEmptyRec(self.x-x*5, self.y-y*5, self.w+x*10, self.h+y*10,tocolor(0,0,0,150),5) dxDrawImage(self.x, self.y, self.w, self.h, self.renderTarget,0,0,0,tocolor(unpack(self.color))) ----------------------------------------------------------------------------------------------------- -- draw blips for i, b in ipairs (getElementsByType('blip')) do if getElementDimension(b) == getElementDimension(player) and getElementInterior(b) == getElementInterior(player) then local elementAttached = getElementAttachedTo ( b ) if elementAttached ~= player then local ex, ey, ez = getElementPosition(b) local blipX = (3000+ex) / 6000 * mapSize local blipY = (3000-ey) / 6000 * mapSize blipX = blipX + mapPosX + self.x blipY = blipY + mapPosY + self.y --[[if isCursorShowing(localPlayer) then local mapX, mapY = getCursorPosition() local tx,ty = getWorldFromMapPosition(mapX, mapY, self.posX, self.posY, self.x, self.y, self.w, self.h, self.drawRange) outputChatBox(tostring(tx).." | "..tostring(ty)) end--]] if blipX < self.x then blipX = self.x end if blipX > self.x + self.w then blipX = self.x + self.w end if blipY < self.y then blipY = self.y end if blipY > self.y + self.h then blipY = self.y + self.h end local blipIcon = getBlipIcon(b) local rr,gg,bb,aa = 255,255,255,255 local blipSize = self.blipSize if (elementAttached) and (getElementType(elementAttached) == "vehicle") then blipSize = blipSize / 2 aa = 200 end local blipIcon = getBlipIcon(b) if blipIcon == 0 then rr, gg, bb, aa = getBlipColor(b) end local img = self.blips[blipIcon] if (elementAttached) and (getElementType(elementAttached) == "player") then img = self.blips[0] blipSize = blipSize / 1.6 end dxDrawImage(blipX-blipSize/2, blipY-blipSize/2, blipSize, blipSize, img,0,0,0,tocolor(rr,gg,bb,aa)) end end end end wegTable={} function Map:draw2() dxSetRenderTarget(self.renderTarget, true) local player = getLocalPlayer() local centerX = (self.x) + (self.w/2) local centerY = (self.y) + (self.h/2) local pr = getPedRotation(player) local mapSize = 3000 / (self.drawRange/180) local zoomwert = self.drawRange local _, _, camRotZ = getElementRotation(getCamera()) if getKeyState("=") then if self.drawRange > 120 then self.drawRange = self.drawRange - 8 end elseif getKeyState("-") then if self.drawRange < 260 then self.drawRange = self.drawRange + 8 end end self.posX, self.posY, self.posZ = getElementPosition(player) local playerX, playerY, playerZ = getElementPosition(player) local mapPosX, mapPosY = -(math.map(self.posX+3000,0,6000,0,mapSize)-self.w/2), -(math.map(-self.posY + 3000, 0, 6000, 0, mapSize)-self.h/2) ----------------------------------------------------------------------------------------------------- -- draw map local cx,cy,_,tx,ty = getCameraMatrix() local north = findRotation(cx,cy,tx,ty) dxDrawRectangle(0,0,self.w,self.h,tocolor(0,120,210)) dxDrawImage(mapPosX, mapPosY, mapSize, mapSize, self.map2, north, -mapSize/2 - mapPosX + self.w/2, -mapSize/2 - mapPosY + self.h/2, tocolor(255,255,255)) ----------------------------------------------------------------------------------------------------- -- draw wanted level effect if getPlayerWantedLevel(player) > 0 then if not old then old = getTickCount() wR,wG,wB = 0,0,255 end current = getTickCount () if current-old > 1500 then old = getTickCount() if wR == 255 then wR,wG,wB = 0,100,255 else wR,wG,wB = 255,0,0 end end dxDrawRectangle(0, 0, self.w, self.h,tocolor(wR,wG,wB,100)) end ----------------------------------------------------------------------------------------------------- -- draw radar areas for i, area in ipairs (getElementsByType("radararea")) do local ex, ey = getElementPosition(area) local w, h = getRadarAreaSize(area) local areaX = (3000+ex) / 6000 * mapSize local areaY = (3000-ey) / 6000 * mapSize local scaledW = w / 6000*mapSize local scaledH = -(h / 6000*mapSize) areaX = areaX + mapPosX areaY = areaY + mapPosY local rr, gg, bb, alpha = 255,255,255,255 rr, gg, bb, alpha = getRadarAreaColor(area) if (isRadarAreaFlashing(area)) then alpha = alpha*math.abs(getTickCount()%1000-500)/500 end dxSetBlendMode("modulate_add") dxDrawImage(areaX, areaY, scaledW, scaledH,self.blips[1], north, -scaledW/2 - areaX + self.w/2, -scaledH/2 - areaY + self.h/2,tocolor(rr,gg,bb,alpha)) dxSetBlendMode("blend") end ----------------------------------------------------------------------------------------------------- -- draw blips for i, b in ipairs (getElementsByType('blip')) do if getElementDimension(b) == getElementDimension(player) and getElementInterior(b) == getElementInterior(player) then local elementAttached = getElementAttachedTo ( b ) if elementAttached ~= player then local ex, ey, ez = getElementPosition(b) local bf = getBlipVisibleDistance(b) local blipIcon = getBlipIcon(b) local rr,gg,bb,aa = 255,255,255,255 local blipSize = self.blipSize local blipX, blipY = getRadarFromWorldPosition(ex,ey,-x*40, -y*40, self.w+x*80, self.h+y*80,mapSize) local Px, Py, Pz = getElementPosition(player) if getDistanceBetweenPoints2D(Px, Py, ex, ey) < 380 then --outputChatBox(getDistanceBetweenPoints2D(Px, Py, ex, ey)..' : '..bf) blipX, blipY = cstrain(blipX, 1, 258), cstrain(blipY, 1, 150) end if (elementAttached) and (getElementType(elementAttached) == "vehicle") then blipSize = blipSize / 2 aa = 200 end local blipIcon = getBlipIcon(b) if blipIcon == 0 then rr, gg, bb, aa = getBlipColor(b) end local img = self.blips[blipIcon] if (elementAttached) and (getElementType(elementAttached) == "player") then img = self.blips[0] blipSize = blipSize / 1.6 end dxDrawImage(blipX-blipSize/2, blipY-blipSize/2, blipSize, blipSize,img, 0,0,0,tocolor(rr,gg,bb,aa)) if (elementAttached) and (getElementType(elementAttached) == "player") and getPedOccupiedVehicle(elementAttached) and getVehicleType(getPedOccupiedVehicle(elementAttached)) == "Helicopter" then dxDrawImage(blipX-x*50/2, blipY-y*50/2, x*50, y*50, "images/H.png",north-getPedRotation(elementAttached)) dxDrawImage(blipX-x*50/2, blipY-y*50/2, x*50, y*50, "images/HR.png",getTickCount()%360) end end end end --local minStreamPosX,maxStreamPosX,minStreamPosY,maxStreamPosY=playerX-300*px*zoomwert,playerX+300*px*zoomwert,playerY-300*py*zoomwert,playerY+300*py*zoomwert if (#wegTable > 0) then for i,wayPoint in ipairs(wegTable) do --if mapPosX<wegTable[i].posX and mapPosX >wegTable[i].posX and mapPosY<wegTable[i].posY and mapPosY>wegTable[i].posY then local screenW, screenH = guiGetScreenSize() if wegTable[i+1] then local umgerechnetx1, umgerechnety1 = getRadarFromWorldPosition(wegTable[i].posX,wegTable[i].posY,-x*40, -y*40, self.w+x*80, self.h+y*80,mapSize) local umgerechnetx2, umgerechnety2 = getRadarFromWorldPosition(wegTable[i+1].posX,wegTable[i+1].posY,-x*40, -y*40, self.w+x*80, self.h+y*80,mapSize) dxDrawLine(umgerechnetx1,umgerechnety1,umgerechnetx2,umgerechnety2,gpsColorRed, zoomwert / 6 / 10) else local umgerechnetx1, umgerechnety1 = getRadarFromWorldPosition(wegTable[i].posX,wegTable[i].posY,-x*40, -y*40, self.w+x*80, self.h+y*80,mapSize) local umgerechnetx2, umgerechnety2 = getRadarFromWorldPosition(lastMarkerPositionX,lastMarkerPositionY,-x*40, -y*40, self.w+x*80, self.h+y*80,mapSize) dxDrawLine(umgerechnetx1,umgerechnety1,umgerechnetx2,umgerechnety2,gpsColorRed, zoomwert / 6 / 10) end --end end end ----------------------------------------------------------------------------------------------------- -- draw arrow local local b = self.blipSize local ex,ey = getElementPosition(player) local blipX = (3000+ex) / 6000 * mapSize local blipY = (3000-ey) / 6000 * mapSize blipX = blipX + mapPosX blipY = blipY + mapPosY if getPedOccupiedVehicle(player) and getVehicleType(getPedOccupiedVehicle(player)) == "Helicopter" then dxDrawImage(blipX-x*50/2, blipY-y*50/2, x*50, y*50, "images/H.png",north-pr) dxDrawImage(blipX-x*50/2, blipY-y*50/2, x*50, y*50, "images/HR.png",getTickCount()%360) else dxDrawImage(blipX-x*23/2, blipY-y*25/2,x*23,y*25, self.blips[2], north-pr,0,0,tocolor(255,255,255,255)) end dxSetRenderTarget() ----------------------------------------------------------------------------------------------------- -- draw render target if getElementInterior(player) == 0 then dxDrawRectangle(self.x-x*5, self.y-y*5, self.w+x*10, self.h+y*10, tocolor(0, 0, 0, 150), false) dxDrawImage(self.x, self.y, self.w, self.h, self.renderTarget,0,0,0,tocolor(unpack(self.color))) else dxDrawImage(self.x, self.y, self.w, self.h, "images/lostc.png") end ----------------------------------------------------------------------------------------------------- -- draw damage effect for k, v in ipairs(Map.damageEfect) do v[3] = v[3] - (getTickCount() - v[1]) / 800 if v[3] <= 0 then table.remove(Map.damageEfect, k) else dxDrawImage(self.x, self.y, self.w, self.h, "images/mapred.png", 0, 0, 0, tocolor(255, 255, 255, v[3])) end end --dxDrawImage(self.x-x*5, self.y-y*22, self.w+x*10, self.h+y*28, "images/mapbg.png",0,0,0,tocolor(unpack(self.color))) --local zinColor = getKeyState("=") and tocolor(255,255,255,self.color[4]) or tocolor(172,211,115,self.color[4]) --dxDrawImage(self.x+x*263, self.y-y*19,x*17,y*17, "images/zin.png",0,0,0,zinColor) --local zoutColor = getKeyState("-") and tocolor(255,255,255,self.color[4]) or tocolor(172,211,115,self.color[4]) --dxDrawImage(self.x+x*285, self.y-y*19,x*17,y*17, "images/zout.png",0,0,0,zoutColor) --dxDrawText(zoneText,self.x+x*32,self.y-y*22, x*100, y*100, tocolor(unpack(self.color)), x*0.6, font,"left","top",false,false,false,true) --dxDrawRectangle(self.x-x*5, self.y-y*5, self.w+x*10, self.h+y*10, tocolor(0, 0, 0, 150), false) local zoneText = getElementInterior(player) == 0 and "#FFFFFF"..getZoneName(playerX,playerY,playerZ) or "#FFFFFF" dxDrawRectangle(self.x, self.y+self.h-y*20, self.w, self.h/8, tocolor(0, 0, 0, 80), false) dxDrawText(" "..zoneText,self.x, self.y+self.h-y*21, x*100, y*100, tocolor(255, 255, 255, 255), x*0.6, font,"left","top",false,false,false,true) end 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 getPointAway(x, y, angle, dist) local a = -math.rad(angle) dist = dist / 57.295779513082 return x + (dist * math.deg(math.sin(a))), y + (dist * math.deg(math.cos(a))) end function getRadarFromWorldPosition(bx, by, x, y, w, h, scaledMapSize) local RadarX, RadarY = x + w/2, y + h/2 local RadarD = getDistanceBetweenPoints2D(RadarX, RadarY, x, y) local px, py = getElementPosition(localPlayer) local _, _, crz = getElementRotation(getCamera()) local dist = getDistanceBetweenPoints2D(px, py, bx, by) if dist > RadarD * 6000/scaledMapSize then dist = RadarD * 6000/scaledMapSize end local rot = 180 - findRotation(px, py, bx, by) + crz local ax, ay = getPointAway(RadarX, RadarY, rot, dist * scaledMapSize/6000) return ax, ay end function onClientPlayerDamage(attacker, weapon, _, bodypart) local part = attacker and getElementType(attacker) == "player" and getPedWeaponSlot(attacker) and getPedWeaponSlot(attacker) or false if attacker and attacker ~= source and not (part == 8 or (part == 7 and weapon ~= 38)) then Map.damageEfect[#Map.damageEfect + 1] = {getTickCount(), 0, math.min(25.5 * bodypart, 255)} else Map.damageEfect[#Map.damageEfect + 1] = {getTickCount(), 0, math.min(20 * bodypart, 255)} end if #Map.damageEfect > 18 then repeat table.remove(Map.damageEfect, 1) until #Map.damageEfect < 18 end end addEventHandler("onClientPlayerDamage", localPlayer,onClientPlayerDamage) function getWorldFromMapPosition(mapX, mapY, posx, posy, x, y, w, h, range) local worldX = posx + ((mapX*10 - (x + w / 2)) / range) / 3000 / (range/180); local worldY = posy - ((mapY*10 - (y + h / 2)) / range) / 3000 / (range/180); return worldX, worldY end
  14. trabalhar = createMarker ( 2771.0739746094,-2407.8974609375,12.627556800842 , "cylinder", 3, 255,0,0, 255) trabalho2 = createBlipAttachedTo(trabalhar, 51, 3, 255, 0, 0, 255, 0, 65535) pegarcarga = createMarker(2741.2861328125,-2422.1064453125,12.650645256042 , "cylinder", 3, 255,140,0, 255) pegarcargablip = createBlipAttachedTo(pegarcarga, 53, 3, 255, 0, 0, 255, 0, 65535) setElementVisibleTo ( pegarcargablip, root, false ) setElementVisibleTo ( pegarcarga, root, false ) levarcarga = createMarker(2804.0649414063,969.056640625,9.75 , "cylinder", 3, 255,140,0, 255) levarcargablip = createBlipAttachedTo(levarcarga, 53, 3, 255, 0, 0, 255, 0, 65535) setElementVisibleTo ( levarcargablip, root, false ) setElementVisibleTo ( levarcarga, root, false ) veh = {} function pegartrabalho (source) if isElementWithinMarker (source, trabalhar ) then if veh[source] and isElement( veh[source] ) then destroyElement(veh[source] ) veh[source] = nil end local x,y,z = getElementPosition(source) veh[source] = createVehicle(456 ,2765.3432617188,-2401.1748046875,13.6328125 + 2) ------ Id e local onde o veiculo que você usa pro trabalho cai 431 o id o resto é o local warpPedIntoVehicle (source,veh[source]) setElementVisibleTo ( pegarcarga, source, true ) setElementVisibleTo ( pegarcargablip, source, true ) outputChatBox ('#000000[#FF3030Trabalho #000000]#FF0000Vá até a bandeira para carregar seu caminhão',source,255,255,255,true) end end addEventHandler( "onMarkerHit", trabalhar ,pegartrabalho ) function pegarcargam (source) if veh[source] and isElement(veh[source]) then outputChatBox ('#000000[#FF3030Trabalho #000000]#FF0000Espere até que o caminhão esteja carregado',source,255,255,255,true) setElementFrozen( veh[source], true ) setTimer(function() setElementFrozen( veh[source], false ) outputChatBox ('#000000[#FF3030Trabalho #000000]#FF0000Vá até a bandeira para descarregar seu caminhão',source,255,255,255,true) setElementVisibleTo ( pegarcargablip, source, false ) setElementVisibleTo ( pegarcarga, source, false ) setElementVisibleTo ( levarcargablip, source, true ) setElementVisibleTo ( levarcarga, source, true ) end, 6000, 1) end end addEventHandler( "onMarkerHit", pegarcarga, pegarcargam ) function Entregarcarga (source) if veh[source] and isElement(veh[source]) then outputChatBox ('#000000[#FF3030Trabalho #000000]#FF0000Espere até que o caminhão seja descacarregado',source,255,255,255,true) setElementFrozen( veh[source], true ) setTimer(function() setElementFrozen( veh[source], false ) outputChatBox ('#000000[#FF3030Trabalho #000000]#FF0000Parabéns Vc Concluiu o Trabalho e ganhou #FF00FF5000R$',source,255,255,255,true) setElementVisibleTo ( levarcargablip, source, false ) setElementVisibleTo ( levarcarga, source, false ) givePlayerMoney (source, 6000) destroyElement (veh[source]) end, 6000, 1) end end addEventHandler( "onMarkerHit", levarcarga, Entregarcarga ) Timer = {} function sair (source) if (veh[source]) and isElement(veh[source]) then Trabalho = false outputChatBox ('#000000[#FF3030Trabalho #000000]#FF0000Volte Para O Carro em menos de 10 segundos ou vai perder o emprego',source,255,255,255,true) Timer[source] = setTimer(function() setElementVisibleTo ( pegarcargablip, source, false ) setElementVisibleTo ( pegarcarga, source, false ) setElementVisibleTo ( levarcargablip, source, false ) setElementVisibleTo ( levarcarga, source, false ) destroyElement(veh[source] ) Timer[source] = nil end, 10000, 1) end end addEventHandler ("onVehicleExit", root, sair) addEventHandler("onVehicleEnter", root, function(hit, seat) if seat == 0 and hit and veh[hit] and source == veh[hit] then Trabalho = true if Timer[hit] and isTimer(Timer[hit]) then killTimer(Timer[hit]) setElementVisibleTo ( pegarcargablip, source, true ) setElementVisibleTo ( pegarcarga, source, true ) setElementVisibleTo ( levarcargablip, source, true ) setElementVisibleTo ( levarcarga, source, true ) end end end) Notei que você alterou o valor de source na função de exit nesse caso não vejo problemas mais não aconselho que faça isso.
  15. Sim é possível use setWorldSoundEnabled