Jump to content

./BlackBird#

Members
  • Posts

    1,355
  • Joined

  • Last visited

Posts posted by ./BlackBird#

  1. Not sure if it's work perfect

    function getVehicleHeight(veh) 
     if ( isElement(veh) and getElementType(veh) == "vehicle" ) then 
     local x,y,z = getElementPosition(veh) 
     local a = 0 
      while ( not isLineOfSightClear(x,y,z+a-0.1,x,y,z+a,false,true,false,false,false) ) do 
       a = a + 0.1 
      end 
      return a 
     end 
     return false 
    end 
    

    local x,y,z = getElementPosition(vehicle) 
    local x = getVehicleHeight(veh) 
    local Height = x+z 
    

  2. function finishLoad(player, cash) 
     local cash = tostring(cash) 
      givePlayerMoney(player, tonumber(cash)) 
       setLoadCount(plr) 
    end 
    addEvent("finishRoute", true) 
    addEventHandler("finishRoute", root, finishLoad) 
    function setLoadCount(plr) 
     local playerAcc = getPlayerAccount(plr) 
     local loads = getAccountData(playerAcc, "hdt.loads") 
      if (loads) then 
       setAccountData(playerAcc, "hdt.loads", loads+1) 
       setElementData(plr, "Completed Loads", loads) 
      end 
    end 
    

  3. local textChat = textCreateDisplay ()              
    local textItem = textCreateTextItem( "", 0.5, 0.15, 2, 255,255 ,255 , 255, 3.2, "center", "Top", 255) 
    textDisplayAddText ( textChat, textItem )  
    function announceScript(player, cmd, ...) 
     local accountname = getAccountName(getPlayerAccount(player)) 
      if ( hasObjectPermissionTo ( player, "command.mute", true ) ) then 
       local playerName = getPlayerName(player):gsub("#%x%x%x%x%x%x", "") 
       local message = table.concat({...}," ") 
       textItemSetText(textItem,message) 
        for id, players in ipairs(getElementsByType("player")) do 
          textDisplayAddObserver ( textChat, players ) 
        end 
        if isTimer(timer) then killTimer(timer) end 
         timer = setTimer ( textItemSetText, 5000, 1, textItem,"" ) 
       else 
        outputChatBox(getPlayerName(player) .."#FF0000Você precisa estar logado como administrador para usar este comando!",player,255,255,255,true)       
      end 
    end 
    addCommandHandler("@@", announceScript) 
    

  4.       
        local sw,sh = guiGetScreenSize()
        local osw = sw/1280
        local osh = sh/1024
        local maxdist = 200
        local vis = 0
        local currentUse = false
        local infoTable = {{"Health",true,nil},{"Armor",true,nil},{"Weapon",true,nil},{"Vehicle",true,nil},{"Team",true,"player"}}
        local colors = {window=tocolor(0,0,200,130),windowHead=tocolor(0,0,0,180),windowHeadText=tocolor(255,0,0,255),windowText=tocolor(255,0,0,255)}
         
        --BONES--
        local lvl1bones = {[54] = 53,[53] = 52,[52] = 51,[51] = 1,[44] = 43,[43] = 42,[42] = 41,[41] = 1,[1] = 2,[2] = 3,[3] = 4,[26] = 25,[25] = 24,[24] = 23,[23] = 22,[21] = 22,
        [36] = 35,[35] = 34,[34] = 33,[33] = 32,[31] = 32,[4] = 6,[6] = 7,[7] = 4,[32] = 41,[22] = 51}
        local lvl2bones = {[5] = 32, [22] = 5, [24] = 23, [23] = 22, [32] = 33, [33] = 34, [1] = 5, [51] = 1, [41] = 1, [52] = 51, [42] = 41, [6] = 5, [53] = 52, [43] = 42}
        local lvl3bones = {[24] = 23, [23] = 5, [34] = 33, [33] = 5, [1] = 5, [52] = 1, [42] = 1, [53] = 52, [43] = 42}
        --BONES--
         
        function getType(element)
            if isElement(element) then
             return getElementType(element)
            else
             return type(element)
            end
        end
         
        function isNormalValue(value)
            if getType(value) ~= "table" then
            return false, "Argument must be 'table'"
            elseif getType(value[1]) ~= "string" or getType(value[2]) ~= "string" then
            return false, "Value should be like '{string showingName, string elementData, player/ped/nil workingElement, [{childValue1,childValue2,..}]}"
            end
            if value[4] then
                if getType(value[4]) ~= "table" then
                return false, "Child values must be 'table'"
                else
                    for i,value in ipairs(value[4]) do
                    local isNormal, debugMessage = isNormalValue(value)
                        if not isNormal then
                        return isNormal, debugMessage
                        end
                    end
                end
            end
        return true
        end
         
        function addWindowInfo(value)
        local isNormal, debugMessage = isNormalValue(value)
            if not isNormal then
            return isNormal, debugMessage
            end
        infoTable[#infoTable+1] = value
        return true
        end
         
        function removeWindowInfo(v1,v2,v3)
        if v1 then
            for i,value in ipairs(infoTable) do
                if value[1] == v1 then
                    if v2 then
                        if value[2] == v2 then
                            if v3 then
                                if value[3] == v3 then
                                table.remove(infoTable,i)
                                return true
                                end
                            else
                            table.remove(infoTable,i)
                            return true
                            end
                        end
                    else
                    table.remove(infoTable,i)
                    return true
                    end
                end
            end
        end
        return false
        end
         
        function table.ps(pl)
        local scores = {}
        local n = 0
        local win = {}
            for k,v in pairs(pl) do
            table.insert(scores,v)
            end
        table.sort(scores,function(a,b) return aend)
            for i,v in ipairs(scores) do
            n = n + 1
            local find = 0
                for e,r in pairs(pl) do
                    if r == v and find ~= 1 then
                    win[i] = e
                    find = 1
                    end
                end
            end
        return win
        end
         
        function checkTarget(tab)
        local target = table.ps(tab)[1]
            if target == getLocalPlayer() or target == nil then
            target = table.ps(tab)[2]
            end
            if target then
            drawInfoWindow(target)
            end
        end
         
        function getValue(ped,value,num)
        local ret = getElementData(ped,value[2])
        local space = " "
        if ret then
            if value[4] then
                for i,value in ipairs(value[4]) do
                ret = tostring(ret).."\n"..space:rep(num+1)..value[1]..": "..tostring(getValue(ped,value,num+1))
                end
            end
        end
        return ret
        end
         
        function getStandartValue(ped,value)
        local ret
            if value == "Health" then
            ret = math.floor(getElementHealth(ped))
            elseif value == "Armor" then
            ret = math.floor(getPedArmor(ped))
            elseif value == "Weapon" then
            local pedWeap = getPedWeapon(ped)
            ret = getWeaponNameFromID(pedWeap).." (ID: "..pedWeap..")"
            ret = ret.."\n Ammo: "..getPedTotalAmmo(ped)
            elseif value == "Vehicle" then
            local pedVeh = getPedOccupiedVehicle(ped)
            ret = "-"
                if pedVeh then
                local vModel = getElementModel(pedVeh)
                ret = getVehicleNameFromModel(vModel).." (ID: "..vModel..")\n Vehicle Health: "..math.ceil(getElementHealth(pedVeh))
                    if getVehicleOccupant(pedVeh) == ped then
                    ret = ret.."\n Seat: Driver"
                    else
                    ret = ret.."\n Seat: Passenger"
                    end
                end
            elseif value == "Team" then
            local team = getPlayerTeam(ped)
            ret = team
                if team then
                ret = getTeamName(team)
                end
            end
         return ret
        end
         
        function drawInfoWindow(ped)
        local pedType = getType(ped)
        local color2 = tocolor(205,205,205,255)
        local color3 = tocolor(50,50,50,255)
        local txt = ""
        local txtname = ""
        local alltxt = ""
            if pedType == "player" then
            txtname = getPlayerName(ped)
            else
            txtname = string.upper(pedType)
            end
         
            if getElementHealth(ped) > 0 then
            txt = math.floor(getElementHealth(ped)) .. " HP"
            else
            txt = "DEAD"
            end
        if getType(ped) == "player" then
        local plteam = getPlayerTeam(ped)
            if (plteam) then
            local tr,tg,tb = getTeamColor(plteam)
            color2 = tocolor(255-tr,255-tg,255-tb,255)
            color3 = tocolor(tr,tg,tb,255)
            else
            color2 = tocolor(0,0,0,255)
            color3 = tocolor(255,255,255,255)
            end
        end
        local x8,y8,z8 = getPedBonePosition(ped,8)
        local px8,py8 = getScreenFromWorldPosition(x8,y8,z8+0.3)
            if not px8 then
            x8,y8,z8 = getElementPosition(ped)
            px8,py8 = getScreenFromWorldPosition(x8,y8,z8)
            end
            for ind,value in ipairs(infoTable) do
            local vtxt = value[1]
                if not value[3] or value[3] == pedType then
                    if value[2] == true then
                    vtxt = vtxt..": "..tostring(getStandartValue(ped,vtxt))
                    else
                    vtxt = vtxt..": "..tostring(getValue(ped,value,0))
                    end
                    alltxt = alltxt..vtxt.."\n"
                end
            end
        alltxt = alltxt:sub(1,alltxt:len()-1)
        dxDrawText(txt,px8+1,py8-1,px8+1,py8-1,color2,1,"default-bold","center","center")
        dxDrawText(txt,px8-1,py8+1,px8-1,py8+1,color2,1,"default-bold","center","center")
        dxDrawText(txt,px8+1,py8+1,px8+1,py8+1,color2,1,"default-bold","center","center")
        dxDrawText(txt,px8-1,py8-1,px8-1,py8-1,color2,1,"default-bold","center","center")
        dxDrawText(txt,px8,py8,px8,py8,color3,1,"default-bold","center","center")
        local _,amountOfN = string.gsub(alltxt,"\n","")
        local windHeight = 35+15*(amountOfN+1)
         
        dxDrawRectangle(sw-(osh*250+16),osh*650,osh*250,osh*windHeight,colors.window)
        dxDrawRectangle(sw-(osh*250+16),osh*650,osh*250,osh*25,colors.windowHead)
        dxDrawText(txtname,sw-(osh*250+16),osh*650,sw-6,osh*675,colors.windowHeadText,1,"default-bold","center","center")
        dxDrawText(alltxt,sw-(osh*250+6),osh*680,sw-26,osh*850,colors.windowText,1 ,"default-bold","left","top",false,true)
        end
         
        function drawPedBones (ped)
        local aList = {}
            if ped ~= getLocalPlayer() then
                local x,y,z = getCameraMatrix()
                local px,py,pz = getElementPosition(ped)
                local fDistance = getDistanceBetweenPoints3D(x,y,z,px,py,pz)
                if fDistance < 40 then
                    aList = lvl1bones
                elseif fDistance < 90 and fDistance >= 40 then
                    aList = lvl2bones
                elseif fDistance < maxdist and fDistance >= 90 then
                    aList = lvl3bones
                end
                local playerTeam = nil
                    if getType(ped) == "player" then
                        playerTeam = getPlayerTeam( ped )
                    end
                local red,green,blue = 200,200,200
                    if playerTeam then
                        red,green,blue = getTeamColor ( playerTeam )
                    end
                local pedColor = tocolor(red,green,blue,255)
                for iFrom,iTo in pairs(aList) do
                    local x1,y1,z1 = getPedBonePosition(ped,iFrom)
                    local x2,y2,z2 = getPedBonePosition(ped,iTo)
                        if not (x1 or x2) then
                            return
                        end
                    local screenX1, screenY1 = getScreenFromWorldPosition ( x1,y1,z1 )
                    local screenX2, screenY2 = getScreenFromWorldPosition ( x2,y2,z2 )
                    if screenX1 and screenX2 then
                   
  5. هو زعلان ع حالتكـ المزرية ... الله يعافيكـ .

    انا سالته هو ماسالتك

    انا قايل له يرد بدالي وش دخلك فيه

    عندي اشياء اكبر من اتهاوش مع بزر

  6. لاقي زواحف كتيييييييييييييييييير

    تم نتف الجبهه مع قليلن من الحواجب :lol:

    ي دلخ يقوله لقيت اكثر من حساب اسمه زاحف

    لا تتلاقف مره ثانيه

  7.     function walking() 
             local accountName = getAccountName(getPlayerAccount(source)) 
            if accountName then 
        triggerClientEvent ("Special" , source, AccountName) 
        end 
     end -- forgot this 
        addEvent("On.tit", true) 
        addEventHandler("On.tit",root,walking) 
    

    function a() 
          guiGridListClear(grid_titles) 
          triggerServerEvent ("On.tit",localPlayer) 
    end 
    function specialTitles(accountName) 
          if accountName == "xXMADEXx" then 
            titlesTable["Pro member"] = true 
          end 
        end 
    addEvent("Special", true) 
    addEventHandler("Special", root, specialTitles) 
    

  8.     function walking() 
             local accountName = getAccountName(getPlayerAccount(source)) 
            if accountName then 
        triggerClientEvent ("Special" , source, AccountName) 
        end 
        addEvent("On.tit", true) 
        addEventHandler("On.tit",root,walking) 
    

    function a() 
          guiGridListClear(grid_titles) 
          triggerServerEvent ("On.tit",localPlayer) 
    end 
    function specialTitles(accountName) 
          if accountName == "xXMADEXx" then 
            titlesTable["Pro member"] = true 
          end 
        end 
    addEvent("Special", true) 
    addEventHandler("Special", root, specialTitles) 
    

×
×
  • Create New...