15.02.2012, 19:15
Heya,
I didn't use the 'static' so often yet, so if this causes any problems let me know please, then I'll give you a fix.
pawn Код:
public LoadVehicles()
{
//Details of the cars go here now:
CreateDealerCar(VehicleID, Float:X, Float:Y, Float:Z, Float:A, Price, Color1 = 5, Color2 = 152);
CreateDealerCar(VehicleID, Float:X, Float:Y, Float:Z, Float:A, Price); //If you colors are both -1, you don't have to enter them
return 1;
}
pawn Код:
stock CreateDealerCar(VehicleID, Float:X, Float:Y, Float:Z, Float:A, Price, Color1 = -1, Color2 = -1)
{
static id;
DealerCars[id] = AddStaticVehicle(VehicleID,X,Y,Z,A,Color1,Color2);
IsADealerCar[DealerCars[id]] = true;
CarPrice[DealerCars[id]] = Price;
new string[50];
format(string, sizeof(string), "Name: %s\nPrice: $%i", GetVehicleNameFromID(DealerCars[id]), CarPrice[DealerCars[id]]);
DealerCar[id] = Create3DTextLabel(string, 0x33CCFFAA, X,Y,Z, 20.0, 0);
id++;
return 1;
}