PDA

View Full Version : Need help, file check


HondaCBR
31/12/2011, 01:02 AM
Hi, Im using car system on my server and the cars are saved as 1.cfg 2.cfg 3.cfg and so on, and in each of those config files we get:


Spawned=0
Locked=1
Owner=JohnTraVo
ModelID=560
X=820.347595
Y=-1327.753784
Z=13.110036
A=344.097412
Health=472.898742
Panels=35717153
Doors=516
Lights=5
Tires=0
Color1=92
Color2=39
Paintjob=1
SPOILER=1138
HOOD=-1
ROOF=1032
SIDESKIRT=1026
LAMPS=-1
NITRO=1010
EXHAUST=1029
WHEELS=1079
STEREO=1086
HYDRAULICS=1087
FRONT_BUMPER=1169
REAR_BUMPER=1141
VENT_RIGHT=-1
VENT_LEFT=-1



How can i perform a check so when you type /v you will see a dialog showing all the cars with your name next to owner=, basically every car file needs to be checked. In that Cars folder there are only car files.

I can do the dialog I just need code for checking which car is yours.This is a part of the code related to the file:

new name[24];
new CarFile[35];
GetPlayerName(playerid,name,24);
format(CarFile,sizeof(CarFile),"Auta/%d.ini",vUID);

if(dini_Exists(CarFile) == 1)
{
if(strcmp(name,dini_Get(CarFile,"Owner"),true) == 0)
{
if(dini_Int(CarFile,"Spawned") == 0)
{
if(Car[playerid][Spawned] == false)
{
if(IsVehicleInUse(Car[playerid][VehicleGameID]) == 0)
{
Car[playerid][VehicleGameID] = CreateVehicle(dini_Int(CarFile,"ModelID"),dini_Float(CarFile,"X"),dini_Float(CarFile,"Y"),dini_Float(CarFile,"Z"),dini_Float(CarFile,"A"),dini_Int(CarFile,"Color1"),dini_Int(CarFile,"Color2"),-1);
ChangeVehiclePaintjob(Car[playerid][VehicleGameID],dini_Int(CarFile,"Paintjob"));
SetVehicleHealth(Car[playerid][VehicleGameID],dini_Float(CarFile,"Health"));

coole210
31/12/2011, 06:53 AM
There is a way to do this but it will cause MAJOR server lag, the only way to do a clean check is on Y_INI (I believe) and MySQL

HondaCBR
31/12/2011, 08:40 AM
:/ i don't want to use MySQL as its too complicated, is there really no one of doing it this way?

maybe someone has a code for mysql car saving loading etc, basically car ownership system?

eеe
31/12/2011, 08:57 AM
Check out v Dealer.its dynamic also and it is really advanced..for a roleplay server its the best according to me

HondaCBR
31/12/2011, 09:20 AM
Don't reply to this with"Use Search Button" I did, I looked for v Dealer, vehicle Dealer, I looke in ****** too and cant find it, so if someone has a link I would appreciate it.

eеe
31/12/2011, 09:40 AM
I am not telling u to use search button.vdealer is a fs+inc.
Heres the link-http://forum.sa-mp.com/showthread.php?t=254251&highlight=vDealer