Have been testing using Hero Wars and some custom scripts, will share if you require to see them
![Smile :)](./images/smilies/smile.png)
Thanks All!
Syntax: Select all
##
##
##
from commands import CommandReturn
from commands.say import SayFilter
from messages import SayText2
from paths import PLUGIN_PATH
from translations.strings import LangStrings
##
##
##
strings = LangStrings('tags/tags')
@SayFilter
def say_filter(playerinfo, teamonly, command):
steamid = playerinfo.get_networkid_string()
if command.get_arg_string() == '""':
return CommandReturn.CONTINUE
if not '{0} {1}'.format(steamid, 'Text') in strings:
text = strings['Default Text'].get_string('en', text=command.get_arg_string().replace('"', ''))
name = strings['Default Name'].get_string('en', name=playerinfo.get_name())
message = '{name} : {text}'.format(name=name, text=text)
SayText2(message=message).send()
return CommandReturn.BLOCK
text = strings['{0} {1}'.format(steamid, 'Text')].get_string('en', text=command.get_arg_string().replace('"', ''))
name = strings['{0} {1}'.format(steamid, 'Name')].get_string('en', name=playerinfo.get_name())
message = '{name} : {text}'.format(name=name, text=text)
SayText2(message=message).send()
return CommandReturn.BLOCK
Syntax: Select all
[SP] Loading plugin 'hw'...
[SP] Successfully loaded plugin 'hw'.
---- Host_Changelevel ----
*** Map Load: de_dust: Map Group mg_bombKeyValues Error: LoadFromBuffer: missing { in file gamemodes_server.txt
KeyValues Error: LoadFromBuffer: missing { in file gamemodes_server.txt
KeyValues Error: LoadFromBuffer: missing { in file gamemodes_server.txt
KeyValues Error: LoadFromBuffer: missing { in file gamemodes_server.txt
GameTypes: missing mapgroupsSP entry for game type/mode (custom/custom).
Syntax: Select all
from listeners import LevelInit
@LevelInit
def level_init(map_name):
global player_list
player_list = list()
Syntax: Select all
from listeners import LevelInit
@LevelInit
def level_init(map_name):
player_list.clear()
Syntax: Select all
class PlayerDictionary(dict):
def __missing__(self, userid):
value = self[userid] = PlayerEntitySubClass(index_from_userid(userid))
return value
def __delitem__(self, userid):
if userid in self:
super(PlayerDictionary, self).__delitem__(userid)
player_dictionary = PlayerDictionary()
@LevelShutdown
def level_shutdown():
player_dictionary.clear()
Syntax: Select all
##
##
##
from os.path import dirname
from engines.server import engine_server
from listeners import LevelShutdown, LevelInit
##
##
##
with open(dirname(__file__) + '/plugins.txt') as f:
lines = f.readlines()
plugins = list(lines)
##
##
##
@LevelInit
def level_init(map_name):
for plugin in plugins:
engine_server.server_command('sp load {0}'.format(plugin))
@LevelShutdown
def level_shutdown():
for plugin in plugins:
engine_server.server_command('sp unload {0}'.format(plugin))
Return to “General Discussion”
Users browsing this forum: No registered users and 21 guests