Jump to content

djharbi2

Members
  • Posts

    80
  • Joined

  • Last visited

Everything posted by djharbi2

  1. hello first, the radar on the left I have a square under my section, not on the right radar I like the radar on the right I want to get how can I do that? -------------------------------------------------------------------------------------------------- -- Distributed under the Creative Commons Attribution-NonCommercial 4.0 International license -- -- Version: (release) 1.0.0 -- -- Original author: Kacper "MrTasty (aka Addon)" Stasiak -- -- Special thanks to: Doomed_Space_Marine (useful functions) -- -- robhol (useful functions) -- -------------------------------------------------------------------------------------------------- --Features local enableBlips = true local renderNorthBlip = false local alwaysRenderMap = false --true = always render map, false = only render when in interior world 0 (radar will stay, only the map will stop rendering) local alwaysRenderOxygen = false --true = always render oxygen, false = only when oxygen not full/local player in water local disableGTASAhealth = true --Disable GTASA's HUD health display local disableGTASAarmor = true --Disable GTASA's HUD armour display local disableGTASAoxygen = true --Disable GTASA's HUD oxygen display --Dimensions & Sizes local worldW, worldH = 3072, 3072 --map image dimensions - if map image changed, please edit appropriately local blip = 11 --Blip size, pixels relative to 1366x768 resolution --Colours - Notice: Health colours smoothly according it local player's HP. local healthOkayR, healthOkayG, healthOkayB = 102, 204, 102 --RGB for health which is 'okay' (50% or more) local healthBadR, healthBadG, healthBadB = 200, 200, 0 --RGB for health which is 'bad' (25%) local healthCriticalR, healthCriticalG, healthCriticalB = 200, 0, 0 --RGB for health which is 'critically low' (near/at 0%) local armorColorR, armorColorG, armorColorB = 0, 102, 255 local oxygenColorR, oxygenColorG, oxygenColorB = 255, 255, 0 ------------------------------------------------------------------------------------ --Do not modify anything below unless you're absolutely sure of what you're doing.-- ------------------------------------------------------------------------------------ local sx, sy = guiGetScreenSize() local rt = dxCreateRenderTarget(320, 205) local xFactor, yFactor = sx/1466, sy/868 local yFactor = xFactor --otherwise the radar looses it's 2:3 ratio. -- Useful functions -- function findRotation(x1,y1,x2,y2) --Author: Doomed_Space_Marine & robhol 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) --Author: robhol 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() setPlayerHudComponentVisible("radar", false) setPlayerHudComponentVisible ( "area_name", false ) setPlayerHudComponentVisible ( "vehicle_name", false ) 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, 0xFF7CA7D1) --render background dxDrawImage(X - worldW/2, mH/5 + (Y - worldH/2), worldW, worldH, "image/world.png", camZ, (x/(6000/worldW)), -(y/(6000/worldH)), tocolor(255, 255, 255, 150)) end dxSetRenderTarget() dxDrawRectangle(10*xFactor, sy-210*yFactor, (300)*xFactor, (175)*yFactor, tocolor(0, 0, 0, 50)) dxDrawImage((10+5)*xFactor, sy-205*yFactor, (300-10)*xFactor, (165)*yFactor, rt, 0, 0, 0, tocolor(255, 255, 255, 150)) local r, g, b local col = tocolor(r, g, b, 190) local bg = tocolor(r, g, b, 100) 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("onClientResourceStop", resourceRoot, function() setPlayerHudComponentVisible("radar", true) setPlayerHudComponentVisible ( "area_name", true) setPlayerHudComponentVisible ( "vehicle_name", true) end)
  2. (localplayer) (other players) I just like myself at the top but be square in the other players I mean the player looks like the top but see other players square -------------------------------------------------------------------------------------------------- -- Distributed under the Creative Commons Attribution-NonCommercial 4.0 International license -- -- Version: (release) 1.0.0 -- -- Original author: Kacper "MrTasty (aka Addon)" Stasiak -- -- Special thanks to: Doomed_Space_Marine (useful functions) -- -- robhol (useful functions) -- -------------------------------------------------------------------------------------------------- --Features local enableBlips = true local renderNorthBlip = false local alwaysRenderMap = false --true = always render map, false = only render when in interior world 0 (radar will stay, only the map will stop rendering) local alwaysRenderOxygen = false --true = always render oxygen, false = only when oxygen not full/local player in water local disableGTASAhealth = true --Disable GTASA's HUD health display local disableGTASAarmor = true --Disable GTASA's HUD armour display local disableGTASAoxygen = true --Disable GTASA's HUD oxygen display --Dimensions & Sizes local worldW, worldH = 3072, 3072 --map image dimensions - if map image changed, please edit appropriately local blip = 11 --Blip size, pixels relative to 1366x768 resolution --Colours - Notice: Health colours smoothly according it local player's HP. local healthOkayR, healthOkayG, healthOkayB = 102, 204, 102 --RGB for health which is 'okay' (50% or more) local healthBadR, healthBadG, healthBadB = 200, 200, 0 --RGB for health which is 'bad' (25%) local healthCriticalR, healthCriticalG, healthCriticalB = 200, 0, 0 --RGB for health which is 'critically low' (near/at 0%) local armorColorR, armorColorG, armorColorB = 0, 102, 255 local oxygenColorR, oxygenColorG, oxygenColorB = 255, 255, 0 ------------------------------------------------------------------------------------ --Do not modify anything below unless you're absolutely sure of what you're doing.-- ------------------------------------------------------------------------------------ local sx, sy = guiGetScreenSize() local rt = dxCreateRenderTarget(320, 205) local xFactor, yFactor = sx/1466, sy/868 local yFactor = xFactor --otherwise the radar looses it's 2:3 ratio. -- Useful functions -- function findRotation(x1,y1,x2,y2) --Author: Doomed_Space_Marine & robhol 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) --Author: robhol 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() setPlayerHudComponentVisible("radar", false) setPlayerHudComponentVisible ( "area_name", false ) setPlayerHudComponentVisible ( "vehicle_name", false ) 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, 0xFF7CA7D1) --render background dxDrawImage(X - worldW/2, mH/5 + (Y - worldH/2), worldW, worldH, "image/world.png", camZ, (x/(6000/worldW)), -(y/(6000/worldH)), tocolor(255, 255, 255, 150)) end dxSetRenderTarget() dxDrawRectangle(10*xFactor, sy-210*yFactor, (300)*xFactor, (175)*yFactor, tocolor(0, 0, 0, 50)) dxDrawImage((10+5)*xFactor, sy-205*yFactor, (300-10)*xFactor, (165)*yFactor, rt, 0, 0, 0, tocolor(255, 255, 255, 150)) local r, g, b local col = tocolor(r, g, b, 190) local bg = tocolor(r, g, b, 100) 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("onClientResourceStop", resourceRoot, function() setPlayerHudComponentVisible("radar", true) setPlayerHudComponentVisible ( "area_name", true) setPlayerHudComponentVisible ( "vehicle_name", true) end)
  3. Client-Side addEventHandler("onClientKey",getRootElement(), function(button,press) if press then if (button == "lalt" and getKeyState("k")) or (button == "k" and getKeyState("lalt")) then triggerServerEvent("command:execute",resourceRoot,"up") elseif (button == "lalt" and getKeyState("o")) or (button == "o" and getKeyState("lalt")) then triggerServerEvent("command:execute",resourceRoot,"sit") end end end) Server-Side addEvent("command:execute",true) addEventHandler("command:execute",resourceRoot, function(position) if position=="sit" then animationCommand() elseif position=="up" then animationCommand2() end end) function animationCommand ( source ) setPedAnimation ( source, "ped", "SEAT_idle", -1, true, false, false ) end function animationCommand2 ( source ) setPedAnimation ( source ) end your bass is not working, so I did not help pls
  4. toggler = { } dtype = { } syncTimer = { } currHeadLightColor = {{ }} function isVehicleBlinking( vehicle) if currHeadLightColor[vehicle] then return true else return false end end function toggleLights( veh ) if isElement( veh ) then setVehicleOverrideLights( veh, 2 ) if toggler[veh] == 1 then setVehicleLightState( veh, 0, 1 ) setVehicleLightState( veh, 1, 1 ) setVehicleLightState( veh, 2, 1 ) setVehicleLightState( veh, 3, 1 ) if veh and isElement(veh) and (getElementType(veh) == "vehicle") and getVehicleTowedByVehicle( veh ) then local veh2 = getVehicleTowedByVehicle( veh ) setVehicleLightState( veh2, 0, 1 ) setVehicleLightState( veh2, 1, 1 ) setVehicleLightState( veh2, 2, 1 ) setVehicleLightState( veh2, 3, 1 ) end toggler[veh] = 0 else if dtype[veh] == "left" then setVehicleLightState( veh, 0, 0 ) setVehicleLightState( veh, 1, 1 ) setVehicleLightState( veh, 2, 1 ) setVehicleLightState( veh, 3, 0 ) if veh and isElement(veh) and (getElementType(veh) == "vehicle") and getVehicleTowedByVehicle( veh ) then local veh2 = getVehicleTowedByVehicle( veh ) setVehicleLightState( veh2, 0, 0 ) setVehicleLightState( veh2, 1, 1 ) setVehicleLightState( veh2, 2, 1 ) setVehicleLightState( veh2, 3, 0 ) end elseif dtype[veh] == "right" then setVehicleLightState( veh, 0, 1 ) setVehicleLightState( veh, 1, 0 ) setVehicleLightState( veh, 2, 0 ) setVehicleLightState( veh, 3, 1 ) if (getElementType(veh) == "vehicle") and getVehicleTowedByVehicle( veh ) then local veh2 = getVehicleTowedByVehicle( veh ) setVehicleLightState( veh2, 0, 1 ) setVehicleLightState( veh2, 1, 0 ) setVehicleLightState( veh2, 2, 0 ) setVehicleLightState( veh2, 3, 1 ) end elseif (getElementType(veh) == "vehicle") and dtype[veh] == "all" then setVehicleLightState( veh, 0, 0 ) setVehicleLightState( veh, 1, 0 ) setVehicleLightState( veh, 2, 0 ) setVehicleLightState( veh, 3, 0 ) if veh and isElement(veh) and (getElementType(veh) == "vehicle") and getVehicleTowedByVehicle( veh ) then local veh2 = getVehicleTowedByVehicle( veh ) setVehicleLightState( veh2, 0, 0 ) setVehicleLightState( veh2, 1, 0 ) setVehicleLightState( veh2, 2, 0 ) setVehicleLightState( veh2, 3, 0 ) end end toggler[veh] = 1 end end end function lightHandler( player, cmd ) if player and isElement( player ) and getPedOccupiedVehicle( player ) then local veh = getPedOccupiedVehicle( player ) if ( not isTimer( syncTimer[veh] ) or cmd ~= dtype[veh] ) and getVehicleOccupants(veh)[0] == player then setVehicleLightState( veh, 0, 1 ) setVehicleLightState( veh, 1, 1 ) setVehicleLightState( veh, 2, 1 ) setVehicleLightState( veh, 3, 1 ) if veh and isElement(veh) and (getElementType(veh) == "vehicle") and getVehicleTowedByVehicle( veh ) then local veh2 = getVehicleTowedByVehicle( veh ) setVehicleLightState( veh2, 0, 1 ) setVehicleLightState( veh2, 1, 1 ) setVehicleLightState( veh2, 2, 1 ) setVehicleLightState( veh2, 3, 1 ) end if not currHeadLightColor[veh] then currHeadLightColor[veh] = { } currHeadLightColor[veh][1],currHeadLightColor[veh][2],currHeadLightColor[veh][3] = getVehicleHeadLightColor( veh ) end setVehicleHeadLightColor( veh, 255, 200, 0 ) if isTimer( syncTimer[veh] ) then killTimer( syncTimer[veh] ) setVehicleHeadLightColor(veh, currHeadLightColor[veh][1],currHeadLightColor[veh][2],currHeadLightColor[veh][3]) end syncTimer[veh] = setTimer( toggleLights, 380, 0, veh ) toggler[veh] = 1 dtype[veh] = cmd toggleLights( veh ) else if isTimer( syncTimer[veh] ) then killTimer( syncTimer[veh] ) local vehID = getElementData( veh, "vehicleID") if vehID then local vehID = tonumber( vehID) local colorTable = exports.GTIvehicles:getVehicleData( vehID, "light_color") or "255,255,255" local cData = split( colorTable, ",") setVehicleHeadLightColor( veh, cData[1], cData[2], cData[3]) currHeadLightColor[veh] = nil else setVehicleHeadLightColor( veh, 255, 255, 255) end end setVehicleLightState( veh, 0, 0 ) setVehicleLightState( veh, 1, 0 ) setVehicleLightState( veh, 2, 0 ) setVehicleLightState( veh, 3, 0 ) setVehicleOverrideLights( veh, 2 ) if veh and isElement(veh) and (getElementType(veh) == "vehicle") and getVehicleTowedByVehicle( veh ) then local veh2 = getVehicleTowedByVehicle( veh ) setVehicleLightState( veh2, 0, 0 ) setVehicleLightState( veh2, 1, 0 ) setVehicleLightState( veh2, 2, 0 ) setVehicleLightState( veh2, 3, 0 ) setVehicleOverrideLights( veh2, 2 ) end end end end addCommandHandler( "left", lightHandler ) addCommandHandler( "right", lightHandler ) addCommandHandler( "all", lightHandler ) Hi I want to do this code with bind left = shift + a right = shift + d all = shift + s If you like help please like me
  5. local players = getElementsByType("player") for key, value in ipairs(players) do local username = string.lower(tostring(getAccountName(value))) if (string.find(username, string.lower(tostring(guiGetText(theEditBox))))) and (guiGetText(theEditBox)~="") then count = count + 1 found = value foundstr = getAccountName(found) foundid = getElementData(found, "dbid") end end my goal is to pull the players' accounts and have them checked but here get Account Name does not mean
  6. guiGridListSetItemText (moneysend,row,col,(string.gsub ( getPlayerName(player), '#%x%x%x%x%x%x', '' ) or getPlayerName(player)), false, false) guiGridListSetItemData (moneysend,row,col, getPlayerName(player)) playerName = guiGridListGetItemData(moneysend, row, col) player = getPlayerFromName(playerName) if isElement(player) then I added the above code with hex code but I want it to come with hex code when I shoot below
  7. https://community.multitheftauto.com/index.php?p=resources&s=details&id=10158 DELETE PLS DENIED, it's not in the interest of community users to delete this particular resource
  8. https://community.multitheftauto.com/index.php?p=resources&s=details&id=10063 https://community.multitheftauto.com/index.php?p=resources&s=details&id=12166 https://community.multitheftauto.com/index.php?p=resources&s=details&id=10064 DELETE PLS DONE
  9. how to send data to a web site, how to transfer the result to the client This site I want to do the sound thing in short
  10. how can i convert mp3 file to youtube https://community.multitheftauto.com/index.php?p=resources&s=details&id=10065 this is not working at the moment
  11. butona setting the handling settings of the vehicle to zero
  12. bring original tool handling? if theMode == "hand1" then modelID = getElementModel ( theVehicle ) HandlingReset = getOriginalHandling ( modelID ) end I did it, but it did not
  13. hi i want to remove the jetpack effects and all other smoke like effects complex
  14. addEventHandler("onClientGUIClick", root, function() if guiCheckBoxGetSelected(noti) then elseif not guiCheckBoxGetSelected(noti) then end end) Click on chechbox to block posts? server-side if triggerClientEvent(player, "messagesend", root, client, message) then outputChatBox("message send", player, 255, 168, 0, true) outputChatBox("message has arrived", client, 255, 168, 0, true) end
  15. Thank You a look at this https://forum.multitheftauto.com/viewtopic.php?f=91&t=102059
  16. This is dvoe_s.lua:5 Error. -- 1 seg = 1000 local tiempoparadesaparecer = 5000 -- Function function desaparecer() setTimer(destroyElement, tiempoparadesaparecer, 1, source) end -- Event addEventHandler("onVehicleExplode", getRootElement(), desaparecer)
  17. What ? I do not know whether to give me
×
×
  • Create New...