(Tak wiem, napisałem w kilku zdaniach to samo :p)
Kod na mechaników
Code: Select all
export usmech1,usmech2,usmech3,us_fabryka;
Export function PrepareAmerican2;
var i,un,l;
begin
us_fabryka := FilterAllUnits([[f_side, 1], [f_btype, b_factory]]);
for i in us_fabryka do
begin
l = 0;
If IsInUnit(i) = 0 then
begin
repeat begin
uc_side = 1;
uc_nation = 1;
Level=[1,2,3] [Difficulty];
hc_gallery = ''; // galeria avatarow
hc_name = ''; // imie
hc_attr = [Rand(9,11), Rand(10, 12)]; //sila, szybkosc
hc_skills = [Rand(0,2), Rand(0,2), level, Rand(0,1)]; // umiejetnosci
hc_sex = Rand(sex_male, sex_female); //plec
hc_class = 3; //klasa 1 - sold 2 - inzynier 3 - mechanik 4- naukowic
usmech1 := CreateHuman;
usmech2 := CreateHuman;
usmech3 := CreateHuman;
PlaceHumanInUnit(usmech1, i);
l = l + 1;
PlaceHumanInUnit(usmech2, i);
l = l + 1;
PlaceHumanInUnit(usmech3, i);
l = l + 1;
enable;
end
until l = 3;
end;
end;
Code: Select all
export USVehicle;
Export Function BuildingVehicle;
begin
AddComConstruct(us_fabryka, 2, engine_combustion, control_manual, 4);
AddComConstruct(us_fabryka, 2, engine_combustion, control_manual, 2);
AddComConstruct(us_fabryka, 2, engine_combustion, control_manual, 2);
end;
Every 0$01 trigger FilterAllUnits([[f_side, 1], [f_type, unit_vehicle]]) = 0 marked 20 do
begin
BuildingVehicle;
end;
Every 0$01 trigger FilterAllUnits([[f_side, 1], [f_type, unit_vehicle]]) = 3 marked 21 do
begin
USVehicle = FilterAllUnits([[f_side, 1], [f_type, unit_vehicle]]);
AddComAgressiveMove(USVehicle,102,11);
end;