PDA

View Full Version : dvar



ManDown
20th April 2013, 14:48
How to do dvar which show for example TEXT+player.score?
I tired
self setClientCvar("score", "Score:" + self.score);
It shows nothing.
When I tried this: self setClientCvar("stats_rankn", "Killed");
It showed Killed.
What's wrong?

How it should looks?

Ni3ls
20th April 2013, 16:55
self setClientCvar("score", "Score:" + self.score);

Make sure self.score is defined;)

kung foo man
20th April 2013, 18:28
Maybe try first:
self setClientCvar("score", "Score:" + 123); // no problem with undefined self.score

IzNoGoD
20th April 2013, 18:44
Are you sure your "self" there actually is a player?

ManDown
20th April 2013, 20:38
What do you mean?

kung foo man
20th April 2013, 22:16
Just try:



if (self isPlayer())
self setClientCvar("score", "Score:" + self.score);
else
iprintlnbold("self is not a player, noob!");

Tally
21st April 2013, 05:16
Just try:



if (self isPlayer())
self setClientCvar("score", "Score:" + self.score);
else
iprintlnbold("self is not a player, noob!");


Small correction on the use of isPlayer() function:


IsPlayer( <entity> )

The way you did it would return the "unknown function" error.

ManDown
24th April 2013, 15:50
I added self setClientCvar("score", "Score:" + self.rank); before thread self.rank from rank file.

Ni3ls
24th April 2013, 17:04
test with developer 1 and tell us the error