Run function in Hours
#1

Next, my home system has a function that charges the taxes, and if it does not pay the property will be automatically released for lack of tax.
And I wanted to put this function to run every day at 3:00 AM. This count on the Online or Offline player.
Any tips on how to do this?

pawn Код:
if(PlayerInfo[playerid][pThousa] >=1){
     Lbhouse(playerid);
     format(string, sizeof(string), " | HOUSES| Your home has +1 account, pay otherwise it will be released!");
     SendClientMessage(playerid, 0xCAFF95AA, string);
     }
Reply
#2

help ! '-'
Reply
#3

Use gettickcount, store and have it run every 24 hours, that should solve your problem. You'll have to put the function under a timer however.

Or you could make a timer to execute every 24 hours to execute that code for online players, as far as offline goes, you might want to avoid that, since an offline player can't really pay their taxes if they aren't online.
Reply
#4

Quote:
Originally Posted by Sgt.TheDarkness
Посмотреть сообщение
Use gettickcount, store and have it run every 24 hours, that should solve your problem. You'll have to put the function under a timer however.

Or you could make a timer to execute every 24 hours to execute that code for online players, as far as offline goes, you might want to avoid that, since an offline player can't really pay their taxes if they aren't online.
I understand, I managed to make the function work only for those who are online, but it did not work for those who just bought the house and left the server. So I needed to make one that counts the taxes at such a time, so Online / Offline players will also receive the tax, and if they accumulate 10 tax, the property automatically releases.
I was only able to do the tax count for anyone who is online.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)