Page 1 of 1

OnFinishNeutralize

Posted: Mon Mar 06, 2017 1:47 am
by ARCTroopaNate
Hi folks. I'm trying to set up messages that display when a team captures a command post and when one is neutralized. The capture message works fine but nothing happens when a post is neutralized. What am I missing?? Thanks friends.
Hidden/Spoiler:
OnFinishNeutralizeTeam(
function(cPost)
local pName = GetEntityName(cPost) -- Gets the name of the post that was captured

ShowMessageText("level.end1." .. pName .. "_imp_lost") -- Show this string to all teams
end,
1 -- Team number for the strings (don't forget to change me)
)

OnFinishCaptureTeam(
function(cPost)
local pName = GetEntityName(cPost) -- Gets the name of the post that was captured

ShowMessageText("level.end1." .. pName .. "_all_cap") -- Show this string to all teams
end,
1 -- Team number for the strings (don't forget to change me)
)

OnFinishNeutralizeTeam(
function(cPost)
local pName = GetEntityName(cPost) -- Gets the name of the post that was captured

ShowMessageText("level.end1." .. pName .. "_all_lost") -- Show this string to all teams
end,
2 -- Team number for the strings (don't forget to change me)
)

OnFinishCaptureTeam(
function(cPost)
local pName = GetEntityName(cPost) -- Gets the name of the post that was captured

ShowMessageText("level.end1." .. pName .. "_imp_cap") -- Show this string to all teams
end,
2 -- Team number for the strings (don't forget to change me)
)

Re: OnFinishNeutralize

Posted: Mon Mar 06, 2017 11:30 am
by AnthonyBF2
I think you need to remove Team from the end of OnFinishNeutralize

Re: OnFinishNeutralize

Posted: Mon Mar 06, 2017 5:44 pm
by Marth8880
AnthonyBF2 wrote:I think you need to remove Team from the end of OnFinishNeutralize
Yep. However, if you do want the callback to only be executed when a certain teams finishes neutralizing a CP, you'd change it to OnFinishNeutralizeTeam.