gg_winner_display

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

gg_winner_display

Postby Warren » Sun Oct 26, 2008 4:41 am

gg_winner_display

Description:
When someone wins the game, a MOTD window pops up containing information about the winner.

Image

Installation:

      Customize **NOT REQUIRED** (host on your own web server):
        If you wish to adjust the layout of the page, you can host it on your own website. Save this code as gg5_win.php and adjust it to your likings:
        <html>
        <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>GunGame Winner</title>
        <style type="text/css">
        body {
            background:#CCCCCC;
            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>Powered by <a href="http://gungame5.com">http://www.gungame5.com</a></td></tr></table></td></tr></table>
        </body>
        </html>

        Also, you will need to edit gg_winner_display_page located in cfg/gungame5/custom_addon_configs/gg_winner_display.cfg

Servers running this addon:
http://www.game-monitor.com/search.php? ... e=variable

EventScripts Addon Manager
http://addons.eventscripts.com/addons/v ... er_display

Download
Warren

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

Postby IPS TOONCES » Sun Oct 26, 2008 4:46 am

cool i just put it on the server
Last edited by IPS TOONCES on Tue Feb 10, 2009 10:57 pm, edited 1 time in total.
IPS TOONCES

Beta Tester
Beta Tester
 
Posts: 85
Joined: Sat Oct 04, 2008 12:34 am
Location: Chico, CA
Steam Friends Name: GENERAL-TOONCES

Re: gg_winner_display

Postby slipknot » Sun Oct 26, 2008 5:54 am

Don just loaded it up and it is very nice. :!: :D
It's better to burn out, than fade away.
slipknot

Site Admin
Site Admin
User avatar
 
Posts: 72
Joined: Sun Sep 07, 2008 12:21 am
Location: Hawthorne, CA
Steam Friends Name: sfmeyer1
Xfire Name: slipknotsfm

Postby Don » Sun Oct 26, 2008 6:03 am

This is SWEET!
Don

Site Admin
Site Admin
User avatar
 
Posts: 529
Joined: Fri Sep 05, 2008 3:05 am
Location: The Valley
Steam Friends Name: Don
Xfire Name: donlafferty

Postby your-name-here » Sun Oct 26, 2008 3:23 pm

:O

Great job Sc0pE :p
your-name-here

Site Admin
Site Admin
User avatar
 
Posts: 115
Joined: Sat Sep 06, 2008 5:56 pm
Steam Friends Name: your-name-here
Xfire Name: thinkerroad

Postby Warren » Sun Oct 26, 2008 5:43 pm

Updated: In version 1.0.1 there is a half second delay before sending the page so that it will be displayed on top of the end of game scores page.
Warren

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

Postby Warren » Mon Oct 27, 2008 12:23 am

Updated: Previous versions that use our web server will no longer function.
There were major issues with characters in player names breaking the page, and now, in version 1.0.2 this has been fixed.
The .py file was the only thing changed (if you were hosting on your own website, update the php page also).
Warren

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

Postby IPS TOONCES » Mon Oct 27, 2008 12:37 am

thanks. updated

**what lines do i edit to remove the white-text gg_win message in the CENTER of the screen so it doesn't cover up the winner display name? I like having the gg_win message at the top of the screen, but the middle one is getting in the way if this new addon is enabled
IPS TOONCES

Beta Tester
Beta Tester
 
Posts: 85
Joined: Sat Oct 04, 2008 12:34 am
Location: Chico, CA
Steam Friends Name: GENERAL-TOONCES

Postby mikaboshi » Mon Oct 27, 2008 1:29 pm

Hi i love this. Anyhow it just doesnt seem to work here :(. Can some one help me?

I updated the provided usermsg (did it with removing old usermsg, uploading new as usermsg.py & userms_271.py)
uploaded the custom addon
tried it with the gungame5.com/gg5_win.php & hosting one on our server, but when their is a winner, the gg5_win.php never comes out. Any help please?

edit: i did unload & reload gungame

Edit:
ok i'm not sure what i did, but suddenly it worked :s.
mikaboshi

Private
Private
 
Posts: 12
Joined: Wed Oct 15, 2008 1:50 am
Steam Friends Name: saki007
Xfire Name: mikaboshi

Postby Saul » Mon Oct 27, 2008 3:05 pm

You might want to use urllib.urlencode to automatically convert certain characters to the right code.
>>> urllib.urlencode({'winnerName': 'hello there & matrix'})
'winnerName=hello+there+%26+matrix'


Also, I've put the custom web page in a variable in the config (thats what they are there for!).

Heres my new code:
''' (c) 2008 by the GunGame Coding Team

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

# ==============================================================================
#   IMPORTS
# ==============================================================================
# Python imports
import urllib

# 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: Python'
info.version  = '1.0.2'
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)
    username = es.getplayername(event_var['userid'])
    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):
    # Encode the URL
    encoded = urllib.urlencode({
                               'winnerName': attackername,
                               'loser': username,
                               'wins': wins,
                               'place': place,
                               'totalPlaces': totalPlaces,
    })
   

    # Send MOTD
    usermsg.motd('#all', 2, 'GunGame Winner', '%s?%s' % (gungamelib.getVariableValue('gg_winner_display_page'), encoded))


New config:
// 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.
//
// Default = http://gungame5.com/gg5_win.php
gg_winner_display_page "http://gungame5.com/gg_win.php"


Hope you like it ;)
Saul

GunGame5 Developer
GunGame5 Developer
 
Posts: 147
Joined: Sun Sep 07, 2008 3:29 pm
Xfire Name: saul0

Postby mikaboshi » Tue Oct 28, 2008 12:17 am

When someone wins for the first time u get an odd message:
http://users.telenet.be/Looney/kevin/gg5_win_error.JPG
mikaboshi

Private
Private
 
Posts: 12
Joined: Wed Oct 15, 2008 1:50 am
Steam Friends Name: saki007
Xfire Name: mikaboshi

Postby Warren » Tue Oct 28, 2008 12:36 am

Updated: 1.0.3 adds a config option (thanks saul)
Warren

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

Re:

Postby Warren » Tue Oct 28, 2008 12:37 am

mikaboshi wrote:When someone wins for the first time u get an odd message:
http://users.telenet.be/Looney/kevin/gg5_win_error.JPG

Are you hosting the .php file on your own web server?

I don't think that I can reproduce this error. Please re-install and reboot and tell me if the problem persists.
Warren

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

Re: Re:

Postby mikaboshi » Tue Oct 28, 2008 4:32 am

Sc0pE wrote:
mikaboshi wrote:When someone wins for the first time u get an odd message:
http://users.telenet.be/Looney/kevin/gg5_win_error.JPG

Are you hosting the .php file on your own web server?

I don't think that I can reproduce this error. Please re-install and reboot and tell me if the problem persists.


yes, now it uses the one on my webserver. I was trying out things to get it to work & tried that to. Didnt putted it back on the gungame5.com file.
mikaboshi

Private
Private
 
Posts: 12
Joined: Wed Oct 15, 2008 1:50 am
Steam Friends Name: saki007
Xfire Name: mikaboshi

Postby Bogie » Wed Oct 29, 2008 5:58 pm

Does this work with GG4? Or should I wait 'till gg5 is released to load it?
Bogie

Private
Private
 
Posts: 13
Joined: Fri Oct 03, 2008 3:58 pm
Location: Idaho
Steam Friends Name: goober18k

Postby Warren » Wed Oct 29, 2008 6:02 pm

This only works with GunGame5. GunGame4 has something similar built into it.
Warren

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

Postby Bogie » Mon Nov 03, 2008 6:27 pm

rgr, thank you for the info sc0pe. Looks great on the server.
Bogie

Private
Private
 
Posts: 13
Joined: Fri Oct 03, 2008 3:58 pm
Location: Idaho
Steam Friends Name: goober18k

Postby Lob » Thu Nov 13, 2008 12:01 am

Excellent addon Scope. ;)
Lob

Private
Private
User avatar
 
Posts: 9
Joined: Thu Sep 25, 2008 2:10 pm
Steam Friends Name: Lob

Re: gg_winner_display

Postby Tomelyr » Sat Nov 15, 2008 8:31 pm

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Gewinner</title>
<style type="text/css">
body {
    background:#CCCCCC;
    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><? echo ($_GET["winnerName"]); ?></b> hat gewonnen!<hr><br />
<b><? echo ($_GET["winnerName"]); ?></b> hat gewonnen weil er <b><? echo ($_GET["loserName"]); ?></b> getötet hat<br /><br />
<b>Statistik:</b><br />
Wins: <b><? echo ($_GET["wins"]); ?></b><br />
Place: <b><? echo ($_GET["place"]); ?></b> of <b><? echo ($_GET["totalPlaces"]); ?></b></td></tr><tr><td colspan="2" align="center"><br><br>Gesponsert von <a href="http://gungame5.com">http://www.gungame5.com</a></td></tr></table></td></tr></table>
</body>
</html>


If you want a German gg_winner_display use this as gg5_win.php
Tomelyr

Moderator
Moderator
 
Posts: 41
Joined: Sat Nov 15, 2008 2:46 pm
Location: [Germany] Hamburg
Steam Friends Name: mr_fry
Xfire Name: tomelyr

Re: gg_winner_display

Postby PPG_Paula » Sun Nov 30, 2008 5:56 pm

my server doesnt load this custom addon can anyone help me as quick as you can?
PPG_Paula

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

Next


Return to Downloads

Who is online

Users browsing this forum: No registered users and 1 guest

cron