SA-MP Forums Archive
Save car last position [REP+] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Save car last position [REP+] (/showthread.php?tid=313753)



Save car last position [REP+] - zaf13 - 27.01.2012

Hello, I want to save car position if the server restart.Like, if i drive one car and left it somewhere if the server restart i want to save the car in the last position.Thanks


Re: Save car last position [REP+] - milanosie - 27.01.2012

Impossible with static vehicles


Re: Save car last position [REP+] - henry jiggy - 27.01.2012

Unless you create your own function to restart the server with the proper RCON command below all the fuckload of code that is going to be necessary for saving vehicles, it won't work, AND even if you do this, it wont save if a crash occurs...


Re: Save car last position [REP+] - zaf13 - 27.01.2012

Ok thanks for your answers.So i want this for impound cars.I want to impound cars and when do /impound (i have that command) to save the vehicle at position if the server restart.Understand? Thanks


Re: Save car last position [REP+] - henry jiggy - 27.01.2012

hmmmm...

With the risk of asking a terribly dumb question, do you want the positions to be loaded at the start?

If yes then you'll need an entire system for that. i recommend using Y_INI...took me a while to get it but now it's easy.

This might help:

pawn Код:
CMD:impound(playerid, params[])
{
new CarID = GetPlayerVehicleID(playerid);
if(CarID == 0) return SendClientMessage(playerid,COLOR_WHITE,"Dude, You arent in a car.");
else
{
new float:X;
new float:Y;
new float:Z;
new float:CarAngle;
GetVehiclePos(CarID,X,Y,Z);
GetVehicleZAngle(CarID,CarAngle);
//Do your saving magic here
Bored to write full code...

P.S: will need ZCMD to work

"I pushed you, now fly!" - Mama Bird


Re: Save car last position [REP+] - zaf13 - 27.01.2012

Thanks dude .So i add this to my script and ready?


Re: Save car last position [REP+] - milanosie - 27.01.2012

Quote:
Originally Posted by zaf13
Посмотреть сообщение
Thanks dude .So i add this to my script and ready?
no you need to finish it


Re: Save car last position [REP+] - zaf13 - 27.01.2012

Can you tell me how please?If u can.
Thanks


Re: Save car last position [REP+] - papedo - 27.01.2012

I tryed this, but sometimes GetVehiclePos returns spawn coordinates of the vehicle instead of current vehicle position.


Re: Save car last position [REP+] - henry jiggy - 27.01.2012

Oh wow that's lame.

in this case use GetPlayerPos instead, because the player has to be inside a vehicle to do /impound command