Raised This Month: $248 Target: $400
 62% 

need Auto Change HostName in spesific maps


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
talnaim9999
Member
Join Date: Feb 2018
Location: ISRAEL
Old 09-16-2020 , 12:51   need Auto Change HostName in spesific maps
Reply With Quote #1

Hello AM
im looking for a plugin to change hostname automatic when i change some spesific map

for example im create amxmodx/confings/maps/plugins-surf.ini

so the deafult hostname in server.cfg so i want when i change for example to surf , hostname change to name I choose.

https://forums.alliedmods.net/showthread.php?t=114858
i found this
and try this

Code:
#include <amxmodx>
 
public plugin_init()
{
	 register_logevent("SetName", 2, "1=Round_Start")  
}
 
public SetName()
{
	server_cmd("amx_cvar hostname some host name here")
}
but has some problems
first its write only the first word
and its spam in console every 3-4 min "change host name ...."

so i want when im run the plugin only when map change its change the name
and enough..

maybe for ur guys has other way more simple with one plugin so...

thansk!
talnaim9999 is offline
drakunovu6
Junior Member
Join Date: Sep 2017
Old 09-16-2020 , 14:25   Re: need Auto Change HostName in spesific maps
Reply With Quote #2

This:

PHP Code:
#include <amxmodx>

public plugin_cfg()
    
set_cvar_string("hostname""My surf server");

public 
plugin_init()
    
register_plugin("Changing name""1.0""Drakunovu"); 
drakunovu6 is offline
talnaim9999
Member
Join Date: Feb 2018
Location: ISRAEL
Old 09-16-2020 , 15:16   Re: need Auto Change HostName in spesific maps
Reply With Quote #3

Quote:
Originally Posted by drakunovu6 View Post
This:

PHP Code:
#include <amxmodx>

public plugin_cfg()
    
set_cvar_string("hostname""My surf server");

public 
plugin_init()
    
register_plugin("Changing name""1.0""Drakunovu"); 
doesnt work , also in my server.cfg has

mapchangecfgfile server.cfg

so when i change back to main mod its change to deafult...
talnaim9999 is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 09-16-2020 , 16:13   Re: need Auto Change HostName in spesific maps
Reply With Quote #4

Quote:
Originally Posted by talnaim9999 View Post
Hello AM
im looking for a plugin to change hostname automatic when i change some spesific map

for example im create amxmodx/confings/maps/plugins-surf.ini

so the deafult hostname in server.cfg so i want when i change for example to surf , hostname change to name I choose.

https://forums.alliedmods.net/showthread.php?t=114858
i found this
and try this

Code:
#include <amxmodx>
 
public plugin_init()
{
	 register_logevent("SetName", 2, "1=Round_Start")  
}
 
public SetName()
{
	server_cmd("amx_cvar hostname some host name here")
}
but has some problems
first its write only the first word
and its spam in console every 3-4 min "change host name ...."

so i want when im run the plugin only when map change its change the name
and enough..

maybe for ur guys has other way more simple with one plugin so...

thansk!
Don't put maps tag in .ini file or all maps those have that tag, server name will be changing on them
Tag: "de_ - cs_ - zm_ - bb"
P.s: Not Tested
Attached Files
File Type: sma Get Plugin or Get Source (MapNameChanger.sma - 5 views - 1.1 KB)
File Type: ini MapNameChanger.ini (5 Bytes, 2 views)

Last edited by Supremache; 09-16-2020 at 16:16.
Supremache is offline
talnaim9999
Member
Join Date: Feb 2018
Location: ISRAEL
Old 09-16-2020 , 17:07   Re: need Auto Change HostName in spesific maps
Reply With Quote #5

Quote:
Originally Posted by Supremache View Post
Don't put maps tag in .ini file or all maps those have that tag, server name will be changing on them
Tag: "de_ - cs_ - zm_ - bb"
P.s: Not Tested
ty but someone help me with that maybe u can help with more one thing
anyway for ur job i will check it maybe its better xD

Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta_util>


new maxplayers;


public plugin_init() {

register_clcmd( "say /soccer", "CmdSoccer" );

maxplayers = get_maxplayers();
}


public CmdSoccer( )
{
for( new i = 1; i < maxplayers; i++ ) {

if( is_user_alive( i ) ) {

server_cmd( "abh_on 0");
fm_strip_user_weapons( i );
}

public CmdSoccer( )
{
for( new i = 1; i < maxplayers; i++ ) {

if( is_user_alive( i ) ) {

server_cmd( "abh_on 0");
fm_give_item( i, "weapon_knife" );
}
}

plugin should turn off bhop & strip Teror players team
so two things need to do

only for T
and add in same commands /soccer , to back the weapon (knife) & turn on bhop

also if its possible do it only for admin & CT Team
ty!
talnaim9999 is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 09-16-2020 , 17:40   Re: need Auto Change HostName in spesific maps
Reply With Quote #6

Quote:
Originally Posted by talnaim9999 View Post
ty but someone help me with that maybe u can help with more one thing
anyway for ur job i will check it maybe its better xD

Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta_util>


new maxplayers;


public plugin_init() {

register_clcmd( "say /soccer", "CmdSoccer" );

maxplayers = get_maxplayers();
}


public CmdSoccer( )
{
for( new i = 1; i < maxplayers; i++ ) {

if( is_user_alive( i ) ) {

server_cmd( "abh_on 0");
fm_strip_user_weapons( i );
}

public CmdSoccer( )
{
for( new i = 1; i < maxplayers; i++ ) {

if( is_user_alive( i ) ) {

server_cmd( "abh_on 0");
fm_give_item( i, "weapon_knife" );
}
}

plugin should turn off bhop & strip Teror players team
so two things need to do

only for T
and add in same commands /soccer , to back the weapon (knife) & turn on bhop

also if its possible do it only for admin & CT Team
ty!
I dont understand you want it for CT or T ???
Supremache is offline
talnaim9999
Member
Join Date: Feb 2018
Location: ISRAEL
Old 09-16-2020 , 18:35   Re: need Auto Change HostName in spesific maps
Reply With Quote #7

Quote:
Originally Posted by Supremache View Post
I dont understand you want it for CT or T ???
to use this command u need be CT/Admin

but The command is executed on the T team

im not sure if its possible turn off the bhop only for T , but if its only strip its ok..

Last edited by talnaim9999; 09-16-2020 at 18:36.
talnaim9999 is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 09-16-2020 , 18:59   Re: need Auto Change HostName in spesific maps
Reply With Quote #8

Try it:

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fakemeta_util> #define PLUGIN "Soccer" #define VERSION "1.0" #define AUTHOR "Supremache" #define ADMIN_FLAG ADMIN_ADMIN new g_iMaxPlayers public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_clcmd( "say /soccer", "CmdSoccer");     g_iMaxPlayers = get_maxplayers();     } public CmdSoccer(id) {     if(cs_get_user_team(id) != CS_TEAM_CT && get_user_flags(id) != ADMIN_FLAG)         return PLUGIN_HANDLED;     for( new i = 1; i < g_iMaxPlayers; i++ )     {         if( is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T )         {             server_cmd( "abh_on 0");             fm_strip_user_weapons( i );             fm_give_item( i, "weapon_knife" );         }     }     return PLUGIN_CONTINUE; }
Supremache is offline
talnaim9999
Member
Join Date: Feb 2018
Location: ISRAEL
Old 09-17-2020 , 05:47   Re: need Auto Change HostName in spesific maps
Reply With Quote #9

Quote:
Originally Posted by Supremache View Post
Try it:

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fakemeta_util> #define PLUGIN "Soccer" #define VERSION "1.0" #define AUTHOR "Supremache" #define ADMIN_FLAG ADMIN_ADMIN new g_iMaxPlayers public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_clcmd( "say /soccer", "CmdSoccer");     g_iMaxPlayers = get_maxplayers();     } public CmdSoccer(id) {     if(cs_get_user_team(id) != CS_TEAM_CT && get_user_flags(id) != ADMIN_FLAG)         return PLUGIN_HANDLED;     for( new i = 1; i < g_iMaxPlayers; i++ )     {         if( is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T )         {             server_cmd( "abh_on 0");             fm_strip_user_weapons( i );             fm_give_item( i, "weapon_knife" );         }     }     return PLUGIN_CONTINUE; }
its doesnt work , just turn off the bhop and not turn back when im write again..


and its not strip.. ( when i say strip its strip to no weapon..)
talnaim9999 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 09-17-2020 , 07:39   Re: need Auto Change HostName in spesific maps
Reply With Quote #10

You don't need a plugin for this. You can setup map-specific configuration files just like you can setup custom plugins.ini.

The file path should be the following: "configs/maps/mapname.cfg"
You can also use prefixes: "configs/maps/prefix_surf.cfg"

So you can put your custom cvar (hostname) in that file, and have the default one in server.cfg.
More info here - https://wiki.alliedmods.net/Configur...p_Config_Files
__________________

Last edited by OciXCrom; 09-17-2020 at 07:39.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:01.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode