Restart the round

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Re: Restart the round

Postby satoon101 » Thu Sep 22, 2016 3:37 am

You do realize that that entity gets removed when the round resets, right? So, it's only on the server for around 5 seconds. It's not like creating 1 entity is going to hurt the server in any way. The only possible issue is hitting the entity limit. But, if you're that concerned about doing that, you should avoid "ever" creating any entities for any reason in any of your plugins. I would much rather not worry about that, avoid removing a cheat flag, and ending the round in the much more proper way.
Image
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Re: Restart the round

Postby iPlayer » Thu Sep 22, 2016 3:38 am

L'In20Cible wrote:
iPlayer wrote:However, I just pointed out that there was better (in my opinion) alternatives but you really seems to be on the defensive and sticky on that method so next time I will just avoid proposing them. :wink:

You do realize that this statement may make somebody (e.g. iPlayer in this discussion) feel kinda like an offensive, arrogant person instead of just feeling like there was a fine discussion?

Don't be like that.

Also, nobody explained why the original code stopped working (with server_execute). If it literally means this:
1. Strip CHEAT flag
2. Add endround to the queue
3. Execute the queue
4. Apply CHEAT flag
This seems like a flawless code to me, so the reason I stood on the side of endround is that because I wanted somebody to come up and explain why the code wouldn't work now. Instead I was told to use another approach and now I feel like I've lost further technical support from Invincible's side.
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Re: Restart the round

Postby satoon101 » Thu Sep 22, 2016 3:44 am

Literally nothing in the code around that has changed. So, why it no longer works doesn't make sense to me if it did work a week ago (assuming you tested this code previously and had it working).

I honestly disagree with this statement:
iPlayer wrote:This seems like a flawless code to me

I will personally never agree that any code involving removing cheat flags or setting sv_cheats is "flawless".

However, the fact that the server_execute doesn't seem to be flushing commands in a timely manner is an issue that does need addressed outside of the rest of this discussion.
Image
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Re: Restart the round

Postby iPlayer » Thu Sep 22, 2016 3:47 am

satoon101 wrote:You do realize that that entity gets removed when the round resets, right? So, it's only on the server for around 5 seconds. It's not like creating 1 entity is going to hurt the server in any way. The only possible issue is hitting the entity limit. But, if you're that concerned about doing that, you should avoid "ever" creating any entities for any reason in any of your plugins. I would much rather not worry about that, avoid removing a cheat flag, and ending the round in the much more proper way.

Makes sense. So it's basically "messing cvar flags on server cvar" vs "hitting the entity limit (which I agree is a non-existant problem)".

I will go with info_map_parameters in my plugin. But if somebody explained more cons of stripping/setting CHEAT flag (besides messing cvar flags up, which can be avoided with a simple check), that'd be really nice.

assuming you tested this code previously and had it working

I can assure you, it did work. But that was even before find_command_base was removed and split into multiple methods.

I honestly disagree with this statement:

I meant "flawless" in a way that there's no possible logic errors in the simpliest 4 steps.
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Re: Restart the round

Postby satoon101 » Thu Sep 22, 2016 3:50 am

Oh, for some reason I missed the fact that this thread was started almost a year ago, and that was when the code was posted. We will look into this, but it will likely be fixed when these changes are made.
Image
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: Restart the round

Postby L'In20Cible » Thu Sep 22, 2016 4:11 am

iPlayer wrote:
L'In20Cible wrote:
iPlayer wrote:However, I just pointed out that there was better (in my opinion) alternatives but you really seems to be on the defensive and sticky on that method so next time I will just avoid proposing them. :wink:

You do realize that this statement may make somebody (e.g. iPlayer in this discussion) feel kinda like an offensive, arrogant person instead of just feeling like there was a fine discussion?

Don't be like that.

I'm sorry, that was not my intention. What I meant by that is that I was not going to argue more on that topic since you seemed to absolutely want to use the former over the proposed alternative. But there is no anger/grudge, no worries. :)
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Re: Restart the round

Postby iPlayer » Thu Sep 22, 2016 4:21 am

Okay, there must have been a misunderstanding then, thanks for clarifying :)
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image
sl0
Junior Member
Posts: 4
Joined: Thu Dec 01, 2016 11:30 pm

Re: Restart the round

Postby sl0 » Fri Dec 02, 2016 8:42 pm

any ideas why now `execute_server_command('mp_restartgame', 1)` failed with `ValueError: Unable to find command 'mp_restartgame'.` ?
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Re: Restart the round

Postby iPlayer » Fri Dec 02, 2016 9:28 pm

I guess that's a console variable, not a command. So you need to find it and set it to 1.
There must be some Source handler attached to that variable.
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Restart the round

Postby Ayuto » Fri Dec 02, 2016 10:08 pm

Yep, it's a console variable, so you need to use one of these 3 possibilities:

Syntax: Select all

# No. 1
mp_restartgame = ConVar('mp_restartgame')
mp_restartgame.set_int(1)

# No. 2
queue_command_string('mp_restartgame 1')

# No. 3
mp_restartgame = cvar.find_var('mp_restartgame')
mp_restartgame.set_int(1)
sl0
Junior Member
Posts: 4
Joined: Thu Dec 01, 2016 11:30 pm

Re: Restart the round

Postby sl0 » Fri Dec 02, 2016 10:11 pm

tnx, guys

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 34 guests