Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- forward PropertyStoring_all(tmp);
- public PropertyStoring_all(tmp)
- {
- printf("PropertyStoring_all started (%d).", tmp);
- new t_y = GetTickCount();
- new query[2048];
- format(query,sizeof(query),"SELECT * FROM `props` WHERE id > '0'");
- mysql_query(query);
- mysql_store_result();
- for(new id=tmp*MAX_PROPERTIES/10; id<((tmp*MAX_PROPERTIES/10)+MAX_PROPERTIES/10); id++)
- {
- new a = random(10);
- if(!a)
- {
- // SAVE STATS HERE
- format(query,sizeof(query),"UPDATE `props` SET `name` = '-1', `price` = '-1', `sell` = '-1', `earning` = '-1', `owner` = '-1', `ownedsince` = '-1' WHERE `id` = '%d'",id+1);
- mysql_query(query);
- mysql_free_result();
- continue;
- }
- new time = random(10000);
- format(query,sizeof(query),"UPDATE `props` SET `name` = '%s', `price` = '%d', `sell` = '%d', `earning` = '%d', `owner` = '%s', `ownedsince` = '%d' WHERE `id` = '%d'","PropName",10000,5001,500,"Owner",time,id+1);
- mysql_query(query);
- }
- mysql_free_result();
- SetTimerEx("PropertyStoring_all", 60000, 0, "d", tmp);
- if(GetTickCount() - t_y > 1000) printf("PropertyStoring_all: Finished (%d ms)", GetTickCount() - t_y);
- printf("PropertyStoring_all finished (%d).", tmp);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment