Help with timer - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with timer (
/showthread.php?tid=617648)
Help with timer -
,TomY' - 24.09.2016
Hi. I have timer:
Code:
SetTimer("Bussines", 60000, true);
And code:
Code:
f_public: Bussines(playerid)
{
new String[128];
for(new Bussines; Bussines < MAX_BUSSINES; Bussines ++)
{
if(Bussinesinf[Bussines][Buyed])
{
sscanf(Bussinesinf[Bussines][Owner], "r", ownerid);
if(ownerid != INVALID_PLAYER_ID)
{
Bussinesinf[Bussines][Profit] += Bussinesinf[Bussines][Earning];
format(String, sizeof(String), "UPDATE `bussines` SET Profit = '%d' WHERE ID = '%d'", Bussinesinf[Bussines][Profit], Bussines;
mysql_query(String);
}
}
}
}
This code must add Earning to Profit. But.... He adding 2x Earning. For example, if Earning = 15 , code adding in 1 minute 30... Why?
Re: Help with timer -
,TomY' - 25.09.2016
still need help.