Passing a variable by reference using SetTimerEx
#2

PHP код:
new TEST = 5;
forward decrease();
public 
decrease()
{
    
TEST--;
    
printf("%i", TEST);
    return 
1;
}
public 
OnGameModeInit()
{
    
SetTimer("decrease", 1000, true);
    return 
1;
} 
Is this what you want to do? I might misunderstood.

Edit:
Or maybe like this:
PHP код:
new TEST = 5;
forward decrease(amount);
public 
decrease(amount)
{
    
TEST -= amount;
    
printf("%i", TEST);
    return 
1;
}
public 
OnGameModeInit()
{
    new 
amount = 1;
    
SetTimerEx("decrease", 1000, true, "i", amount);
    return 
1;
} 
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)