Here the code
# ../scripts/custom/gg_knife_bonus/gg_knife_bonus.py
# ==================================================
# IMPORTS
# ==================================================
# Python Imports
import os
import random
# Eventscripts Imports
import es
# GunGame Imports
from gungame51.core.players.shortcuts import Player
from gungame51.core.addons.shortcuts import AddonInfo
# ==================================================
# ADDON REGISTRATION/INFORMATION
# ==================================================
info = AddonInfo()
info.name = 'gg_res'
info.title = 'GG Round End Sound'
info.author = 'Neka'
info.version = '1.0'
# =============================================================================
# >> LOAD & UNLOAD
# =============================================================================
def load():
global randomResList
randomResList = os.listdir('%s/cstrike/sound/gungame/gg_res/random' % (os.getcwd()))
personalResList = os.listdir('%s/cstrike/sound/gungame/gg_res/personal' % (os.getcwd()))
def unload():
pass
# ==================================================
# GAME EVENTS
# ==================================================
def es_map_start(event_var):
print "KKhkjhkfjdshklHLKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL"
#def es_map_start(event_var):
#setDownload()
# print "ES_MAP_START WORKED!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
def gg_win(event_var):
ggPlayer = Player(event_var['userid'])
player_weapon = ggPlayer.weapon
if player_weapon == "knife":
ggPlayer.give('smokegrenade', True, False)
# =================================================
# CUSTOM FUNCTION
# =================================================
def setDownload():
for i in range(0, len(randomResList)):
if randomResList[i].endswith('wav') or randomResList[i].endswith('mp3'):
es.stringtable('downloadables', 'sound/gungame/gg_res/random/%s' %(randomResList[i]))
# ==================================================
# IMPORTS
# ==================================================
# Python Imports
import os
import random
# Eventscripts Imports
import es
# GunGame Imports
from gungame51.core.players.shortcuts import Player
from gungame51.core.addons.shortcuts import AddonInfo
# ==================================================
# ADDON REGISTRATION/INFORMATION
# ==================================================
info = AddonInfo()
info.name = 'gg_res'
info.title = 'GG Round End Sound'
info.author = 'Neka'
info.version = '1.0'
# =============================================================================
# >> LOAD & UNLOAD
# =============================================================================
def load():
global randomResList
randomResList = os.listdir('%s/cstrike/sound/gungame/gg_res/random' % (os.getcwd()))
personalResList = os.listdir('%s/cstrike/sound/gungame/gg_res/personal' % (os.getcwd()))
def unload():
pass
# ==================================================
# GAME EVENTS
# ==================================================
def es_map_start(event_var):
print "KKhkjhkfjdshklHLKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL"
#def es_map_start(event_var):
#setDownload()
# print "ES_MAP_START WORKED!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
def gg_win(event_var):
ggPlayer = Player(event_var['userid'])
player_weapon = ggPlayer.weapon
if player_weapon == "knife":
ggPlayer.give('smokegrenade', True, False)
# =================================================
# CUSTOM FUNCTION
# =================================================
def setDownload():
for i in range(0, len(randomResList)):
if randomResList[i].endswith('wav') or randomResList[i].endswith('mp3'):
es.stringtable('downloadables', 'sound/gungame/gg_res/random/%s' %(randomResList[i]))
What's wrong with this event?