Jump to content
  • 0

Check if all players are dead in a map


Profile

Question


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  77
  • Reputation:   1
  • Joined:  04/15/17
  • Last Seen:  

Hi, I would like to create a check to check if all the players in a map (they will be in a party) are dead.

If all players in the party are dead, It will teleport all players back to savepoint.

However, It will do nothing if only one player dies or if is ressurected.

I have already set mapflag so that players can't leave party.

Could anybody assist me?

Thanks!

 

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  1137
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

May be try something like this

OnTimer20000:
if (getmapusers("yourmap") == 0) {
announce "All players failed to survive",0;
end;
} 
Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  50
  • Topics Per Day:  0.02
  • Content Count:  763
  • Reputation:   227
  • Joined:  02/11/17
  • Last Seen:  

54 minutes ago, Profile said:

Hi, I would like to create a check to check if all the players in a map (they will be in a party) are dead.

If all players in the party are dead, It will teleport all players back to savepoint.

However, It will do nothing if only one player dies or if is ressurected.

I have already set mapflag so that players can't leave party.

Could anybody assist me?

Thanks!

 

May I Ask if is this running on an instance? :))

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  77
  • Reputation:   1
  • Joined:  04/15/17
  • Last Seen:  

No, it is not running on an instance.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  505
  • Reputation:   126
  • Joined:  04/04/16
  • Last Seen:  

Something like this one?

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  77
  • Reputation:   1
  • Joined:  04/15/17
  • Last Seen:  

Ok, so the best option is to check with a timer?

I thought there was a better function for this.

Thanks.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  505
  • Reputation:   126
  • Joined:  04/04/16
  • Last Seen:  

Using OnPCDieEvent is possible too.

It will trigger the checking everytime someone dies inside the map, while OnTimer will trigger the checking every XXXX ms.

Btw using getmapusers will return the number of players inside the map, so it will still count dead characters as long as they are inside the map.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  77
  • Reputation:   1
  • Joined:  04/15/17
  • Last Seen:  

22 minutes ago, Technoken said:

Using OnPCDieEvent is possible too.

It will trigger the checking everytime someone dies inside the map, while OnTimer will trigger the checking every XXXX ms.

Btw using getmapusers will return the number of players inside the map, so it will still count dead characters as long as they are inside the map.

Ok, in my case using OnPCDieEvent is the best option.

Thanks!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...