The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Leaderboard Issue
Author Message
Leonidas
Master
**

Posts: 277
Likes Given: 3
Likes Received: 13 in 12 posts
Joined: May 2013
Reputation: 1



Post: #1
Leaderboard Issue
Everything works fine except for my kills, I can't get it to show the player with the most kills.

Quote:[DEFNAME Leaderboard]
top_player_board_uid 0a457

[ITEMDEF i_leaderboard]
DEFNAME=i_leaderboard
NAME=Leaderboard
ID=i_bulletin_board

ON=@CREATE
COLOR=0
ATTR=010
TIMER=10

ON=@DCLICK
SERV.ALLCLIENTS UPDATEBOARD
SRC.TAG.STR2=<LINK.TAG.STR2>
SRC.TAG.DEX2=<LINK.TAG.DEX2>
SRC.TAG.INT2=<LINK.TAG.INT2>
SRC.TAG.KARMA2=<LINK.TAG.KARMA2>
SRC.TAG.KARMA4=<LINK.TAG.KARMA4>
SRC.TAG.FAME2=<LINK.TAG.FAME2>
SRC.TAG.KILLS=<LINK.TAG.KILLS> ////////////Pretty sure the problem is here
SRC.DIALOG d_leaderboard
RETURN 1

[FUNCTION UPDATEBOARD]
VAR.BOARD=<EVAL (top_player_board_uid)>
//IF (<SRC.ACCOUNT.PLEVEL><2)
IF (<STR>><UID.<VAR.BOARD>.TAG.STR>)
TRY UID.<VAR.BOARD>.TAG.STR=<STR>
TRY UID.<VAR.BOARD>.TAG.STR2=<NAME> //(<EVAL <STR>>)
ENDIF
IF (<DEX>><UID.<VAR.BOARD>.TAG.DEX>)
TRY UID.<VAR.BOARD>.TAG.DEX=<DEX>
TRY UID.<VAR.BOARD>.TAG.DEX2=<NAME> //(<EVAL <DEX>>)
ENDIF
IF (<INT>><UID.<VAR.BOARD>.TAG.INT>)
TRY UID.<VAR.BOARD>.TAG.INT=<INT>
TRY UID.<VAR.BOARD>.TAG.INT2=<NAME> //(<EVAL <INT>>)
ENDIF
IF (<KARMA>><UID.<VAR.BOARD>.TAG.KARMA>)
TRY UID.<VAR.BOARD>.TAG.KARMA=<KARMA>
TRY UID.<VAR.BOARD>.TAG.KARMA2=<NAME> //(<EVAL <KARMA>>)
ENDIF
IF (<FAME>><UID.<VAR.BOARD>.TAG.FAME>)
TRY UID.<VAR.BOARD>.TAG.FAME=<FAME>
TRY UID.<VAR.BOARD>.TAG.FAME2=<NAME> //(<EVAL <FAME>>)
ENDIF
IF (<KARMA><<UID.<VAR.BOARD>.TAG.KARMA3>)
TRY UID.<VAR.BOARD>.TAG.KARMA3=<KARMA>
TRY UID.<VAR.BOARD>.TAG.KARMA4=<NAME> //(<EVAL <KARMA>>)
ENDIF
IF (<KILLS><<UID.<VAR.BOARD>.TAG.KILLS>) //////// And here!
TRY UID.<VAR.BOARD>.TAG.KILLS=<KILLS>
TRY UID.<VAR.BOARD>.TAG.KILLS=<NAME> //(<EVAL <KILLS>>)
ENDIF
ENDIF



[DIALOG d_leaderboard]
0,0
page 0
resizepic 163 100 9200 375 325
gumppic 504 59 10441
gumppic 112 59 10440
gumppic 302 83 30061
gumppic 164 183 96
gumppic 338 183 96
gumppic 356 183 96
tilepic 458 118 14164
tilepic 158 118 14164
text 297 103 1935 0
text 306 121 1935 1
text 228 142 1935 2
text 226 213 90 3
text 226 192 57 4
text 226 235 27 5
text 226 290 1935 6
text 226 312 1935 7
text 226 337 1935 8
text 226 255 1935 9
text 227 361 1935 10

text 300 290 1935 11 //strongest
text 300 337 1935 12 //smartest
text 300 312 1935 13 //dex
text 315 192 57 14 //fame
text 300 213 90 15 //holy
text 300 235 27 16 //vile
text 300 290 1935 17 //kills
button 312 395 247 248 1 0 0

[DIALOG d_leaderboard text]
Kingdom of Fire //0
Leaderboard
(Only active players will be listed here)
Most Holy:
Most Famous:
Most Vile: //5
Strongest:
Dexterious:
Smartest:
Most Wanted:
Luckiest: //10
<SRC.tag.str2>
<SRC.tag.int2>
<SRC.tag.dex2>
<SRC.tag.fame2>
<SRC.tag.karma2> //15
<SRC.tag.karma4>
<SRC.tag.kills> ////////////// and here Tongue

If anyone can help that'd be wonderful
(This post was last modified: 01-28-2014 04:28 AM by Leonidas.)
01-28-2014 04:25 AM
Find all posts by this user Like Post Quote this message in a reply
amonvangrell
Banned

Posts: 337
Likes Given: 17
Likes Received: 32 in 20 posts
Joined: Aug 2012

britannia shard

Post: #2
RE: Leaderboard Issue
have you tried to use eval??
SRC.TAG.KILLS=<eval <LINK.TAG.KILLS>>
01-28-2014 06:57 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Leonidas
Master
**

Posts: 277
Likes Given: 3
Likes Received: 13 in 12 posts
Joined: May 2013
Reputation: 1



Post: #3
RE: Leaderboard Issue
Yeah that's not working, idk what else to do!
01-28-2014 08:54 AM
Find all posts by this user Like Post Quote this message in a reply
Feeh
Sphere Developer
*****

Posts: 156
Likes Given: 6
Likes Received: 40 in 29 posts
Joined: Sep 2012
Reputation: 4



Post: #4
RE: Leaderboard Issue
Be sure that the tag 'kills' exists on the character. I started using 'TAG0' instead of 'TAG', it is basically the same thing, but when you use TAG0, if the tag does not exists or the value is empty, it is automatically assumed to be 0 (zero)


----
VAR.BOARD=<EVAL (top_player_board_uid)>
Use REFx (see revisions) instead of locking the reference type to a variable type
REF1=<DEF.top_player_board_uid>
IF (<STR> > <REF1.TAG.STR>) //spaces also help on reading

---
Instead of using 'text X Y Hue ID' then setting the text to another block, use 'dtext' (see sphere_dialog.scp). It is a lot easier to read when dealing with gumps/dialogs

Feeh/Epila - Nightly releases / SphereWiki / Github Issues / Sphere's GitHub
(This post was last modified: 01-28-2014 09:44 AM by Feeh.)
01-28-2014 09:35 AM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #5
RE: Leaderboard Issue
see what you did here?

Code:
TRY UID.<VAR.BOARD>.TAG.KILLS=<KILLS>
TRY UID.<VAR.BOARD>.TAG.KILLS=<NAME>

You write the tag and the overwrite the tag...
All your others are TAG.BLAH and then TAG.BLAH+1

[Image: 2nis46r.jpg]
01-28-2014 12:08 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)