I need some help with this script, I am new to scripting.
I need this script to end with the team holding the flag to be the winners.
game_manager
{
spawn
{
wait 50
wm_axis_respawntime 10 // Axis respawn time
wm_allied_respawntime 10 // Allied respawn time
wm_set_round_timelimit 15 // Map timelimit
// Stopwatch mode defending team (0=Axis, 1=Allies)
wm_set_defending_team 0
// Winner on expiration of round timer (0=Axis, 1=Allies)
wm_setwinner 0
}
}
//======================================================
neutral_flag
{
spawn
{
accum 0 set 2 // Who owns flag: 0-Axis, 1-Allied, 2-Nobody
}
trigger axis_capture // Touched by an Axis playerstart
{
accum 0 abort_if_equal 0 // do Axis own flag?
accum 0 trigger_if_equal 1 neutral_flag axis_reclaim // Reclaimed from Allies
accum 0 set 0 // Axis own the flag
wm_announce "Axis have captured the Forward Flag!"
}
trigger axis_reclaim
trigger allied_capture // Touched by an allied playerstart
{
accum 0 abort_if_equal 1 // do Allies own flag?
accum 0 set 1 // Allied own the flag
wm_announce "Allies have captured the Forward Flag!"
}
}
trigger checkgame
{
accum 1 abort_if_not_equal 1
// Set the round winner: 0 == AXIS, 1 == ALLIED
wm_setwinner 1
// End the round
wm_endround
}
I dont understand why only axis win even if allies have the flag.
Please help me, I will understand if you give me the sollution.
)

