#1

hello .. how can I do a timer to automatically release a property if the owner does not log within 10 days?
Reply
#2

You're better off setting up a CRON job in PHP or something to run every midnight to release the house via the database.
Reply
#3

Set a timer with a 864-million interval.... But you'll have to keep your server running 24/7 to work.

A better way would be to store the date and time the player disconnects in his player-file or property-file and create a function that compares that date with the current date and takes action if 10 days has passed.
Reply
#4

If i was you id save when player was last logged in. Not use a timer.
pawn Код:
new OwnerLastLoggedIn;//somewhere
then when they log in or out
pawn Код:
OwnerLastLoggedIn = gettime();
Then when someone tries to buy a property.

pawn Код:
//"gettime() - OwnerLastLoggedIn" will be the amount of seconds passed since last login
if((gettime() - OwnerLastLoggedIn) >= 864000)//864000 10 days in seconds
{
    //player can buy property owner was last logged in 10 days or more ago
}
Reply
#5

ok thank you I will try
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)