Results 1 to 9 of 9

Thread: dvar

  1. #1
    ... connecting
    Join Date
    Jan 2013
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    dvar

    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?

  2. #2
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    self setClientCvar("score", "Score:" + self.score);

    Make sure self.score is defined

  3. The Following User Says Thank You to Ni3ls For This Useful Post:

    kung foo man (20th April 2013)

  4. #3
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Maybe try first:
    PHP Code:
    self setClientCvar("score""Score:" 123); // no problem with undefined self.score 
    timescale 0.01

  5. #4
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Are you sure your "self" there actually is a player?

  6. #5
    ... connecting
    Join Date
    Jan 2013
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What do you mean?

  7. #6
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Just try:

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

  8. #7
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by kung foo man View Post
    Just try:

    PHP Code:
    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:

    PHP Code:
    IsPlayer( <entity> ) 
    The way you did it would return the "unknown function" error.

  9. The Following User Says Thank You to Tally For This Useful Post:

    kung foo man (21st April 2013)

  10. #8
    ... connecting
    Join Date
    Jan 2013
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I added self setClientCvar("score", "Score:" + self.rank); before thread self.rank from rank file.

  11. #9
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    test with developer 1 and tell us the error

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •