06.04.2012, 09:29
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):
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):
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!!!"
![Cheesy](images/smilies/biggrin.png)
Код:
VehInfo = AddStaticVehicle(451,-2011.099243,135.788101,27.318271,181.324340,0,0) ;
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]);
"Help me fast,please and thanks.Giving you reputation!!!"