11-06-2013, Tuesday-22:59:38
Lösung gefunden. Ich habe das Skript ein wenig verändert.
Die erste Zeile ist Zeile 462
Dan gehts weiter mit
Es sind nur die indizes der Spieler bei player_x() falsch.
Die erste Zeile ist Zeile 462
Code:
player_x(2).book_cash( 10000000000 )
player_x(3).book_cash( 10000000000 )
player_x(3).book_cash( ((startcash[3] * 1000000) - player_x(3).get_net_wealth()[0] - 1) * 100 )
player_x(2).book_cash( ((startcash[2] * 1000000) - player_x(2).get_net_wealth()[0] - 1) * 100 )
// did we have revolution
if ( ( (world.get_time().year = revolution.year) && (world.get_time().month >= revolution.month) ||
(world.get_time().year > revolution.year)
) && (persistent.protesters >= target_one) && visit_transit(pl) )
{
persistent.level = 2
city_x(749,405).set_citygrowth_enabled(true) // city Hohenschöhnhausen
city_x(373,310).set_citygrowth_enabled(true) // city Tegel
clear_my_rules(pl)
// set NVA and GRAFFITI players bankroktt
player_x(3).book_cash( player_x(3).get_net_wealth()[0] * -110 )
player_x(2).book_cash( player_x(2).get_net_wealth()[0] * -110 )
persistent.extra_tax = (world.get_time().year - revolution.year) * 12
persistent.extra_tax+= world.get_time().month - revolution.month
local text = ttext("Revolution! Tear down the wall!")
gui.add_message( text.tostring() )
}
}
function do_part_two(pl)
{
pay_tax(pl)
if (give_percentage(persistent.level,pl) == 100)
{
persistent.level = 3
city_x(558,532).set_citygrowth_enabled(true) // city Friedrichstadt
city_x(565,500).set_citygrowth_enabled(true) // city Ost-Berlin
city_x(334,605).set_citygrowth_enabled(true) // city Grunewald
city_x( 7,838).set_citygrowth_enabled(true) // city Potsdam
}
}
function is_scenario_completed(pl)
{
if (pl != 0) return 0 // other player get only 0%
persistent.counter++
if (persistent.last_month != world.get_time().month)
{
persistent.last_month = world.get_time().month
persistent.counter = 0 // new month, set counter = 0
// give other players cash for maintenance
player_x(2).book_cash( 10000000000 )
player_x(3).book_cash( 10000000000 )
player_x(3).book_cash( (player_x(3).get_maintenance()[0] - 1) * -100 )
player_x(2).book_cash( (player_x(2).get_maintenance()[0] - 1) * -100 )
if (player_x(pl).get_net_wealth()[0] < 0) // never be bankrupt
persistent.bankrupt = true
}
if (persistent.bankrupt) { return 0 } // you lost !!
if (persistent.counter == 2)
{
switch(persistent.level) { // select the scenario part
case 1: do_part_one(pl)
break
case 2: do_part_two(pl)
break
case 3: if (give_percentage(persistent.level,pl) == 100)
{ gui.add_message("You won the scenario!") }
break
}
}
return ( give_percentage(persistent.level,pl) + (persistent.level-1) * 100 ) / 3
}
Code:
function resume_game()
Es sind nur die indizes der Spieler bei player_x() falsch.