gg_winner_display

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

Postby Warren » Sun Nov 13, 2011 7:31 pm

Updated to version 2.0.2, adding support for the gg_teamplay addon. This update is for the addon itself (which you can download from the attachment) as well as the PHP file, if you chose to host it on your own server.

Here's an example of how it would look when used with teamplay.

Big thanks to Satoon101 and sarge*at*daggerclan.net for giving me the idea to incorporate teamplay and testing.
Warren

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

Postby PlasteR » Sun Nov 13, 2011 7:32 pm

Hello. I found a bug in gg_winner_display for GG5.1. It does not add to gg_winner_display winning only displays a map before trying to win. See the video sry somehow weak, sluggish computer. http://www.youtube.com/watch?v=m6QTPoP3_fI start with 4 wins, the payout on the map display in gg_winner_display fourth. no add last win. Translation google:
PlasteR

Private
Private
 
Posts: 15
Joined: Thu Feb 24, 2011 11:46 am
Steam Friends Name: PlasteR

Postby daggerclan » Mon Nov 14, 2011 7:52 pm

This is working great on my teamplay server. Just remember to copy the new code from the first post and modify it to suit your needs if you plan to host your own file.

http://cloud.steampowered.com/ugc/594702184995286611/BF07D92477D527CC94A28A3715919B0AE41E32E1/
daggerclan

Corporal
Corporal
User avatar
 
Posts: 250
Joined: Mon Jul 13, 2009 7:54 pm
Location: United States

Re:

Postby Warren » Sun Nov 27, 2011 5:42 am

PlasteR wrote:Hello. I found a bug in gg_winner_display for GG5.1. It does not add to gg_winner_display winning only displays a map before trying to win. See the video sry somehow weak, sluggish computer. http://www.youtube.com/watch?v=m6QTPoP3_fI start with 4 wins, the payout on the map display in gg_winner_display fourth. no add last win. Translation google:

I have a hunch that the way we store and retrieve wins fires differently on different servers or even on different wins.

Try using this, instead of your current ../addons/eventscripts/gungame/scripts/custom/gg_winner_display/gg_winner_display.py, restart your server, and let me know if it helps:
# ../addons/eventscripts/gungame/scripts/custom/gg_winner_display/gg_winner_display.py

# ============================================================================
# >> IMPORTS
# ============================================================================
# Python Imports
import urllib

# Eventscripts Imports
import es
import gamethread
import usermsg

# GunGame Imports
from gungame51.core.addons.shortcuts import AddonInfo
from gungame51.core.sql import Database
from gungame51.core.sql.shortcuts import get_rank
from gungame51.core.sql.shortcuts import get_winner_count

# ============================================================================
# >> ADDON REGISTRATION/INFORMATION
# ============================================================================
info = AddonInfo()
info.name = "gg_winner_display"
info.title = "GG Winner Display"
info.author = "Warren Alpert"
info.version = "2.0.21"

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

# ============================================================================
# >> GLOBAL VARIABLES
# ============================================================================
gg_winner_display_page = es.ServerVar("gg_winner_display_page")

# ============================================================================
# >> LOAD & UNLOAD
# ============================================================================
def load():
    es.dbgmsg(0, "Loaded: %s" % info.name)

def unload():
    es.dbgmsg(0, "Unloaded: %s" % info.name)

# ============================================================================
# >> GAME EVENTS
# ============================================================================
def gg_win(event_var):
    winner = event_var["winner"]

    # Get the winner and loser's names
    winnername = es.getplayername(winner)
    losername = es.getplayername(event_var["loser"])

    # Get the winner's steamid
    steamid = es.getplayersteamid(winner)

    # Get the winner's place and the total number of places
    place = get_rank(steamid) if steamid != "BOT" else "BOT"
    totalPlaces = get_winner_count()

    # Delay so that their scoreboard doesn't cover it
    gamethread.delayed(0.5, send_display, (winnername, losername, steamid, place,
                                                                totalPlaces))

def gg_team_win(event_var):
    # Get the name of the winning team, if we are using gg_teamplay
    winningTeam = ("Terrorist" if int(event_var["winner"]) == 2 else
                                                        "Counter-Terrorist")

    # Delay so that their scoreboard doesn't cover it
    gamethread.delayed(0.5, usermsg.motd, ("#human", 2,
        "GunGame Winner","%s?%s" % (gg_winner_display_page,
        urllib.urlencode({"winningTeam":winningTeam}))))

# ============================================================================
# >> CUSTOM/HELPER FUNCTIONS
# ============================================================================
def send_display(winnername, losername, steamid, place, totalPlaces):
    # Get the winner's wins
    wins = Database().select("gg_wins", "wins", 'WHERE uniqueid="%s"' % \
                                                                    steamid)
   
    # Send the winner display MOTD window
    usermsg.motd("#human", 2, "GunGame Winner","%s?%s" % (
            gg_winner_display_page, urllib.urlencode({
                "winnerName":winnername, "loserName":losername, "wins":wins,
                "place":place, "totalPlaces":totalPlaces})))
Warren

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

Postby PlasteR » Tue Nov 29, 2011 2:10 pm

@Up

First test and work :) Thx :)

I will check for a few days in case of write errors (translate google)
PlasteR

Private
Private
 
Posts: 15
Joined: Thu Feb 24, 2011 11:46 am
Steam Friends Name: PlasteR

Postby Gibhunter » Sat Mar 24, 2012 3:26 pm

I tried this plugin using my own website and it crashed every time the round was over.. turned out moving the winner.php file to another website of mine fixed it. I think cloudflare which was on the first site had something to do with screwing it up. Just saying in case anyone else has this problem. I was hoping to use the cloudflare site since it would cache the winner page and load faster and use fewer resources.
Gibhunter

Private
Private
 
Posts: 7
Joined: Sun Mar 11, 2012 12:53 am

Re: gg_winner_display

Postby tnarocks » Fri Dec 14, 2012 8:18 am

Not sure if its working right for me. This is what i get
Attachments
winner display.png
tnarocks

Corporal
Corporal
 
Posts: 315
Joined: Mon Jan 25, 2010 3:56 pm
Location: Florida
Steam Friends Name: {TAG}TNA ROCKS(ENGAGED)

Postby daggerclan » Fri Dec 14, 2012 5:02 pm

Looks like http://gungame.net/gg5_win.php link isn't working.
daggerclan

Corporal
Corporal
User avatar
 
Posts: 250
Joined: Mon Jul 13, 2009 7:54 pm
Location: United States

Postby tnarocks » Fri Dec 14, 2012 5:14 pm

Its working now i deleted the addon and the config file and reinstalled it and changed the address and its working again.
tnarocks

Corporal
Corporal
 
Posts: 315
Joined: Mon Jan 25, 2010 3:56 pm
Location: Florida
Steam Friends Name: {TAG}TNA ROCKS(ENGAGED)

Previous


Return to Downloads

Who is online

Users browsing this forum: No registered users and 2 guests

cron