gg_winner_display

Area to post and download Custom Addons, as well as ask the author/users for help or support.

Postby Warren » Mon Dec 08, 2008 5:30 pm

PPG_Paula, your special characters are not being displayed due to some issue on your website. Compare your winner page to the default winner page.

I suggest just using the default.
Warren

Site Admin
Site Admin
 
Posts: 772
Joined: Fri Sep 05, 2008 2:59 am
Location: Boston, MA
Xfire Name: WMA9000

Re: gg_winner_display

Postby PPG_Paula » Mon Dec 08, 2008 5:36 pm

i´ve done it just one min ago and your links shoes me now a right display.....
dont know why because i had use the default winner.php but now everything is working!
thanx a lot......

!! Edit!!
In game the display shows me the same error......
Maybe server config mistake?
Because the display down the middle wich level and how is leder shows have an error too.... look my screen....
But i think there are only errors with very special letters

!!Edit 2 !!!
I have selected the gungame5.com winner.php and everything is working!
Scope could you upload your gg5_win.php here so that i can test your file on our serv?
Or its our webspace where i have to change some settings....

Thanx for first time


Screen 1 names with special letter will be correctly shown !
gg5.jpg

Screen 2 display with error
gg52.jpg

Screen 3 winner name from screen 2
gg3.jpg
PPG_Paula

Private
Private
 
Posts: 7
Joined: Sun Nov 30, 2008 5:15 pm

Re: gg_winner_display

Postby PPG_Paula » Tue Dec 09, 2008 10:42 pm

I´ve fixed my prob!!!
For all other with the same problem....

The broken display comes from the wrong charset on the webserver
you can fix it with the following code!
create an file (notepad etc) an put this code in it
AddDefaultCharset utf-8

# evtl. auch noch:
AddCharset utf-8 .php .html .xhtml


upload it on to your webspace (same folder as gg5_win.php)
and rename it to ".htaccess

Now all special letters will be shown!

Thx all others for help ^^
PPG_Paula

Private
Private
 
Posts: 7
Joined: Sun Nov 30, 2008 5:15 pm

Postby Cheebs » Wed Dec 31, 2008 3:40 am

Great work Scope, I think this should be an included add-on.
Could you also display the next map on the page? Would be very useful.

Thanks
Cheebs

Private
Private
 
Posts: 11
Joined: Wed Nov 19, 2008 8:48 pm
Steam Friends Name: carters6

Re: gg_winner_display

Postby BombTrak » Thu Jan 29, 2009 6:43 am

Hey everyone. I noticed that the script does not handle names with < or > in them properly. The web page would not display my tag because it is sandwiched between those brackets.

I am sure that this isn't the most elegant solution as I am new to EventScripts/GunGame/Python but it does work:
# ==============================================================================
#   GAME EVENTS
# ==============================================================================
def gg_win(event_var):
    # Format variables
    attacker = event_var['attacker']
    attackername = es.getplayername(attacker).replace('<','%26lt;')
    attackername = attackername.replace('>','%26gt;')
    username = es.getplayername(event_var['userid']).replace('<','%26lt;')
    username = username.replace('>','%26gt;')
    steamid = es.getplayersteamid(attacker)
    wins = gungamelib.getWins(steamid)
    place = gungamelib.getWinnerRank(steamid) if steamid != 'BOT' else 'BOT'
    totalPlaces = gungamelib.getTotalWinners()

All I changed/added were the attackername/username replace expressions and tested it on my server to confirm that it works.

Hope this is helpful!!
:D
BombTrak

Recruit
Recruit
 
Posts: 2
Joined: Wed Jan 28, 2009 8:07 am

Postby Warren » Thu Jan 29, 2009 10:43 pm

< and > work fine for me. What version are you running?
Warren

Site Admin
Site Admin
 
Posts: 772
Joined: Fri Sep 05, 2008 2:59 am
Location: Boston, MA
Xfire Name: WMA9000

Re: gg_winner_display

Postby BombTrak » Fri Jan 30, 2009 1:00 am

Well, here's all the info I can find.

Gungame Version: 5.0.577
gg_winner_display Version: 1.0.3

I use the default php setting running off of the gungame5 server.

These screenshots show what I am talking about:
PlayerList.jpg

Winner.jpg


It looks like the web page is treating the <OC> tag as an html tag and that is why I threw in the replace statements.
Here is a copy of the gg_winner_display.py file that I was using when I took the screenshots:
''' (c) 2008 by the GunGame Coding Team

    Title: gg_winner_display
    Version: 1.0.3
    Description: Custom addon.
    '
''

# ==============================================================================
#   IMPORTS
# ==============================================================================
# Python imports

# EventScripts imports
import es
import gamethread
import usermsg

# GunGame imports
import gungamelib

# ==============================================================================
#   ADDON REGISTRATION
# ==============================================================================
# Register this addon with EventScripts
info = es.AddonInfo()
info.name     = 'Winner Display Addon for GunGame 5'
info.version  = '1.0.3'
info.url      = 'http://forums.gungame5.com/viewtopic.php?f=17&t=162'
info.basename = 'gungame/custom_addons/gg_winner_display'
info.author   = 'Sc0pE'

es.ServerVar('gg_winner_display_ver', info.version).makepublic()

# ==============================================================================
#   GAME EVENTS
# ==============================================================================
def gg_win(event_var):
    # Format variables
    attacker = event_var['attacker']
    attackername = es.getplayername(attacker).replace('&','%26')
    username = es.getplayername(event_var['userid']).replace('&','%26')
    steamid = es.getplayersteamid(attacker)
    wins = gungamelib.getWins(steamid)
    place = gungamelib.getWinnerRank(steamid) if steamid != 'BOT' else 'BOT'
    totalPlaces = gungamelib.getTotalWinners()
   
    # Send MOTD
    gamethread.delayed(0.5, sendDisplay, (attackername, username, wins, place, totalPlaces))

# ==============================================================================
#   HELPER FUNCTIONS
# ==============================================================================
def sendDisplay(attackername, username, wins, place, totalPlaces):
    for userid in es.getUseridList():
        usermsg.motd(userid, 2, 'GunGame Winner', '%s?winnerName=%s&loserName=%s&wins=%s&place=%s&totalPlaces=%s' % (gungamelib.getVariableValue('gg_winner_display_page'), attackername, username, wins, place, totalPlaces))
BombTrak

Recruit
Recruit
 
Posts: 2
Joined: Wed Jan 28, 2009 8:07 am

Re: gg_winner_display

Postby cyberkrypta » Fri Jan 30, 2009 12:01 pm

Mein englisch ist leider zu schlecht, um diese Frage schreiben zu können ;). Darum hoffe ich ihr versteht mich trotzdem oder es kann wer dann übersetzt rein stellen;).

Also hier noch eine Frage von mir: Kann man dies zufälliger wenise nicht auch ohne hlstats machen bzw. es nicht auch für GG5 mchen? Wenn ja, dann bitte ich um hilfe, denn ich denke mir, ich werde nicht der einzigste sein, den dies interessiert!!
Hier mal der Link, bei dem ich auch schon angefragt habe und aus dem alles weitere hervor geht!


http://forum.css-community.de/viewtopic.php?f=8&t=557


Danke schon mal!!!

Cyberkrypta

P.S.: Bin dort Hr.Rossi >:)
85.131.187.195:27800 [TSG] GG5-Mod & Public-Tick100-FastDL-by-[TSG] and b-gaming.de
cyberkrypta

Private
Private
 
Posts: 35
Joined: Tue Dec 09, 2008 5:01 pm

Re: gg_winner_display

Postby onslaught » Thu Feb 05, 2009 1:08 am

BombTrak wrote:Well, here's all the info I can find.

Gungame Version: 5.0.577
gg_winner_display Version: 1.0.3

I use the default php setting running off of the gungame5 server.

These screenshots show what I am talking about:
PlayerList.jpg

Winner.jpg


It looks like the web page is treating the <OC> tag as an html tag and that is why I threw in the replace statements.
Here is a copy of the gg_winner_display.py file that I was using when I took the screenshots:
''' (c) 2008 by the GunGame Coding Team

    Title: gg_winner_display
    Version: 1.0.3
    Description: Custom addon.
    '
''

# ==============================================================================
#   IMPORTS
# ==============================================================================
# Python imports

# EventScripts imports
import es
import gamethread
import usermsg

# GunGame imports
import gungamelib

# ==============================================================================
#   ADDON REGISTRATION
# ==============================================================================
# Register this addon with EventScripts
info = es.AddonInfo()
info.name     = 'Winner Display Addon for GunGame 5'
info.version  = '1.0.3'
info.url      = 'http://forums.gungame5.com/viewtopic.php?f=17&t=162'
info.basename = 'gungame/custom_addons/gg_winner_display'
info.author   = 'Sc0pE'

es.ServerVar('gg_winner_display_ver', info.version).makepublic()

# ==============================================================================
#   GAME EVENTS
# ==============================================================================
def gg_win(event_var):
    # Format variables
    attacker = event_var['attacker']
    attackername = es.getplayername(attacker).replace('&','%26')
    username = es.getplayername(event_var['userid']).replace('&','%26')
    steamid = es.getplayersteamid(attacker)
    wins = gungamelib.getWins(steamid)
    place = gungamelib.getWinnerRank(steamid) if steamid != 'BOT' else 'BOT'
    totalPlaces = gungamelib.getTotalWinners()
   
    # Send MOTD
    gamethread.delayed(0.5, sendDisplay, (attackername, username, wins, place, totalPlaces))

# ==============================================================================
#   HELPER FUNCTIONS
# ==============================================================================
def sendDisplay(attackername, username, wins, place, totalPlaces):
    for userid in es.getUseridList():
        usermsg.motd(userid, 2, 'GunGame Winner', '%s?winnerName=%s&loserName=%s&wins=%s&place=%s&totalPlaces=%s' % (gungamelib.getVariableValue('gg_winner_display_page'), attackername, username, wins, place, totalPlaces))



I am getting the same error after transfering my gg server to gameservers.com, it worked on the other provider. Gungame works, as well as the !ranks commands and all other es scripts, but the winner display is always showing 0 wins, and -1 rank of 0.

Something to do with gungamelib?
onslaught

Private
Private
 
Posts: 17
Joined: Sat Jan 31, 2009 5:23 am

Postby onslaught » Thu Feb 05, 2009 10:51 am

hate to bump so early, but this is the only thing stopping my gameserver from being opened, would really like to fix it now before the server gets people and i have to constantly reload...

If anyone knows a solution, i would greatly appreciate it, thanks
onslaught

Private
Private
 
Posts: 17
Joined: Sat Jan 31, 2009 5:23 am

Re: gg_winner_display

Postby fdgbowser » Thu May 28, 2009 9:20 pm

I'm having a bit of trouble getting this to work on my server

Image

My gg_winner_display.cfg
// Enable / Disable gg_winner_display
// Enable = 1 / Disable = 0
gg_winner_display 1

// Custom web page
// Leave this as default unless you want to have a customised winner page (hosted on your own web server).
// If you want to host the file on your web server, the file is here: viewtopic.php?f=17&t=162
//
// Default = http://gungame5.com/gg5_win.php
gg_winner_display_page "http://fdgaming.com/Wonder/gg5_win.php"


And, the link to our custom layout

http://fdgaming.com/Wonder/gg5_win.php

I have tried re-installing several times, I get the same error with the default page you have provided. I have updated my usermsg (I think I have, I downloaded the file and renamed it to replace my previous usermsg). I have no idea whats wrong, I remember installing this same addon on another server a few months ago and it worked perfectly on the first go. Can anyone help?
fdgbowser

Private
Private
 
Posts: 5
Joined: Thu May 28, 2009 9:13 pm

Postby Warren » Fri May 29, 2009 3:48 am

What is your server IP?
Warren

Site Admin
Site Admin
 
Posts: 772
Joined: Fri Sep 05, 2008 2:59 am
Location: Boston, MA
Xfire Name: WMA9000

Postby fdgbowser » Fri May 29, 2009 4:07 am

63.251.20.35:27015
fdgbowser

Private
Private
 
Posts: 5
Joined: Thu May 28, 2009 9:13 pm

Postby Warren » Fri May 29, 2009 5:17 am

The link on your server:
http://fdgaming.com/wonder/gg5_win.php

The link you mentioned:
http://fdgaming.com/Wonder/gg5_win.php

It appears your website is case sensitive.
Warren

Site Admin
Site Admin
 
Posts: 772
Joined: Fri Sep 05, 2008 2:59 am
Location: Boston, MA
Xfire Name: WMA9000

Postby fdgbowser » Fri May 29, 2009 5:46 am

Well, now I feel a little silly.

It works now, thanks for taking a look at it Warren.
fdgbowser

Private
Private
 
Posts: 5
Joined: Thu May 28, 2009 9:13 pm

Postby Warren » Fri May 29, 2009 5:49 am

No problem.

I like the way you styled the display page by the way.
Warren

Site Admin
Site Admin
 
Posts: 772
Joined: Fri Sep 05, 2008 2:59 am
Location: Boston, MA
Xfire Name: WMA9000

Postby fdgbowser » Fri May 29, 2009 6:02 am

Yep, Wonder did a good job with it.

The darker background makes it easier on the eyes, then we just had slap our logo on there. =)

Now we just have to smooth out some minor sound issues and the server will be good to go.
fdgbowser

Private
Private
 
Posts: 5
Joined: Thu May 28, 2009 9:13 pm

Re: gg_winner_display

Postby BucKeT » Tue Jul 21, 2009 11:27 pm

Just out of curiosity, If I wanted to edit this and host it on my web server, where would I place it? In what directory on my web server? Thanks
Wear short sleeves "Support the right to bear arms"
BucKeT

Private
Private
User avatar
 
Posts: 40
Joined: Thu Dec 04, 2008 1:44 am
Location: Florida
Steam Friends Name: lomm_razz

Postby Warren » Tue Jul 21, 2009 11:45 pm

You can choose in ../cfg/gungame5/custom_addon_configs/gg_winner_display.cfg
gg_winner_display.cfg wrote:// Default = http://gungame5.com/gg5_win.php
gg_winner_display_page "http://gungame5.com/gg5_win.php"
Warren

Site Admin
Site Admin
 
Posts: 772
Joined: Fri Sep 05, 2008 2:59 am
Location: Boston, MA
Xfire Name: WMA9000

Re:

Postby BucKeT » Wed Jul 22, 2009 2:08 am

Warren wrote:You can choose in ../cfg/gungame5/custom_addon_configs/gg_winner_display.cfg
gg_winner_display.cfg wrote:// Default = http://gungame5.com/gg5_win.php
gg_winner_display_page "http://gungame5.com/gg5_win.php"

Thanks for the reply Warren. So if I put my sites url in place of "http://gungame5.com/gg5_win.php" will I need to add anything to my web server for it to work? Below is what I wanted to change it to.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>GunGame Winner</title>
<style type="text/css">
body {
background:#98AFC7;
font-family:Verdana,Tahoma;
color:#000000;
vertical-align:middle;
}
</style>
</head>
<body>
<table height="100%" topmargin="0" bottommargin="0" align="center" cellpadding="0" cellspacing="0">
<tr align="center" valign="middle">
<td valign="middle">
<table><tr><td>
<img src="http://www.gungame5.com/images/gungame5_logo.png">&nbsp;&nbsp;</td><td>
<b><?php print ($_GET["winnerName"]); ?></b> Won!<hr><br />
<b><?php print ($_GET["winnerName"]); ?></b> won the game by killing <b><?php print ($_GET["loserName"]); ?></b><br /><br />
<b>Stats:</b><br />
Wins: <b><?php print ($_GET["wins"]); ?></b><br />
Place: <b><?php print ($_GET["place"]); ?></b> of <b><?php print ($_GET["totalPlaces"]); ?></b></td></tr><tr><td colspan="2" align="center"><br><br><b>Visit our forums at <a href="http://thebucketsplace.com">http://www.thebucketsplace.com</b></a></td></tr></table></td></tr></table>
</body>
</html>
Wear short sleeves "Support the right to bear arms"
BucKeT

Private
Private
User avatar
 
Posts: 40
Joined: Thu Dec 04, 2008 1:44 am
Location: Florida
Steam Friends Name: lomm_razz

PreviousNext


Return to Downloads

Who is online

Users browsing this forum: No registered users and 6 guests

cron