Park Car System
#1

Hi all .

I need a command like /park for vehicles.

Example: I make a new veh with /veh and i want to stay in place after restart. For this situation, i go with car in that place and i /park it.

I use ModernTopia. Could someone help me, please?
Reply
#2

In the /park command, save the information for the vehicle in a file, then OnGameModeInit, read the file and add the parked vehicles with AddStaticVehicle
Reply
#3

Ok man, thanks for your reply.

I don`t know very good english.

Could you make me this command, please?
Reply
#4

I'm sorry, but I'm not experienced with reading files to execute functions.
I'm sure a more skilled fileuser can help you out.
Reply
#5

I hope so..

Please help me .




Another problem: I want a command to remaining a car tunning after respawn. Something like /tune .
Reply
#6

If you've got dini.inc, use this:

Top:
pawn Код:
new CarFile[50], Float:posx, Float:posy, Float:posz;
OnPlayerExitVehicle:
pawn Код:
format(CarFile, sizeof(CarFile), "vehicle%d.txt", vehicleid);
if(!dini_Exists(CarFile)) dini_Create(CarFile);
GetVehiclePos(vehicleid, posx, posy, posz);
GetVehicleZAngle(vehicleid, posa);
dini_FloatSet(CarFile, "x", posx);
dini_FloatSet(CarFile, "y", posy);
dini_FloatSet(CarFile, "z", posz);
dini_FloatSet(CarFile, "a", posa);
OnVehicleSpawn:
pawn Код:
format(CarFile, sizeof(CarFile), "vehicle%d.txt", vehicleid);
if(!dini_Exists(CarFile)) { dini_Create(CarFile);
} else {
   posx = dini_Float(CarFile, "x");
   posy = dini_Float(CarFile, "y");
   posz = dini_Float(CarFile, "z");
   posa = dini_Float(CarFile, "a");
   SetVehiclePos(vehicleid, posx, posy, posz);
   SetVehicleZAngle(vehicleid, posa);
}
I hope it works (it creates a file for any vehicle!)
Reply
#7

Quote:
Originally Posted by CAR
Посмотреть сообщение
If you've got dini.inc, use this:

Top:
pawn Код:
new CarFile[50], Float:posx, Float:posy, Float:posz;
OnPlayerExitVehicle:
pawn Код:
format(CarFile, sizeof(CarFile), "vehicle%d.txt", vehicleid);
if(!dini_Exists(CarFile)) dini_Create(CarFile);
GetVehiclePos(vehicleid, posx, posy, posz);
GetVehicleZAngle(vehicleid, posa);
dini_FloatSet(CarFile, "x", posx);
dini_FloatSet(CarFile, "y", posy);
dini_FloatSet(CarFile, "z", posz);
dini_FloatSet(CarFile, "a", posa);
OnVehicleSpawn:
pawn Код:
format(CarFile, sizeof(CarFile), "vehicle%d.txt", vehicleid);
if(!dini_Exists(CarFile)) { dini_Create(CarFile);
} else {
   posx = dini_Float(CarFile, "x");
   posy = dini_Float(CarFile, "y");
   posz = dini_Float(CarFile, "z");
   posa = dini_Float(CarFile, "a");
   SetVehiclePos(vehicleid, posx, posy, posz);
   SetVehicleZAngle(vehicleid, posa);
}
I hope it works (it creates a file for any vehicle!)
@ CAR , OnPlayerExitVehicle: etc etc, where i put that code? I am new in pawno.


Thanks !
Reply
#8

Dumppp !
Reply
#9

Quote:
Originally Posted by GaB1TzZzu
Посмотреть сообщение
Dumppp !
FAILLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL LLLLLLLLLLLLLLLLLL
Reply
#10

If you can help me, post here, if not, shut up !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)