Help with timer
#1

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?
Reply
#2

still need help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)