Deaths + Score text

Have a question about modding, modelling or skinning? Have a tutorial to post? Post here!

Moderator: Core Staff

Post Reply
Moustache
CJ Worshipper
CJ Worshipper
Posts: 476
Joined: August 18th, 2008, 9:30 am

Deaths + Score text

Post by Moustache » October 20th, 2010, 11:21 am

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 :)

megazor
CJ Worshipper
CJ Worshipper
Posts: 414
Joined: July 22nd, 2009, 3:02 am
Location: Russia, Vladivostok

Re: Deaths + Score text

Post by megazor » October 20th, 2010, 12:19 pm

to solve the deaths issue, just change the callback 'player killed'. i hope theres no need to explain what should be added to it.

Moustache
CJ Worshipper
CJ Worshipper
Posts: 476
Joined: August 18th, 2008, 9:30 am

Re: Deaths + Score text

Post by Moustache » October 20th, 2010, 12:26 pm

I can't edit any of the callbacks.

megazor
CJ Worshipper
CJ Worshipper
Posts: 414
Joined: July 22nd, 2009, 3:02 am
Location: Russia, Vladivostok

Re: Deaths + Score text

Post by megazor » October 20th, 2010, 1:14 pm

u can either update your variables every time or add an additional function which would be called just after the original callback.

Moustache
CJ Worshipper
CJ Worshipper
Posts: 476
Joined: August 18th, 2008, 9:30 am

Re: Deaths + Score text

Post by Moustache » October 20th, 2010, 3:56 pm

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:

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Deaths + Score text

Post by Drofder2004 » October 21st, 2010, 6:55 pm

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
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Moustache
CJ Worshipper
CJ Worshipper
Posts: 476
Joined: August 18th, 2008, 9:30 am

Re: Deaths + Score text

Post by Moustache » October 24th, 2010, 8:06 pm

Thanks :)

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

But the score thing is not possible?

Soviet
Core Staff
Core Staff
Posts: 7760
Joined: April 23rd, 2005, 9:12 pm
Location: Plano, Texas
Contact:

Re: Deaths + Score text

Post by Soviet » October 24th, 2010, 9:31 pm

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
Image
ImageImageImage
Image
"Zaitsev is a cunt." - Pedsdude

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Deaths + Score text

Post by Drofder2004 » October 24th, 2010, 9:45 pm

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";
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Post Reply

Who is online

Users browsing this forum: No registered users and 29 guests