Save car last position [REP+]
#1

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
Reply
#2

Impossible with static vehicles
Reply
#3

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...
Reply
#4

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
Reply
#5

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
Reply
#6

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

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

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

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

Oh wow that's lame.

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


Forum Jump:


Users browsing this thread: 1 Guest(s)