gg_unloader

Request a custom addon/script you would like to see made.

gg_unloader

Postby ShadowBlade » Mon Nov 30, 2009 8:19 pm

I am requesting a script/addon/plugin that will unload gungame at the end of every map. Can anyone make a script/addon/plugin like this?
ShadowBlade

Private
Private
 
Posts: 8
Joined: Mon Nov 30, 2009 7:43 pm

Postby satoon101 » Mon Nov 30, 2009 9:02 pm

Just put es_unload gungame in your server.cfg. Or is there a reason you need it at the 'end' of a map and not the beginning of the next map?

Satoon
satoon101

Site Admin
Site Admin
 
Posts: 1055
Joined: Thu Oct 09, 2008 4:27 pm

Re: gg_unloader

Postby ShadowBlade » Tue Dec 01, 2009 1:30 am

I planed to use the server config to load gungame, if you have both unload and load in there it sends the server into an inf loop. This was supose to be an attempt to stop the gg reloads that need to be done on our server a few times a day, but I found another post on these forums about a ES fix for it, so I uploaded that, now just waiting to make sure it fixes it.

I am a member of HSx, we run a 18 slot 100tic GG-Turbo server.

Edit: Still having the drops, and still need to manualy reload, so this is the best alternative to the problim, if some one could make a es_script or a gg_script that will unload gungame at the end of a map, I am almost 100% sure it will be downloaded and used by a lot of servers.
ShadowBlade

Private
Private
 
Posts: 8
Joined: Mon Nov 30, 2009 7:43 pm

Postby Rio » Thu Jan 21, 2010 7:11 am

Shadow, i'm going to quickly try and write an ES script for you. Could you post the 'ES fix' link here while you wait?
Should be done in about an hour (i'm busy :P)

EDIT:
A better way to do this would be to try and edit the existing gungame event when someone wins, then it will unload gungame.

Open gungame.py in \addons\eventscripts\gungame in Notepad or your alternative. Hit Ctrl + F and enter;
'PlayerWon_Center',


Once you find this, select the following;
   # Toptext
    if int(event_var['es_attackerteam']) == 2:
        gungamelib.toptext('gungame', '#all', 10, '#red', 'PlayerWon_Center', {'player': playerName})
    else:
        gungamelib.toptext('gungame', '#all', 10, '#blue', 'PlayerWon_Center', {'player': playerName})


and change this to;
   # Toptext
    if int(event_var['es_attackerteam']) == 2:
        gungamelib.toptext('gungame', '#all', 10, '#red', 'PlayerWon_Center', {'player': playerName})
    es.server.queuecmd('es_unload gungame')
    else:
        gungamelib.toptext('gungame', '#all', 10, '#blue', 'PlayerWon_Center', {'player': playerName})
    es.server.queuecmd('es_unload gungame')


Hopefully that will work.

Someone can correct me if this will create errors! :)
Rio

Private
Private
 
Posts: 5
Joined: Thu Jan 21, 2010 7:02 am
Steam Friends Name: Ri_Ri_Thomas

Re: gg_unloader

Postby XE_ManUp » Thu Jan 21, 2010 5:19 pm

I would never suggest altering the original source code for GunGame. That is exactly why we created the ability to code custom addons.

My suggestion would be to code a custom addon to where when someone wins, GunGame is unloaded:

''' (c) 2010 by the GunGame Coding Team

    Title: gg_unloader
    Version: 0.1
    Description: Unloads GunGame when someone wins.
'
''

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


# EventScripts imports
import es

# GunGame imports
import gungamelib

# ==============================================================================
#   ADDON REGISTRATION
# ==============================================================================
# Register this addon with EventScripts
info = es.AddonInfo()
info.name     = 'gg_unloader'
info.version  = '5.0.480'
info.url      = ''
info.basename = 'gungame/custom_addons/unloader'
info.author   = 'XE_ManUp'

# ==============================================================================
#   GAME EVENTS
# ==============================================================================
def load():
    addon = gungamelib.registerAddon('gg_unloader')
    addon.setDisplayName('gg_unloader')
   
def unload():
    gungamelib.unregisterAddon('gg_unloader')

def gg_win(event_var):
    es.server.queuecmd('es_xunload gungame')


I am not claiming this is the "best" solution, but it is certainly better than altering the original source code. ;)
XE_ManUp

Site Admin
Site Admin
 
Posts: 662
Joined: Sat Sep 06, 2008 3:36 am



Return to Script Requests

Who is online

Users browsing this forum: No registered users and 5 guests

cron