DarkBomberDude
19-09-2006, 03:27 PM
Hey everyone, I have one question about scripting.
I've made a mod and there is one extra addition I want to have in it. Is there a way to check for when the first person gets a killing blow, and then send a message to the player saying something like "(playername) got the first kill!"
I know how to create the message, but I don't know how to create the rest of it. I'm assuming it would do something along the lines of this:
RequestBattlefieldScoreData();
for i=0,GetNumBattlefieldScores() do
name, killingBlows, honorKills, deaths, honorGained, faction, rank, race, class = GetBattlefieldScore(i);
if (killingBlows~=0) then
send the mesage - (..name " got the first kill!")
endif
if (killingBlows=0) then
<<check the next player>>
endif
That is what i guess would be a likely solution, but the problem is that if it is not checked every millisecond or second, then it may not find the correct player who gets the first kill. For example, if i get it to check every 0.5 seconds, in that time, two people could both get a killing blow, but with this it would only display the one person higher up on the list.
Any help would be greatly appreciated! Thanks!
I've made a mod and there is one extra addition I want to have in it. Is there a way to check for when the first person gets a killing blow, and then send a message to the player saying something like "(playername) got the first kill!"
I know how to create the message, but I don't know how to create the rest of it. I'm assuming it would do something along the lines of this:
RequestBattlefieldScoreData();
for i=0,GetNumBattlefieldScores() do
name, killingBlows, honorKills, deaths, honorGained, faction, rank, race, class = GetBattlefieldScore(i);
if (killingBlows~=0) then
send the mesage - (..name " got the first kill!")
endif
if (killingBlows=0) then
<<check the next player>>
endif
That is what i guess would be a likely solution, but the problem is that if it is not checked every millisecond or second, then it may not find the correct player who gets the first kill. For example, if i get it to check every 0.5 seconds, in that time, two people could both get a killing blow, but with this it would only display the one person higher up on the list.
Any help would be greatly appreciated! Thanks!