31.12.2011, 00:02
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:
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:
pawn Код:
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
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:
pawn Код:
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"));