AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Force Join Team (Humans & Bots) (https://forums.alliedmods.net/showthread.php?t=107398)

Apollyon 10-26-2009 03:38

Force Join Team (Humans & Bots)
 
Is it possible to hard-code these server.cfg cvars into a plugin?

humans_join_team ct
bot_join_team t

Maybe a line in the "public plugin_init" section.

xPaw 10-26-2009 04:37

Re: Hard Code Server cvars
 
Add it to amxx.cfg :/

Apollyon 10-26-2009 13:37

Re: Hard Code Server cvars
 
This code works. The problem is, just like when it's used and changed in a .cfg file, a mapchange is required for the changes to take effect.

Is there a way to code a plugin to force the teams, as done with these cvars, while using an "sv_restart 1" command instead of a mapchange? I would like to be able to use this code in 2 separate plugins, with the teams reversed, along with this Multimod plugin.

PHP Code:

/* Script generated by Pawn Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN    "New Plugin"
#define AUTHOR    "Unknown"
#define VERSION    "1.0"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
plugin_cfg() {
    
set_cvar_string"humans_join_team""t" )
    
set_cvar_string"bot_join_team""ct" )



Exolent[jNr] 10-26-2009 15:30

Re: Hard Code Server cvars
 
PHP Code:

/* Script generated by Pawn Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN    "New Plugin"
#define AUTHOR    "Unknown"
#define VERSION    "1.0"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
plugin_precache() {
    
set_cvar_string"humans_join_team""t" )
    
set_cvar_string"bot_join_team""ct" )
    
set_cvar_num"sv_restart")




All times are GMT -4. The time now is 17:37.

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