[Pawn] How to save the position of a car? - Printable Version + open.mp forum (https://forum.open.mp) -- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3) --- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10) --- Thread: [Pawn] How to save the position of a car? (/showthread.php?tid=1789) |
How to save the position of a car? - Boxi - 2021-03-21 Hello everyone :'D? Would anyone know how to make a system to save the position of a car? where the player leaves his car somewhere and when he connects again the car is there, basically how is the saving of the player's position. Obviously I'm not asking for any of you to write that code, just an idea of where I should start if I wanted to do it. Greetings to all. RE: How to save the position of a car? - RhaegarX - 2021-03-21 In the most basic explanation possible: create the variable to save the vehicle's position, when the player disconnects you set the vehicle's position in these variables and save it in the database. Then when the player logs in you create the vehicle with the coordinates retrieved from the database. Basically, the logic would start like this: PHP Code: new playerVehicle[MAX_PLAYERS]; |