Jump to content

I have a small bug and i can't find the reason please help!


Recommended Posts

Hello guys,

When i press f7 you enter in the userpanel well i tried to make dxDrawings (retangle, and bar,) but when i press f7 they only pop up 1 second and then dissapear. ( the panel stays )

Please help me.

The script

bindKey("F7", "down", 
    function() 
        if acc[player] == 1 then 
            if not guiGetVisible(UserP) then 
                guiSetVisible(UserP, true) 
                guiSetVisible(Stats, true) 
                guiSetVisible(StatsTab, true) 
                ------- This Just Draws 1 second 
                dxDrawRectangle(0, 0, ScreenX-SizeDraw, ScreenY-LenghtY*2, tocolor(0,0,0,100), false) 
                ------- This Also 
                dxDrawRectangle(ScreenX-SizeDraw, LenghtY*4, ScreenX, ScreenY-LenghtY*6, tocolor(0,0,0,100), false) 
                ------- This Also 
                dxDrawImage(0, ScreenY-LenghtY, ScreenX, LenghtY, "files/bar.png",0,0,0,tocolor(255,255,255,255), true ) 
                guiSetInputEnabled(true) 
                showCursor(true) 
                guiSetSelectedTab(Stats, StatsTab) 
                guiSetText(StatsText, removeColorCodingEx(getPlayerName(player)).. " his/her stats:") 
                if PPlayed[player] then 
                    guiSetText(PMaps, "You played " ..tostring(PPlayed[player]).. " maps.") 
                end 
                if PWins[player] then 
                    guiSetText(Wins, "You won " ..tostring(PWins[player]).. " times.") 
                end 
                if PWins[player] then 
                    guiSetText(Ratio, "Your Ratio is: "..tostring(math.floor(PWins[player]/PPlayed[player]*100)).. "%") 
                end 
                if PDeaths[player] then 
                    guiSetText(Deaths, "You died "..tostring(PDeaths[player]).. " times.") 
                end 
                guiSetText(Visits, "You visited the server "..tostring(PVisits[player]).." times.") 
                guiSetText(Money, "You have $"..tostring(getPlayerMoney(getLocalPlayer()))..".") 
                -- Flip 
                if TotalFlips[player] then 
                    guiSetText(TFlips, "You flipped: "..tostring(TotalFlips[player]).." times.") 
                end 
                if WonFlip[player] then 
                    guiSetText(WFlips, "You won: "..tostring(WonFlip[player]).." times.") 
                end 
                if WonFlip[player] then 
                    guiSetText(FRatio, "Your ratio is: "..tostring(WonFlip[player]/TotalFlips[player]*100).. "%") 
                end 
                if SpenMoneyFlip[player] then 
                    guiSetText(SMoneyFlips, "You spended $"..tostring(SpenMoneyFlip[player]).." on flipping.") 
                end 
                if WonMoneyFlip[player] then 
                    guiSetText(WMoneyFlips, "You won $"..tostring(WonMoneyFlip[player]).." with flipping.") 
                end 
                -- Roll 
                if TotalRolls[player] then 
                    guiSetText(TRolls, "You rolled: "..tostring(TotalRolls[player]).." times.") 
                end 
                if WonRoll[player] then 
                    guiSetText(WRolls, "You won: "..tostring(WonRoll[player]).." times.") 
                end 
                if WonRoll[player] then 
                    guiSetText(RRatio, "Your ratio is: "..tostring(WonRoll[player]/TotalRolls[player]*100).."%") 
                end 
                if SpenMoneyRoll[player] then 
                    guiSetText(SMoneyRolls, "You spended  $"..tostring(SpenMoneyRoll[player]).." on rolling.") 
                end 
                if WonMoneyRoll[player] then 
                    guiSetText(WMoneyRolls, "You won $"..tostring(WonMoneyRoll[player]).." with rolling.") 
                end 
                -- Spin 
                if TotalSpins[player] then 
                    guiSetText(TSpins, "You spinned: "..tostring(TotalSpins[player]).." times.") 
                end 
                if WonSpin[player] then 
                    guiSetText(WSpins, "You won: "..tostring(WonSpins[player]).." times.") 
                end 
                if WonSpin[player] then 
                    guiSetText(SRatio, "Your ratio is: "..tostring(WonSpin[player]/TotalSpins[player]*100).."%") 
                end 
                if SpenMoneySpin[player] then 
                    guiSetText(SMoneySpins, "You spended $"..tostring(SpenMoneySpin[player]).." on spinning.") 
                end 
                if WonMoneySpin[player] then 
                    guiSetText(WMoneySpins, "You won $"..tostring(WonMoneySpin[player]).." with spinning.") 
                end 
            else 
                guiSetVisible(UserP, false) 
                guiSetVisible(Stats, false) 
                guiSetVisible(StatsTab, false) 
                guiSetVisible(ShopTab, false) 
                guiSetInputEnabled(false) 
                showCursor(false) 
            end 
        else 
            outputChatBox("You must be #fffffflogged in #0000FFto use your userpanel!", 0, 0, 255,true) 
        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...