Need some advice (Mysql)
#2

If you're creating a renting system, the best thing to do is to create a field that includes a Unix Timestamp (research them for more info, also note that the PAWN time() function without any given parameters omits a Unix Timestamp).

Set the field to 0 if they aren't renting the vehicle and a Unix Timestamp + the amount of seconds the player should own the vehicle for, run a timer every few seconds including an if statement to check variables and if they equal the current time then the car disappears or whatever action you want to occur. Store your MySQL data in temp variables and save (and load) them from/to the database when you need to (login/logoff).

I could have been a little more newb-friendly with this... guide (for lack of a better term) but I assume once you get scripting you might understand what I've tried to say.
Reply


Messages In This Thread
Need some advice (Mysql) - by NewbBeginner - 15.01.2011, 17:40
Re: Need some advice (Mysql) - by Calgon - 15.01.2011, 17:44
Re: Need some advice (Mysql) - by NewbBeginner - 15.01.2011, 17:46
Re: Need some advice (Mysql) - by Calgon - 15.01.2011, 17:47
Re: Need some advice (Mysql) - by NewbBeginner - 15.01.2011, 17:49
Re: Need some advice (Mysql) - by Calgon - 15.01.2011, 18:00
Re: Need some advice (Mysql) - by NewbBeginner - 15.01.2011, 18:08
Re: Need some advice (Mysql) - by NewbBeginner - 15.01.2011, 20:25

Forum Jump:


Users browsing this thread: 3 Guest(s)