Posts: 223
Threads: 64
Joined: Feb 2010
Reputation:
0
Let's say I have a value in my player enum named "Dead".
I want to check if everyone on the server has their dead value as "true". If they are all true, I would like to send a message that says "All players are dead"
Thanks in advance!
Posts: 626
Threads: 23
Joined: Nov 2012
Reputation:
0
foreach(Player, i)
if(Dead[i] == 1) SendClientMessageToAll(-1, "All players are dead");
Posts: 223
Threads: 64
Joined: Feb 2010
Reputation:
0
Okay, I've got that, but now I have a new question. Let's say I wanted the same thing to happen but I wanted it to check only if one team is dead (pInfo[i][team] == 1)
Posts: 4,885
Threads: 57
Joined: Jun 2012
Reputation:
0
It's not faster, but the difference would be too small to really measure anyways but definitely not faster you will always have two extra steps than my solution.
1). new bool: someonealive;
2). if(!someonealive)
Those two steps will always happen, so explain why your variant is better, faster and more useful.