Jump to content

[Help] Watch Players Teams In Sr


Recommended Posts

Hey People I wanted to help my script I got put to see people who are in Sr within the market but and everything but I wanted to was to see people who are spawn in criminal and also to see how many who are spawn in police to see how many so it also if can help me would greatly and was so for example :

Player In Rob :

5 Crimians Vs Cops 2

robberTeams = { ["Criminals"] = true,["Liberation Organisation"] = true,["The Devils Of Darkness"] = true, ["Official Gangs"] = true, ["Admin"] = true} 
robberTeams2 = { ["Criminals"] = true,["Liberation Organisation"] = true,["The Devils Of Darkness"] = true, ["Official Gangs"] = true, ["Admin"] = true} 
resX, resY = guiGetScreenSize() 
resX2 = resX*(1/3) 
  
function startHRDisplay(hrthing) 
    if hrthing and tonumber(getElementData(hrthing, "percent")) then 
        houserobMarker = hrthing 
        addEventHandler("onClientRender", root, displayHR) 
    end 
end 
  
function stopHRDisplay() 
    houserobMarker = false 
    removeEventHandler("onClientRender", root, displayHR) 
end 
  
local width,height = guiGetScreenSize() 
addEventHandler("onClientRender", getRootElement(), function() 
    if houserob == 1 then 
        if isElement(houserobMarker) and isElementWithinMarker(getLocalPlayer(), houserobMarker) then 
            local percent = getElementData(houserobMarker, "percent") 
            dxDrawRectangle(10,(height/2)-10, 200, 20, tocolor(255,255,255,255)) 
            dxDrawRectangle(10,(height/2)-10, percent*2, 20, tocolor(255,100,100,255)) 
            local text = "Houserob done: "..percent.." %" 
            local textwidth = dxGetTextWidth(text, 0.6, "bankgothic") 
            dxDrawText(text,10,(height/2)-40, textwidth, 20,tocolor(255,255,255,255),0.6,"bankgothic" ) 
            local checkk = getPlayersInMarker(houserobMarker) 
            dxDrawText("Player In Rob: '" .. checkk .. "'",resX2-450,300,resX2*2.7,600,tocolor(255,255,255,255),0.8,"bankgothic","left","center",true,true,false) 
        else 
            houserob = nil 
            houserobMarker = nil 
        end 
    end 
end) 
function getPlayersInMarker(houserobMarker) 
    local players = 0 
    if houserobMarker and getElementType(houserobMarker) == "marker" then 
        for i,player in ipairs(getElementsByType("player")) do 
            if isElementWithinMarker(player,houserobMarker) then 
                players = players + 1 
            end 
         end 
    end 
    return players 
end 
  
addEventHandler("onClientPlayerWasted", getLocalPlayer(), function() 
    houserob = nil 
    hideALL() 
end) 
  
addEvent("showProcess", true) 
addEventHandler("showProcess", getRootElement(), function(robber, housemarker) 
    if robber == getLocalPlayer() then 
        houserob = 1 
        houserobMarker = housemarker 
    end 
end) 
  
addEvent("hideProcess", true) 
addEventHandler("hideProcess", getRootElement(), function(robber) 
    if robber == getLocalPlayer() then 
        houserob = nil 
        houserobMarker = nil 
    end 
end) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...