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})))