Jump to content

help


golanu21

Recommended Posts

Posted
function greetingHandler ( ) 
    guiProgressBarSetProgress ( progressBar, ( guiProgressBarGetProgress ( progressBar ) + 50 ) ) 
    local mu = guiProgressBarGetProgress (progressBar) 
    if mu >= 100 then 
    guiSetText(nivlab, "1") 
    guiProgressBarSetProgress(progressBar, 0) 
    if mu >= 100 *2 then 
    guiSetText(nivlab, "2") 
end 
end 
end 
addEvent ( "gret", true ) 
addEventHandler ( "gret", getRootElement(), greetingHandler ) 

how i make when progressBar, has ben 100% 2 times the text to be 2

Posted

I never used progressbar, but here try this :

function greetingHandler ( ) 
    guiProgressBarSetProgress ( progressBar, ( guiProgressBarGetProgress ( progressBar ) + 50 ) ) 
    local mu = guiProgressBarGetProgress (progressBar) 
    if mu >= 100 then 
    guiSetText(nivlab, "1") 
    guiProgressBarSetProgress(progressBar, 0) 
    if mu >= 200 then 
    guiSetText(nivlab, "2") 
end 
end 
end 
addEvent ( "gret", true ) 
addEventHandler ( "gret", getRootElement(), greetingHandler ) 

Posted

@golanu21,

DO NOT DOUBLE POST, PLEASE.

Define a variable that will hold how many times the progress bar reached 100%. Check if the progress bar reached 100% (which you do at line 4), then add 1 to the variable and set the text of nivlab to whatever the variable holds.

Posted
@golanu21,

DO NOT DOUBLE POST, PLEASE.

sorry for that..

Define a variable that will hold how many times the progress bar reached 100%. Check if the progress bar reached 100% (which you do at line 4), then add 1 to the variable and set the text of nivlab to whatever the variable holds.

how i make that ?, please tell me because i am begginer and i don't know how :D

Posted

Define a variable at the start of script like

howManyProgressBarReached100 = 0 

Then check it's value and if it's 1 then it means that the progressbar reached 100% one time. You have to increase that counter whenever your function ends working.

Posted

ERROR: Infinite/too long execution (coie) 

function greetingHandler ( ) 
Reached100 = 0  
guiProgressBarSetProgress ( progressBar, ( guiProgressBarGetProgress ( progressBar ) + 50 ) ) 
local mu = guiProgressBarGetProgress (progressBar) 
        while mu >= 100 do 
            local Reached100 = Reached100 +1 
            print(Reached100) 
                if Reached100 == 1 then 
                    guiProgressBarGetProgress(progressBar, 0) 
                    guiSetText(nivlab, "1") 
  
                end 
            end 
        end 
addEvent ( "gret", true ) 
addEventHandler ( "gret", getRootElement(), greetingHandler ) 

Posted

@golanu,

nobody asked you to do a "while loop". Your old code was more or less correct, you just need a global variable. Replace the "while" with "if". Line 6, there is no need for "local".

@Alen141,

Do not post the code that will not work. Your code will bring up a syntax error (line 6). Even if you fix that, at line 3 the variable will be 0 every time the greetingHandler function will be called.

Posted
function greetingHandler ( ) 
Reached100 = 0 
guiProgressBarSetProgress ( progressBar, ( guiProgressBarGetProgress ( progressBar ) + 50 ) ) 
local mu = guiProgressBarGetProgress (progressBar) 
        if mu >= 100 then 
        guiProgressBarSetProgress(progressBar, 0) 
            Reached100 = Reached100 +1 
            print(Reached100) 
                if Reached100 == 1 then 
                    guiSetText(nivlab, "1") 
                        if Reached100 == 2 then 
                            guiSetText(nivlab, "2") 
                    end 
                end 
            end 
        end 
addEvent ( "gret", true ) 
addEventHandler ( "gret", getRootElement(), greetingHandler ) 

don't work, Text "1" appear but when ProgressBar reach again 100% do nothing..

Posted
hi man,how i make the account-system on valhalla ?to register in game ?

Interesting how he sent me a PM about helping him with valhalla.

there is not valhalla script , for what i need in valhalla exp_system man ?...:| i make my own gamemode ok .. there is a PRIVATE MESAJE not a PUBLIC MESSAGE (kid)

Posted

i am not say you lying , i just say that sentence in PRIVATE MEASSGE not in PUBLIC MESAGE, for what you make it public?

Don't worry i am not angry for you .... what i want to creeate in this moment has nothing to do with scripts of valhalla ok ?...

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