AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   RoundEnd simple plugin (https://forums.alliedmods.net/showthread.php?t=192572)

jozzz 08-11-2012 17:34

RoundEnd simple plugin
 
Hello, I was wondering if someone could help me to make a simple plugin that executes a server command when a round ends in a regular cs game. The command is this: "bot_stop 1" or it could be: sv_alltalk, sv_voiceenable, etc. just to give you an idea.

guipatinador 08-11-2012 17:46

Re: RoundEnd simple plugin
 
PHP Code:

#include < amxmodx >

public plugin_init( )
{
    
register_plugin"new round""1.0.0""guipatinador" )
    
    
register_event"HLTV""event_new_round""a""1=0""2=0" )  
}

public 
event_new_round( )
{
    
server_cmd"sv_alltalk 1" )
    
// more code here    



fysiks 08-11-2012 17:51

Re: RoundEnd simple plugin
 
Quote:

Originally Posted by guipatinador (Post 1769504)
PHP Code:

#include < amxmodx >

public plugin_init( )
{
    
register_plugin"new round""1.0.0""guipatinador" )
    
    
register_event"HLTV""event_new_round""a""1=0""2=0" )  
}

public 
event_new_round( )
{
    
server_cmd"sv_alltalk 1" )
    
// more code here    



Just to clarify, this is when a new round is initiated and not when the round ends.

guipatinador 08-11-2012 17:53

Re: RoundEnd simple plugin
 
Well, today I'm blind...

PHP Code:

#include < amxmodx >

public plugin_init( )
{
    
register_plugin"new round""1.0.0""guipatinador" )
    
    
register_logevent"logevent_round_end"2"1=Round_End" )
}

public 
logevent_round_end( )
{
    
server_cmd"sv_alltalk 1" )
    
// more code here    


More info https://forums.alliedmods.net/showthread.php?t=42159

EDIT: jozzz edited his post!!! I saw new round !

CS-A-Roland 08-12-2012 08:32

Re: RoundEnd simple plugin
 
Mhm... thats interesting for me!
Is it possible to turn of a plugin with this at "map end"?!

And when it could work, how i could realise to turn it on again after the first round of the new map?!
(because you get the event round end also so i think it should also works to check if the "first" round of a map ends?!

Thanks by the way for explanation...

fysiks 08-12-2012 18:08

Re: RoundEnd simple plugin
 
You can "pause" plugins but there is no reason to pause a plugin at the end of a map since the map is over.

CS-A-Roland 08-13-2012 06:48

Re: RoundEnd simple plugin
 
I know atm 2 reasons to test something like that, first is there are a plugin to big and loads to much stuff wich crash the server at mapchange!
Then a Plugin got a broken database funktion, there its also helpful to stop its work before it crash the server.

The nicest way to do would, if possible, creating cvars where the server admin can tell the plugin wich do it to stop or pause another in seconds. So the admin also can test at wich point the bug of the not stable plugin attacks and get more information about "where" he have to search...
Also it could be nice at the mapstart, to see if a plugin loads to much at wich point exactly he says "its to much... error"

Its just a "fast" idea, dont know if this could work, but for me it sounds interesting...

fysiks 08-13-2012 19:01

Re: RoundEnd simple plugin
 
You can't prevent a plugin from loading using a cvar. The plugins will already be loaded before the cvars are checked. As far as debugging, you should simply disable plugins in plugins.ini to find the one that is crashing the server.

CS-A-Roland 08-16-2012 08:50

Re: RoundEnd simple plugin
 
Mhm, i know wich it is! It was just an idea to let it run without watching the server all 30 minutes if he is down. And also it would be a nice workaround for a longer time, while fixing a problem like these plugin have, take a longer time...


All times are GMT -4. The time now is 05:43.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.