Save Car Pos
#1

Hi,

i have got a Question. I want some thing for cars. The Cars get created on Server Start.
I Want:
- Car spawns at LSPD you drive to BSN and left. The Car should be there after Server Restart (at bsn). Only when it dies, ot should return to LSPD.
Did anyone have a idea, how to create?
Reply
#2

SA-MP Scripting Tutorial 2 - Simple DM Script
Reply
#3

I hope somebody can help me.
I want:
- save car position from all Cars on Server, when the server shuts down.
- If i restart the Server, the cars should respawn at the postion where it was saved before
- if a "died" it should respawn at the original pos (before saving for server restart).

pls help me.
Reply
#4

Then you should add cars by AddStaticVehicleEx. It respawns them after % amount of seconds that you choose

Add them under OnGameModeInit - They will save when you restart and they'll ALWAYS spawn where you chose.
To add cars, go in game, type /save and you'll get the coordinates for the car. Put them in the AddStaticVehicleEx code etc.

https://sampwiki.blast.hk/wiki/AddStaticVehicleEx
Reply
#5

You do not understand me. I know how to create cars, lol.
My problem is:
- To save all vehicle which is not on the position (which is defined by Adddstaticvehicleex on OnGameModeinit) , and it should save in a file, for cars which are moved. That should work when i RESTART the Server.
- When I start my server, alle the cars which are saved, should spawn, at the save coords. I hope you get my Thought.
Reply
#6

Quote:
Originally Posted by Bl4ckDice
You do not understand me. I know how to create cars, lol.
My problem is:
- To save all vehicle which is not on the position (which is defined by Adddstaticvehicleex on OnGameModeinit) , and it should save in a file, for cars which are moved. That should work when i RESTART the Server.
- When I start my server, alle the cars which are saved, should spawn, at the save coords. I hope you get my Thought.
lolque?

Don't understand ANYTHING u just said. sorry.
Reply
#7

So you mean, when the server exits, you want the cars to save at the position it was at?

i.e. If I drove a car to LS airport, and parked it there, and for some reason the server closed and restarted, it spawned in the same location, whereas if the car blew up, it would respawn? You mean that?
Reply
#8

Yes, exactly. I tried it with OnPlayerExitCar, and saved it to a file, failed. Pls help me, taht would be great.
Reply
#9

Hmm, im sorry, since I am still new to coding pawno, I dont have any suggestions as to what you can do.
Reply
#10

You need to make something like a car system, which 1 car have a unique id.

I made for my server this:

AddCar(Carid, Carmodel, Carcolor1, Carcolor2, Float:CarX, Float:CarY, Float:CarZ, Float:CarA, CarCost, CarSell)

It creates a fully buyable car, and when you leave the car, its automaticly parked at your position !

Use dini, if you need help pm me or add my email.

Best Regards.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)