20.06.2009, 00:21
i change it a little, and it works great except that it seems to ignore the <= -19
know how to fix?
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;
}
}