help with randoms
#6

i change it a little, and it works great except that it seems to ignore the <= -19

know how to fix?

pawn Code:
#include <a_samp>

new StockPrice = 100;
new currand;
new StockTimer;
forward StockIncreaser();
forward StockChecker();
pawn Code:
public OnGameModeInit()
{
    StockTimer=SetTimer("StockIncreaser",5000,true);
    SetTimer("StockChecker",5000,true);
    return 1;
}
pawn Code:
public StockIncreaser()
{
    if (currand <= -19)
    {
        currand = StockPrice-random(500);
    }
    currand = random(100-(-25)+1)+(-25);
    StockPrice = StockPrice+currand;
    printf("Stock Price: $%d",StockPrice);
    return 1;
}
pawn Code:
public StockChecker()
{
    if(StockPrice <=0)
    {
    KillTimer(StockTimer);
    StockPrice = 50;
    SetTimer("StockIncreaser",5000,true);
    currand = 1;
    }
}
Reply


Messages In This Thread
help with randoms - by happyface - 19.06.2009, 21:15
Re: help with randoms - by Weirdosport - 19.06.2009, 22:17
Re: help with randoms - by dice7 - 19.06.2009, 22:20
Re: help with randoms - by Weirdosport - 19.06.2009, 22:32
Re: help with randoms - by dice7 - 19.06.2009, 22:39
Re: help with randoms - by happyface - 20.06.2009, 00:21

Forum Jump:


Users browsing this thread: 1 Guest(s)