15.01.2011, 17:44
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.
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.