Skip to content
User Avatar
#3055
Auto-translated
Killer5029
I wrote this script (it doesn't work):
local a=0;
function Armia()
local day=GetDate(3);
if day == 0
then a=a+1;
end;
end;

Trigger(NEW_DAY_TRIGGER, "Armia");

function zoloto()
if prewOwner == PLAYER_NOON and newOwner == PLAYER_NAME
then SetObjectDwellingCreatures('houseInferno', 16, 35*a);
SetObjectDwellingCreatures('houseInferno', 18, 34*a);
SetObjectDwellingCreatures('houseInferno', 20, 18*a);
SetObjectDwellingCreatures('houseInferno', 22, 10*a);
SetObjectDwellingCreatures('houseInferno', 24, 7*a);
SetObjectDwellingCreatures('houseInferno', 26, 4*a);
SetObjectDwellingCreatures('houseInferno', 28, 2*a);

end;
end;

Trigger( OBJECT_CAPTURE_TRIGGER, 'houseInferno', "zoloto")

What could be the error? Please help.

Firstly, it's better not to write like this:
local a = 0
outside of functions.
Secondly, this line:
if prewOwner == PLAYER_NOON and newOwner == PLAYER_NAME
The neutral player is PLAYER_NONE. What is PLAYER_NAME? You need to use player number constants, for example, PLAYER_1.

Also, in the definition of the zoloto function, you need to specify that it has the parameters prewOwner and newOwner:
function zoloto(prewOwner, newOwner)
Нет войне.

Statistics

Welcome our newest member: leyu