Jump to content

Need help


Dimos7

Recommended Posts

Kills = {} 
Deaths = {} 
Headshot = {} 
Money = {} 
Playtime = {} 
  
exports.scoreboard:scoreboardAddColumn("Kills", 20, root, "Kills", 3) 
exports.scoreboard:scoreboardAddColumn("Deaths", 20, root, "Deaths", 4) 
exports.scoreboard:scoreboardAddColumn("Headshot", 20, root, "Headshot", 5) 
exports.scoreboard:scoreboardAddColumn("Money", 20, root, "Money", 6) 
exports.scoreboard:scoreboardAddColumn("Playtime", 20, root, "Playtime", 9) 
  
  
addEventHandler("onPlayerLogin", root, 
function() 
    local time = getRealTime() 
    local hours = time.hour 
    local minutes = time.minute 
    for i = 0, pairs (Kills) do 
        if not Kills[i] then 
            Kills[i] = source 
            setElementData(source, "Kills", i) 
            break; 
        end 
    end 
    for i = 0 , pairs (Deaths) do 
        if not Deaths[i] then 
           Deaths[i] = source 
           setElementData(source, "Deaths", i) 
           break; 
        end 
    end 
    for i = 0 , pairs (Headshot) do 
        if not Headshot[i] then 
           Headshot[i] = source 
           setElementData(source, "Headshot", i) 
           break; 
        end 
    end 
    for i = 0, pairs (Money) do 
        if not Money[i] then 
            Money[i] = source 
            setElementData(source, "Money", i) 
            break; 
        end 
    end 
    for i = getRealTime(), getTickCount()   do 
        if not Playtime[i] then 
           Playtime[i] = source 
           setElementData(source, "Playtime", i) 
           break; 
        end 
    end 
end) 
  
addEventHandler("onResourceStart", resourceRoot, 
function() 
    local time = getRealTime() 
    local hours = time.hour 
    local minutes = time.minute 
    for _, v in ipairs(getElementsByType("player")) do 
        for i = 0, pairs (Kills) do 
            if not Kills[i] then 
                Kills[i] = v 
                setElementData(v, "Kills", i) 
                break; 
            end 
        end 
        for i = 0, pairs (Deaths) do 
            if not Deaths[i] then 
                Deaths[i] = v 
                setElementData(v, "Deaths", i) 
                break; 
            end 
        end 
        for i = 0, pairs (Headshot) do 
            if not Headshot[i] then 
                Headshot[i] = v 
                setElementData(v, "Headshot", i) 
                break; 
            end 
        end 
        for i = 0, pairs (Money) do 
            if not Money[i] then 
               Money[i] = v 
               setElementData(v, "Money", i) 
               break; 
            end 
        end 
        for i = getRealTime() , getTickCount() do 
            if not Playtime[i] then 
               Playtime[i] = v 
               setElementData(v, "Playtime", i) 
               break; 
            end 
        end 
    end 
end) 
  
function setPlayerStatus(attacker, weapon, bodypart) 
    if attacker then 
       if (getElementType(attacker) == "player") then 
           killPed(source, attacker, weapon) 
           setElementData(attacker, "Kills", Kills + 1) 
           setElementData(source, "Deaths", Deaths + 1) 
       end 
       if bodypart == 9 then 
          killPed(source, attacker, weapon, bodypart) 
          setElementData(attacker, "Headshot", Headshot + 1) 
       end 
    end 
end 
addEventHandler("onPlayerWasted", root, setPlayerStatus) 
  
  
function getPlayerStatus(player) 
    if isElement(player) and getElementType(player) == "player"  and getElementData(player, "Kills") and getElementData(player, "Deaths") and getElementData(player, "Headshot") and getElementData(player, "Money") and getElementData(player, "Playtime") then 
       return getElementData(player, "Kills"), getElementData(player, "Deaths"), getElementData(player, "Headshot"), getElementData(player, "Money"), getElementData(player, "Playtime") 
    end 
end 

lne 62 for need limt numbe

Link to comment
Kills = {} 
Deaths = {} 
Headshot = {} 
Money = {} 
Playtime = {} 
  
exports.scoreboard:scoreboardAddColumn("Kills", 20, root, "Kills", 3) 
exports.scoreboard:scoreboardAddColumn("Deaths", 20, root, "Deaths", 4) 
exports.scoreboard:scoreboardAddColumn("Headshot", 20, root, "Headshot", 5) 
exports.scoreboard:scoreboardAddColumn("Money", 20, root, "Money", 6) 
exports.scoreboard:scoreboardAddColumn("Playtime", 20, root, "Playtime", 9) 
  
  
addEventHandler("onPlayerLogin", root, 
function() 
    local time = getRealTime() 
    local hours = time.hour 
    local minutes = time.minute 
    for i = 0, pairs (Kills) do 
        if not Kills[i] then 
            Kills[i] = source 
            setElementData(source, "Kills", i) 
            break; 
        end 
    end 
    for i = 0 , pairs (Deaths) do 
        if not Deaths[i] then 
           Deaths[i] = source 
           setElementData(source, "Deaths", i) 
           break; 
        end 
    end 
    for i = 0 , pairs (Headshot) do 
        if not Headshot[i] then 
           Headshot[i] = source 
           setElementData(source, "Headshot", i) 
           break; 
        end 
    end 
    for i = 0, pairs (Money) do 
        if not Money[i] then 
            Money[i] = source 
            setElementData(source, "Money", i) 
            break; 
        end 
    end 
    for i = getRealTime(), getTickCount()   do 
        if not Playtime[i] then 
           Playtime[i] = source 
           setElementData(source, "Playtime", i) 
           break; 
        end 
    end 
end) 
  
addEventHandler("onResourceStart", resourceRoot, 
function() 
    local time = getRealTime() 
    local hours = time.hour 
    local minutes = time.minute 
    for _, v in ipairs(getElementsByType("player")) do 
        for i = 0, #Kills do 
            if not Kills[i] then 
                Kills[i] = v 
                setElementData(v, "Kills", i) 
                break; 
            end 
        end 
        for i = 0, #Deaths do 
            if not Deaths[i] then 
                Deaths[i] = v 
                setElementData(v, "Deaths", i) 
                break; 
            end 
        end 
        for i = 0, #Headshot do 
            if not Headshot[i] then 
                Headshot[i] = v 
                setElementData(v, "Headshot", i) 
                break; 
            end 
        end 
        for i = 0, #Money do 
            if not Money[i] then 
               Money[i] = v 
               setElementData(v, "Money", i) 
               break; 
            end 
        end 
        for i = getRealTime() , getTickCount() do 
            if not Playtime[i] then 
               Playtime[i] = v 
               setElementData(v, "Playtime", i) 
               break; 
            end 
        end 
    end 
end) 
  
function setPlayerStatus(attacker, weapon, bodypart) 
    if attacker then 
       if (getElementType(attacker) == "player") then 
           killPed(source, attacker, weapon) 
           setElementData(attacker, "Kills", Kills + 1) 
           setElementData(source, "Deaths", Deaths + 1) 
       end 
       if bodypart == 9 then 
          killPed(source, attacker, weapon, bodypart) 
          setElementData(attacker, "Headshot", Headshot + 1) 
       end 
    end 
end 
addEventHandler("onPlayerWasted", root, setPlayerStatus) 
  
  
function getPlayerStatus(player) 
    if isElement(player) and getElementType(player) == "player"  and getElementData(player, "Kills") and getElementData(player, "Deaths") and getElementData(player, "Headshot") and getElementData(player, "Money") and getElementData(player, "Playtime") then 
       return getElementData(player, "Kills"), getElementData(player, "Deaths"), getElementData(player, "Headshot"), getElementData(player, "Money"), getElementData(player, "Playtime") 
    end 
end 

error line 90 initial value must be a number

Link to comment
Kills = {} 
Deaths = {} 
Headshot = {} 
Money = {} 
Playtime = {} 
  
exports.scoreboard:scoreboardAddColumn("Kills", 20, root, "Kills", 3) 
exports.scoreboard:scoreboardAddColumn("Deaths", 20, root, "Deaths", 4) 
exports.scoreboard:scoreboardAddColumn("Headshot", 20, root, "Headshot", 5) 
exports.scoreboard:scoreboardAddColumn("Money", 20, root, "Money", 6) 
exports.scoreboard:scoreboardAddColumn("Playtime", 20, root, "Playtime", 9) 
  
  
addEventHandler("onPlayerLogin", root, 
function() 
    local time = getRealTime() 
    local hours = time.hour 
    local minutes = time.minute 
    for i = 0, pairs (Kills) do 
        if not Kills[i] then 
            Kills[i] = source 
            setElementData(source, "Kills", i) 
            break; 
        end 
    end 
    for i = 0 , pairs (Deaths) do 
        if not Deaths[i] then 
           Deaths[i] = source 
           setElementData(source, "Deaths", i) 
           break; 
        end 
    end 
    for i = 0 , pairs (Headshot) do 
        if not Headshot[i] then 
           Headshot[i] = source 
           setElementData(source, "Headshot", i) 
           break; 
        end 
    end 
    for i = 0, pairs (Money) do 
        if not Money[i] then 
            Money[i] = source 
            setElementData(source, "Money", i) 
            break; 
        end 
    end 
    for i = hours and minutes, getTickCount() do 
        if not Playtime[i] then 
           Playtime[i] = source 
           setElementData(source, "Playtime", i) 
           break; 
        end 
    end 
end) 
  
addEventHandler("onResourceStart", resourceRoot, 
function() 
    local time = getRealTime() 
    local hours = time.hour 
    local minutes = time.minute 
    for _, v in ipairs(getElementsByType("player")) do 
        for i = 0, #Kills do 
            if not Kills[i] then 
                Kills[i] = v 
                setElementData(v, "Kills", i) 
                break; 
            end 
        end 
        for i = 0, #Deaths do 
            if not Deaths[i] then 
                Deaths[i] = v 
                setElementData(v, "Deaths", i) 
                break; 
            end 
        end 
        for i = 0, #Headshot do 
            if not Headshot[i] then 
                Headshot[i] = v 
                setElementData(v, "Headshot", i) 
                break; 
            end 
        end 
        for i = 0, #Money do 
            if not Money[i] then 
               Money[i] = v 
               setElementData(v, "Money", i) 
               break; 
            end 
        end 
        for i = hours and minutes ,  getTickCount() do 
            if not Playtime[i] then 
               Playtime[i] = v 
               setElementData(v, "Playtime", i) 
               break; 
            end 
        end 
    end 
end) 
  
function setPlayerStatus(attacker, weapon, bodypart) 
    if attacker then 
       if (getElementType(attacker) == "player") then 
           killPed(source, attacker, weapon) 
           setElementData(attacker, "Kills", tonumber(Kills + 1)) 
           setElementData(source, "Deaths", tonumber(Deaths + 1)) 
       end 
       if bodypart == 9 then 
          killPed(source, attacker, weapon, bodypart) 
          setElementData(attacker, "Headshot", tonumber(Headshot + 1)) 
       end 
    end 
    setElementData(source, "Deaths", tonumber(Deaths + 1)) 
end 
addEventHandler("onPlayerWasted", root, setPlayerStatus) 
  
  
function getPlayerStatus(player) 
    if isElement(player) and getElementType(player) == "player"  and getElementData(player, "Kills") and getElementData(player, "Deaths") and getElementData(player, "Headshot") and getElementData(player, "Money") and getElementData(player, "Playtime") then 
       return getElementData(player, "Kills"), getElementData(player, "Deaths"), getElementData(player, "Headshot"), getElementData(player, "Money"), getElementData(player, "Playtime") 
    end 
end  

http://imgur.com/xb7v8O4 i want be like this 00:00 in start and after change

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...