Full documentation and information about XLRstats version 2 can be found at this subsection of our site.

Our upcoming XLRstats version 3 (League Edition) is currently being developed. You can have a glimpse on our main XLRstats website: www.xlrstats.com


Pages: [1] 2 3 4   Go Down
  Print  
Author Topic: !rank for XLRStats  (Read 11632 times) Bookmark and Share
Jr. Member
**
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 36
Offline Offline
« on: June 01, 2010, 04:32:12 AM »

I modified the xlrstats.py Version 2.2.3

Now it allow to show the player his Rank...

This are the lines you have to add:

Open the xlrstats.py and search for:
Code:
   def cmd_xlrhide(self, data, client, cmd=None):

Insert above this Line:
Code:
   def cmd_rank(self, data, client, cmd=None):

        """\

        [<name>] - list a players XLR Skill Rank Position
        """

sclient = client
id = client.id

q = 'SELECT rang FROM (SELECT @rownum := @rownum +1 AS rang, statistic . * FROM (SELECT clients.name, clients.time_edit, xlr_playerstats.client_id, xlr_playerstats.id, kills, deaths, ratio, skill, winstreak, losestreak, rounds, fixed_name, ip FROM clients, xlr_playerstats WHERE ( clients.id = xlr_playerstats.client_id) AND ((xlr_playerstats.kills >1000) OR (xlr_playerstats.rounds >50)) AND (xlr_playerstats.hide =0) AND (UNIX_TIMESTAMP( NOW( ) ) - clients.time_edit <14 *60 *60 *24) AND clients.id NOT IN (SELECT DISTINCT (target.id) FROM penalties AS penalties, clients AS target WHERE (penalties.type =  "Ban" OR penalties.type =  "TempBan") AND inactive =0 AND penalties.client_id = target.id AND (penalties.time_expire = -1 OR penalties.time_expire > UNIX_TIMESTAMP( NOW( ) )))) AS statistic, (SELECT @rownum :=0) AS vars ORDER BY skill DESC) AS DATA WHERE client_id = %s' % (id)

cursor = self.query(q)
if not cursor.EOF:

r = cursor.getRow()      

message = '^3XLR Ranking: ^7%s ^7: Rank ^2%s' % (sclient.exactName, int(r['rang']))

cmd.sayLoudOrPM(client, message)

return
else:

client.message('^3XLR Ranking: ^7 %s is not Ranked' % sclient.exactName)        
return

Now open xlrstats.xml and search for:
Code:
<set name="xlrhide">60</set>

Insert A Line above and write this:
Code:
               <set name="rank-rang">1</set>

Code was testet with Urt4.1 on my own Server, but why the Hell do i want this code? Cause People can see easy their Ranking on Statspage, but not in Game... So I wantedt that even low ranked Players can check their Ranking.

Have fun with this...

I can't post the whole Files, cause i modified many more... But most of my new Code is very special...

« Last Edit: June 25, 2010, 02:43:39 AM by KnightOrk » Logged


Senior Dev.
*
OS: Linux
Type: Home user
Posts: 4719
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #1 on: June 23, 2010, 11:03:11 PM »

nice work. Thanks for sharing.
Logged

Jr. Member
**
OS: Windows
Type: Renting Server with B3
Gameservers: BC2
Posts: 44
Offline Offline
« Reply #2 on: June 24, 2010, 09:11:26 AM »

nice work. Thanks for sharing.


I can't for the life of me get this to work. Always says unrecognized command in game.

100624 13:08:34   VERBOSE   Parsing Event: Client Join Team: XlrstatsPlugin
100624 13:08:36   CONSOLE   ['player.onChat', 'Padinn', '/!rank', 'all']
100624 13:08:36   VERBOSE   Queueing event Say !rank
100624 13:08:36   VERBOSE   Parsing Event: Say: AdminPlugin
100624 13:08:36   DEBUG   AdminPlugin: OnSay handle 5:"!rank"
100624 13:08:36   DEBUG   AdminPlugin: Handle command !rank
100624 13:08:36   DEBUG   getCommand: ('admin.say', '(b3): [pm] Unrecognized command rank', 'player', 'Padinn')
100624 13:08:36   VERBOSE   RCON (1/1) ('admin.say', '(b3): [pm] Unrecognized command rank', 'player', 'Padinn')
100624 13:08:36   VERBOSE   Parsing Event: Say: ChatloggerPlugin
Logged
Sr. Member
****
OS: Windows
Type: Owner dedicated server(s)
Gameservers: CoD4, CS:GO, Arma 2
Posts: 253
Offline Offline
WWW
« Reply #3 on: June 24, 2010, 09:48:20 AM »

try adding
Code:
<set name="rank">1</set>
into your xlrstats.xml
Logged

Jr. Member
**
OS: Windows
Type: Renting Server with B3
Gameservers: BC2
Posts: 44
Offline Offline
« Reply #4 on: June 24, 2010, 10:03:44 AM »

try adding
Code:
<set name="rank">1</set>
into your xlrstats.xml


It's not supposed to be rank-rang? I did as suggested in the OPs post and that's what I ended up with...after I fixed indentation and such.

Actually somehow managed to crash the entire unix server, not sure exactly how.
« Last Edit: June 24, 2010, 10:07:58 AM by Padinn » Logged
Sr. Member
****
OS: Windows
Type: Owner dedicated server(s)
Gameservers: CoD4, CS:GO, Arma 2
Posts: 253
Offline Offline
WWW
« Reply #5 on: June 24, 2010, 10:10:39 AM »

you can use rank-rang i think
Logged

B3 Contrib/Support
*
OS: --No B3 installed--
Type: --No B3 installed--
Posts: 1226
Offline Offline
Support Specialty: B3-Core, CoD/BFBC2 parsers, FTP-functionality, Plugin development
« Reply #6 on: June 24, 2010, 01:09:50 PM »

if you have rank only, !rank will be the only command you can use.

rank-rang means that you can use both !rank and !rang to get the rank - rang means rank in loads of languages (I believe French, Dutch, German, Romanian, Danish, Swedish, and more!)
Logged

Jr. Member
**
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 36
Offline Offline
« Reply #7 on: June 25, 2010, 12:07:14 AM »

Bakes is right. I am from Germany and I always try to use english and german commands in my B3 Plugins.

That's why the Code uses
Code:
def cmd_rank

And the Config allows you to use an other language.

You can also use:
Code:
<set name="rank-rank_command_in_your_language">1</set>

Or for the english Version only: 
Code:
<set name="rank">1</set>
Logged

Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 82
Offline Offline
WWW
« Reply #8 on: October 13, 2010, 01:24:15 PM »

I seem to be getting an indentation error when i directly copy and paste the code into my xlrstats.py

Quote
101013 22:16:33 BOT     Loading Plugin #14 xlrstats [/home/nitro/b3/b3/extplugins/conf/xlrstats.xml]
101013 22:16:33 INFO    Could not load built in plugin xlrstats (No module named xlrstats)
101013 22:16:33 INFO    trying external plugin directory : /home/nitro/b3/b3/extplugins
101013 22:16:33 CRITICAL        Error loading plugin: unexpected indent (xlrstats.py, line 1300)
Traceback (most recent call last):
  File "/home/nitro/b3/b3/parser.py", line 526, in loadPlugins
    pluginModule = self.pluginImport(p)
  File "/home/nitro/b3/b3/parser.py", line 626, in pluginImport
    return imp.load_module(name, fp, pathname, description)
  File "/home/nitro/b3/b3/extplugins/xlrstats.py", line 1300
     sclient = client
    ^
 IndentationError: unexpected indent


Is it possible for womeone to upload a correctly modified version of the xlrstats.py to make this a simple swap out job  Cheesy
Logged
Senior Dev.
*
OS: Linux
Type: Home user
Posts: 4719
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #9 on: October 13, 2010, 01:32:56 PM »

that because you mixed tabs with spaces in your indentation
Logged

Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 82
Offline Offline
WWW
« Reply #10 on: October 13, 2010, 02:10:39 PM »

but I copied and pasted it as is. 

I remember seeing you making a post on how to setup notepad++ with proper spacing but i cant seem to find it.
Logged
Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 82
Offline Offline
WWW
« Reply #11 on: October 13, 2010, 02:44:09 PM »

ok I believe i have fixed the indentation since no more errors are given.

however it still does not work for me.


Quote
101013 23:37:40 CONSOLE 36:51 say: 0 |NS|NITR0: !rank
101013 23:37:40 VERBOSE Client Found: |NS|NITR0 on slot 0
101013 23:37:40 VERBOSE Queueing event Say !rank
101013 23:37:40 VERBOSE Parsing Event: Say: AdminPlugin
101013 23:37:40 DEBUG   AdminPlugin: OnSay handle 5:"!rank"
101013 23:37:40 DEBUG   AdminPlugin: Handle command !rank
101013 23:37:40 VERBOSE RCON sending (83.170.76.144:27960) tell 0 ^7 ^3[pm]^7 ^7Unrecognized command rank
101013 23:37:45 CONSOLE 36:56 say: 0 |NS|NITR0: !rank nitr0
101013 23:37:45 VERBOSE Client Found: |NS|NITR0 on slot 0
101013 23:37:45 VERBOSE Queueing event Say !rank nitr0
101013 23:37:45 VERBOSE Parsing Event: Say: AdminPlugin
101013 23:37:45 DEBUG   AdminPlugin: OnSay handle 5:"!rank nitr0"
101013 23:37:45 DEBUG   AdminPlugin: Handle command !rank nitr0
101013 23:37:45 VERBOSE RCON sending (83.170.76.144:27960) tell 0 ^7 ^3[pm]^7 ^7Unrecognized command rank
101013 23:37:52 CONSOLE 37:03 say: 0 |NS|NITR0: !rank |NS|NITR0
101013 23:37:52 VERBOSE Client Found: |NS|NITR0 on slot 0
101013 23:37:52 VERBOSE Queueing event Say !rank |NS|NITR0
101013 23:37:52 VERBOSE Parsing Event: Say: AdminPlugin
101013 23:37:52 DEBUG   AdminPlugin: OnSay handle 5:"!rank |NS|NITR0"
101013 23:37:52 DEBUG   AdminPlugin: Handle command !rank |NS|NITR0
101013 23:37:52 VERBOSE RCON sending (83.170.76.144:27960) tell 0 ^7 ^3[pm]^7 ^7Unrecognized command rank


This is in my xlrstats.xml file

Code:
</settings>
<settings name="commands">
<set name="xlrstats-stats">1</set>
<set name="xlrtopstats-topstats">2</set>
<set name="rank">1</set>
<set name="xlrhide">60</set>
</settings>

Logged
Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 82
Offline Offline
WWW
« Reply #12 on: October 15, 2010, 08:32:40 AM »

Got it working  Cheesy
« Last Edit: October 15, 2010, 11:35:23 AM by seanbarr1988 » Logged
Jr. Member
**
OS: Windows
Type: Gameserver Rental Co.
Gameservers: BFBC2, MOH, ALL
Posts: 29
Offline Offline
WWW
« Reply #13 on: January 05, 2011, 03:41:55 AM »

Would this B3 !rank replace !xlrstats and show the same data as !xlrstats would or does it ADD !rank command so both commands can be used to display the same data?

I am looking to ADD !rank to display the same data !xlrstats does while keeping the !xlrstats command.
Logged

RCON Hosting Services - http://rconhostingservices.net

Jr. Member
**
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 36
Offline Offline
« Reply #14 on: January 05, 2011, 07:11:38 AM »

Would this B3 !rank replace !xlrstats and show the same data as !xlrstats would or does it ADD !rank command so both commands can be used to display the same data?

I am looking to ADD !rank to display the same data !xlrstats does while keeping the !xlrstats command.

The Command !xlrstats would work like before!
It only add a NEW Command called !rank to see Ingame the XLR Skill Rank of the Player.

I will try to seperate my command for a Pure Rank Plugin soon.
Logged

Tags:
Pages: [1] 2 3 4   Go Up
  Print  
 
Jump to:  


Rate this page +1 at Google Search


SimplePortal 2.3.1 © 2008-2009, SimplePortal