View Single Post
  #44  
Old 08-29-2009, 06:56 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by sssssssssss View Post
Your code only sets out one player, unless they both die. If you look at what I was trying to do, it's pretty obvious that I wanted to warp out both players if one dies. it doesnt matter who wins in this code, they both need to be warped out once one dies.

So, I guess i could use what you did, and put the timer, and check for sparring, and then go through and look for the hearts, but, in a spar, the only people that should be dying are the people sparring, and checking for a tie, winner 1, or winner 2, and all that is a bit redundant compared to just using a serverside function onPlayerDies() to check the level for any player that dies, then warp them both back, eh?
I coded it as an example of what it could be, and my code does only check the people who are sparring, which are stored in this.player_a and this.player_b. Obviously I wasn't going to include the warping of the players.

I don't trust onPlayerDies(), nor have I used it. Personally I would probably have the death check directly in the damage system but that depends on the setup of the server, and the systems they have.

This script should be it's own DB-NPC, because then you can actually see the errors as you code it, and can use it easily over multiple levels.
__________________
Quote:
Reply With Quote