{Rep++}Help!!![Vehicle OwnerShip]{++Rep}
#1

Well guys,after the successfully house system,I scripted a "successful" Vehicle OwnerShip in like about 20 mins (it was easy,following the example from the house system),but with my scripting skills,I cannot come up with an idea of how to load the player's vehicles when he connects to the server(when he disconnects I destroy them,so "pushing vehicle into water" is not possible).This is how the DataBase looks(made with Y_INI):
Код:
VehInfo = AddStaticVehicle(451,-2011.099243,135.788101,27.318271,181.324340,0,0) ;
Whenever the player buys a new car,a new line like the one above is added to the player's VehiclesDB.Do you have an idea of how should I load the vehicles from those DataBase lines acording to the fact that the player can own more than 1 vehicle(:P)?And,also,I have problems related to the car's angle.This is how I save the car's angle[RESUMED](:P):

pawn Код:
new vehicleid=GetPlayerVehicleID(playerid);
  Float:vAngle//This belongs to the vehicle's enumeration of course,but I am resuming now :P
  new Float:zangle;//The angle
  GetVehicleZAngle(vehicleid,zangle);//Getting the angle :P
  VehiInfo[vehicleid][vAngle]=zangle; //Saving it
  //Of course I am adding it to the DataBase...:P
  //When the vehicle re-spawns...
  SetVehicleZAngle(vehicleid,VehInfo[vehicleid][vAngle]);
So I am doing exactly the same for vehicle's position,the position saves,and when the car re-spawns,it spawns where it should,but with 45 angle(LOL?)[And the angle saves normally in the DataBase]-(DOUBLE LOL?).Anyway,much more important is how to load the vehicle from the DataBase if you have an idea,thanks.

"Help me fast,please and thanks.Giving you reputation!!!"
Reply
#2

In my Script i used a OwnVehicles\playername.ini

in player stat to check that the player having own vehicle when he connect and try load from file

for saving vehicle pos use GetVehiclePos and GetVehicleZAngle and color1 and color2

and also use GetVehicleDamageStatus and health and soon..
Reply
#3

You kinda didn't read my topic,as I asked why the angle doesn't save properly,and if any of you have an idea of how to load the vehicles from my type of file,anyway thanks very much for the indication related to the vehicle health,I kinda forget to save it .
Reply
#4

try this use SetVehicleZAngle(vehicleid,0);// so it resets to 0 angle which on spawn the vehicle

and then use SetVehicleZAngle(vehicleid,VehInfo[vehicleid][vAngle]);//so that if of 45 then it will be 45
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)