31.12.2011, 23:42
I download a well working car system, the problem is that it doens't have a buy car command, it had 3 cars in scriptfiles/Auta 0.cfg 1.cfg 2.cfg and when you do things like spawn the car you have to provide the UID (eg. /car spawn 0)
So I made a /buysultan command to start of with. The only thing IDK how to do was to make a new ID, lets say there are 4 cars in the scriptfiles (0.cfg,1.cfg,2.cfg,3.cfg) How can does settings get stored in a file called 4.cfg?
And as I pointed out in the script, please check if name saving is right.
So I made a /buysultan command to start of with. The only thing IDK how to do was to make a new ID, lets say there are 4 cars in the scriptfiles (0.cfg,1.cfg,2.cfg,3.cfg) How can does settings get stored in a file called 4.cfg?
And as I pointed out in the script, please check if name saving is right.
pawn Код:
if(strcmp(cmd, "/buysultan", true) == 0)
{
new CarFile[35];
format(CarFile,sizeof(CarFile),"Auta/%d.ini",Car[playerid][UID]);
new Float:vInfo[5];
vInfo[0] = 1270.6603;
vInfo[1] = -1397.4448;
vInfo[2] = 12.5259;
vInfo[3] = 3.5967;
vInfo[4] = 1000;
new Damage[4];
Damage[0] = 0;
Damage[1] = 0;
Damage[2] = 0;
Damage[3] = 0;
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,48);
dini_IntSet(CarFile,"Spawned",1);
dini_IntSet(CarFile,"Locked",0);
dini_IntSet(CarFile,"ModelID",560);
dini_Set(CarFile,"Owner",name);//Im not sure which dini to use for playername, tell me if this is right.
dini_FloatSet(CarFile,"X",vInfo[0]);
dini_FloatSet(CarFile,"Y",vInfo[1]);
dini_FloatSet(CarFile,"Z",vInfo[2]);
dini_FloatSet(CarFile,"A",vInfo[3]);
dini_FloatSet(CarFile,"Health",vInfo[4]);
dini_IntSet(CarFile,"Panels",Damage[0]);
dini_IntSet(CarFile,"Doors",Damage[1]);
dini_IntSet(CarFile,"Lights",Damage[2]);
dini_IntSet(CarFile,"Tires",Damage[3]);
dini_IntSet(CarFile,"Color1",3);
dini_IntSet(CarFile,"Color2",3);
dini_IntSet(CarFile,"PAINTJOB",-1);
dini_IntSet(CarFile,"SPOILER",-1);
dini_IntSet(CarFile,"HOOD",-1);
dini_IntSet(CarFile,"ROOF",-1);
dini_IntSet(CarFile,"SIDESKIRT",-1);
dini_IntSet(CarFile,"LAMPS",-1);
dini_IntSet(CarFile,"NITRO",-1);
dini_IntSet(CarFile,"EXHAUST",-1);
dini_IntSet(CarFile,"WHEELS",-1);
dini_IntSet(CarFile,"STEREO",-1);
dini_IntSet(CarFile,"HYDRAULICS",-1);
dini_IntSet(CarFile,"FRONT_BUMPER",-1);
dini_IntSet(CarFile,"REAR_BUMPER",-1);
dini_IntSet(CarFile,"VENT_RIGHT",-1);
dini_IntSet(CarFile,"VENT_LEFT",-1);
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);
}