Page 1 of 1

Deaths + Score text

Posted: October 20th, 2010, 11:21 am
by Moustache
1. How can you set the amount of deaths a player has?

When I use this:

Code: Select all

self.deaths = self.deaths_before;
The deaths will be set back to the amount they where when deaths_before was defined.
But when a player dies the amount of deaths will be the normal self.deaths + 1 instead of the self.death_before + 1.

So lets say self.deaths_before is 12. When I do this:

Code: Select all

self.deaths = self.death_before;
You see the player his deaths in the list on 12. But when he dies again he just has his normal amounts of deaths + 1 instead of 13.

2. How can you set the score text above the players list?
So when you press tab you see the player list. Above that you see, score, deaths, ping, etc.


I hope someone can help me :)

Re: Deaths + Score text

Posted: October 20th, 2010, 12:19 pm
by megazor
to solve the deaths issue, just change the callback 'player killed'. i hope theres no need to explain what should be added to it.

Re: Deaths + Score text

Posted: October 20th, 2010, 12:26 pm
by Moustache
I can't edit any of the callbacks.

Re: Deaths + Score text

Posted: October 20th, 2010, 1:14 pm
by megazor
u can either update your variables every time or add an additional function which would be called just after the original callback.

Re: Deaths + Score text

Posted: October 20th, 2010, 3:56 pm
by Moustache
Is that really necessary?

I just want that the amount of deaths is set to 0 and that it then continues to counting the deaths from that point.
Sorry for the bad explanation at the beginning :oops:

Re: Deaths + Score text

Posted: October 21st, 2010, 6:55 pm
by Drofder2004
Moustache wrote:Is that really necessary?

I just want that the amount of deaths is set to 0 and that it then continues to counting the deaths from that point.
Sorry for the bad explanation at the beginning :oops:

Code: Select all

self.deaths_before = self.deaths; // The amount of deaths before it was reset
self.deaths = 0; // Reset player death count

Re: Deaths + Score text

Posted: October 24th, 2010, 8:06 pm
by Moustache
Thanks :)

I did now knew I needed to reset the death count first.

But the score thing is not possible?

Re: Deaths + Score text

Posted: October 24th, 2010, 9:31 pm
by Soviet

Code: Select all

self.score_before = self.score; // The amount of deaths before it was reset
self.score = 0; // Reset player death count
Just a random guess :P

Re: Deaths + Score text

Posted: October 24th, 2010, 9:45 pm
by Drofder2004
Soviet wrote:

Code: Select all

self.score_before = self.score; // The amount of deaths before it was reset
self.score = 0; // Reset player death count
Just a random guess :P

Code: Select all

if(randomInt(0) == 0);
   return "Correct";