AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Count Down Timer (https://forums.alliedmods.net/showthread.php?t=101737)

BigMac 08-26-2009 15:34

Count Down Timer
 
This is part of a plugin where a person has 30 seconds to choose there weapon in the beginning of the round. But I can NOT seem to get the timer to work PLEASE HELP...
:)



PHP Code:

ShowGunsVoteMenu(id) {
    new 
menu[256];
    new 
bool:prev = (g_guns_vote_menu[id] >= 1);
    new 
bool:next = ((g_guns_vote_menu[id] * 7) < g_guns_count);
    new 
len 0;
    new 
keys 0;
    

    
len += formatex(menu[len], charsmax(menu), "\yVote for a gun \w[\r%s\w]^n^n"g_new_fileiTimer);
    for(new 
0; (7) && ((g_guns_vote_menu[id] * i) < g_guns_count); i++) {
        
len += formatex(menu[len], charsmax(menu), "\r%d. \w%s^n", (1), g_guns_names[g_guns_vote_menu[id] * i]);
        
keys |= (<< i);
    }
    
len += formatex(menu[len], charsmax(menu), "^n\r8. %sPrevious^n"prev "\w" "\d");
    
keys |= (prev B8 0);
    
len += formatex(menu[len], charsmax(menu), "\r9. %sNext^n^n"next "\w" "\d");
    
keys |= (next B9 0);
    
len += formatex(menu[len], charsmax(menu), "\r0. \wNone^n");
    
keys |= B0;
    
    
    
show_menu(idkeysmenu, -1"GunGunsVoteMenu");
}
public 
task_Timer(iTimer[])
{
    if(
iTimer[0] > || iTimer[1] > 0)
    {
        if(
iTimer[0] == 0)
        {
            
iTimer[1]--;
            
iTimer[0] = 29;
        }
        else
        {
            
iTimer[0]--;
        }
        
    }

}

iTimer()
{
    new 
iTimer[2];
    
iTimer[0] = (iTotal 30);
    
iTimer[1] = (iTotal iTimer[0]) / 30;
    
task_Timer(iTimer);



hleV 08-27-2009 03:31

Re: Count Down Timer
 
You have function (iTimer()) and variable (iTimer[]) with the same name. Fix this.


All times are GMT -4. The time now is 15:03.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.