Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Damage every player?
Damage every player?
2002-03-28, 9:39 AM #1
Okay, i have a nice weapon cog for AM5 here, but i have a problem. I need to know how to damage every player in the game. I know everything else but how to get every player. Help? [http://forums.massassi.net/html/smile.gif]

------------------
Unreachable is reachable,
nothing is unreachable,
objectives rise and take over my mind as they advance,
hope for something bigger,
will for win death.
Last edited by mb; today at 10:55 AM.
2002-03-28, 9:45 AM #2
For(I=0;I<=Getthingcount();I=I+1) If(Getthingtemplate(I) == Walkplayer_template) Damagething(Blah, blah, blah);

------------------
Success is the inverse relationship between effort, gain, and loss.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-03-28, 9:50 AM #3
So...

For(I=0;I<=Getthingcount();I=I+1) If(Getthingtemplate(I) == Walkplayer_template) DamageThing(I, 10.0, 0x1, player);

^^^^ would work?

------------------
Unreachable is reachable,
nothing is unreachable,
objectives rise and take over my mind as they advance,
hope for something bigger,
will for win death.
Last edited by mb; today at 10:55 AM.
2002-03-28, 10:18 AM #4
Depends on how you defined 'Player'. If you used one of the auto verbs, like 'JKgetlocalplayer', it would return the host. Thereby, anyone that died as a result of this string, the frag would go to the host.

------------------
Success is the inverse relationship between effort, gain, and loss.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-03-28, 1:09 PM #5
I think this would be easier ...

for(i=0; i<GetNumPlayers()-1; i=i+1)
{
dplayer=GetPlayerThing(i);
DamageThing(dplayer, 10.0, 0x1, player);
}

It would put less work on the CPU so it doesn't need to go through the whole array of items.

↑ Up to the top!