[HL2:DM] One Mapchange to Tdm and DM

A place for requesting new Source.Python plugins to be made for your server.

Please request only one plugin per thread.
User avatar
Painkiller
Senior Member
Posts: 725
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

[HL2:DM] One Mapchange to Tdm and DM

Postby Painkiller » Mon Apr 18, 2016 4:35 pm

How could a plugin which for a mapchange on tdm changed
and after another mapchange also create back to dm?
User avatar
VinciT
Senior Member
Posts: 331
Joined: Thu Dec 18, 2014 2:41 am

Re: [HL2:DM] One Mapchange to Tdm and DM

Postby VinciT » Wed Apr 20, 2016 10:06 pm

This should do the trick:

Syntax: Select all

from listeners import OnLevelShutdown
from engines.server import queue_command_string

GAMEMODE = 0

@OnLevelShutdown
def change_gamemode():
global GAMEMODE
GAMEMODE = 1 - GAMEMODE

queue_command_string('mp_teamplay ' + str(GAMEMODE))
Last edited by Ayuto on Tue May 28, 2019 10:50 am, edited 1 time in total.
User avatar
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

Re: [HL2:DM] One Mapchange to Tdm and DM

Postby daren adler » Tue May 28, 2019 6:50 am

Syntax: Select all

2019-05-28 01:10:18 - sp	-	MESSAGE	[SP] Loading plugin 'gamemode'...
2019-05-28 01:10:18 - sp - MESSAGE [SP] Successfully loaded plugin 'gamemode'.
2019-05-28 01:10:18 - sp - MESSAGE [SP] Loading plugin 'scoreboard'...
2019-05-28 01:10:18 - sp - MESSAGE [SP] Successfully loaded plugin 'scoreboard'.
2019-05-28 01:10:18 - sp - MESSAGE [SP] Loading plugin 'explosive'...
2019-05-28 01:10:18 - sp - MESSAGE [SP] Successfully loaded plugin 'explosive'.
2019-05-28 01:10:18 - sp - MESSAGE [SP] Loading plugin 'killmessage'...
2019-05-28 01:10:18 - sp - MESSAGE [SP] Successfully loaded plugin 'killmessage'.
2019-05-28 01:10:18 - sp - MESSAGE [SP] Loading plugin 'headshot'...
2019-05-28 01:10:18 - sp - MESSAGE [SP] Successfully loaded plugin 'headshot'.
2019-05-28 01:10:18 - sp - MESSAGE [SP] Loading plugin 'blood'...
2019-05-28 01:10:18 - sp - MESSAGE [SP] Successfully loaded plugin 'blood'.
2019-05-28 01:10:19 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\gamemode\gamemode.py", line 11, in change_gamemode
engine_server.server_command('mp_teamplay ' + str(GAMEMODE))

AttributeError: '_EngineServer' object has no attribute 'server_command'


2019-05-28 01:10:36 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\gamemode\gamemode.py", line 11, in change_gamemode
engine_server.server_command('mp_teamplay ' + str(GAMEMODE))

AttributeError: '_EngineServer' object has no attribute 'server_command'
User avatar
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

Re: [HL2:DM] One Mapchange to Tdm and DM

Postby daren adler » Tue May 28, 2019 6:55 am

Tryed it, and says that.
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: [HL2:DM] One Mapchange to Tdm and DM

Postby Ayuto » Tue May 28, 2019 10:52 am

I have updated the code above.

I'm glad you figured how to post the errors here on the forum. But please do not make double posts. Your text and the error messages pefectly fit into a single post.
User avatar
Painkiller
Senior Member
Posts: 725
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

Re: [HL2:DM] One Mapchange to Tdm and DM

Postby Painkiller » Tue May 28, 2019 11:08 am

@Ayuto

Would you be able to tie him up there?

viewtopic.php?f=37&t=2031

It would take me a lot further, which is also related to other things

Edit: I think it's because he always tries sm_nextmap. but he can not do anything with it I use map_cycle from iplayer
User avatar
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

Re: [HL2:DM] One Mapchange to Tdm and DM

Postby daren adler » Tue May 28, 2019 8:10 pm

Ok,Thank you. I will try it again.
User avatar
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

Re: [HL2:DM] One Mapchange to Tdm and DM

Postby daren adler » Tue May 28, 2019 8:21 pm

Syntax: Select all

2019-05-28 15:17:37 - sp	-	MESSAGE	[SP] Loading plugin 'sound'...
2019-05-28 15:17:37 - sp - MESSAGE [SP] Successfully loaded plugin 'sound'.
2019-05-28 15:17:37 - sp - MESSAGE [SP] Loading plugin 'gamemode'...
2019-05-28 15:17:37 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\packages\source-python\plugins\command.py", line 162, in load_plugin
plugin = self.manager.load(plugin_name)
File "..\addons\source-python\packages\source-python\plugins\manager.py", line 194, in load
plugin._load()
File "..\addons\source-python\packages\source-python\plugins\instance.py", line 74, in _load
self.module = import_module(self.import_name)
File "..\addons\source-python\plugins\gamemode\gamemode.py", line 7
def change_gamemode()
^

SyntaxError: invalid syntax


2019-05-28 15:17:37 - sp - MESSAGE [SP] Plugin 'gamemode' was unable to be loaded.
2019-05-28 15:17:37 - sp - MESSAGE [SP] Loading plugin 'scoreboard'...
2019-05-28 15:17:37 - sp - MESSAGE [SP] Successfully loaded plugin 'scoreboard'.
2019-05-28 15:17:37 - sp - MESSAGE [SP] Loading plugin 'explosive'...
2019-05-28 15:17:37 - sp - MESSAGE [SP] Successfully loaded plugin 'explosive'.
2019-05-28 15:17:37 - sp - MESSAGE [SP] Loading plugin 'killmessage'...
2019-05-28 15:17:37 - sp - MESSAGE [SP] Successfully loaded plugin 'killmessage'.
2019-05-28 15:17:37 - sp - MESSAGE [SP] Loading plugin 'headshot'...
2019-05-28 15:17:37 - sp - MESSAGE [SP] Successfully loaded plugin 'headshot'.
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: [HL2:DM] One Mapchange to Tdm and DM

Postby Ayuto » Tue May 28, 2019 8:31 pm

Looks like you modified the script above locally. As you can see line 7 of the script above ends with a colon. The error message you posted says that your script doesn't has this colon. That's why you get a SyntaxError.

I'm really getting tired of this...

Return to “Plugin Requests”

Who is online

Users browsing this forum: No registered users and 19 guests