Raised This Month: $32 Target: $400
 8% 

delete


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
calcs
Junior Member
Join Date: Feb 2018
Old 09-16-2020 , 12:51   delete
Reply With Quote #1

null

Last edited by calcs; 09-07-2023 at 16:21.
calcs is offline
drakunovu6
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
Old 09-16-2020, 15:16
calcs
This message has been deleted by calcs.
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 #3

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 - 95 views - 1.1 KB)
File Type: ini MapNameChanger.ini (5 Bytes, 24 views)

Last edited by Supremache; 09-16-2020 at 16:16.
Supremache is offline
Old 09-16-2020, 17:07
calcs
This message has been deleted by calcs.
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 #4

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
Old 09-16-2020, 18:35
calcs
This message has been deleted by calcs.
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 #5

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
Old 09-17-2020, 05:47
calcs
This message has been deleted by calcs.
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 #6

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
Old 09-17-2020, 09:21
calcs
This message has been deleted by calcs.
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 09-17-2020 , 09:24   Re: need Auto Change HostName in spesific maps
Reply With Quote #7

Quote:
Originally Posted by talnaim9999 View Post
Hi , thanks i know that , but need made for all maps its 10 maps something like that and they run same mod and diffrent prefix so i will need create 10 files in confings/maps/name.cfg

im not sure what is a better way with 1 short plugin or made 10 .cfg
Try this one and if is it not working tell me for fixing it
https://forums.alliedmods.net/showpo...60&postcount=4
Supremache is offline
Old 09-17-2020, 17:58
calcs
This message has been deleted by calcs.
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 09-20-2020 , 01:04   Re: need Auto Change HostName in spesific maps
Reply With Quote #8

Quote:
Originally Posted by talnaim9999 View Post
but need made for all maps its 10 maps something like that and they run same mod and diffrent prefix
Symbolic linking makes quick work of such redundant tasks.

Code:
ln -s custom.cfg de_dust.cfg
ln -s custom.cfg cs_assault.cfg
Auto Change HostName on specific maps. Real good idea. Plugin was made and tested. There are 2 Cvars. One to see what plugin is running and other to change hostname. Just keep the 'usual' hostname in servercfgfile. E.g.

plugin_search "Half-Life GunGame"
plugin_hostname "Official Gungame 2020"


Quote:
Half-Life GunGame plugin found running.
Renaming host.

Half-Life GunGame Copyright (c) 2014 serfreeman1337|SPiNX
Version 2.4 build on 4, Sept (12), 2020
Code:
#include <amxmodx> #define charsmin -1 #if !defined MAX_NAME_LENGTH     #define MAX_NAME_LENGTH 32 #endif new g_Hostname, g_Newhost, g_plugin_seek; public plugin_init() {     register_plugin (       "Hostname by plugin",       "1.0",      "SPiNX" );     g_Newhost       =       register_cvar("plugin_hostname", "Your Server");     g_plugin_seek   =       register_cvar("plugin_search", "Admin Base");     g_Hostname      =       get_cvar_pointer("hostname"); } public plugin_cfg() {     new buffer[ MAX_NAME_LENGTH ];     get_pcvar_string(g_plugin_seek, buffer, charsmax(buffer));     if( is_plugin_loaded(buffer) != charsmin )         {             server_print("%s plugin found running.^nRenaming host.", buffer);             set_task(3.0, "Rename_server");         } } public Rename_server() {     new host[ MAX_NAME_LENGTH ];     get_pcvar_string(g_Hostname, host, charsmax(host));     new buffer[ MAX_NAME_LENGTH ];     get_pcvar_string(g_Newhost, buffer, charsmax(buffer));     if ( !equal(buffer, host, MAX_NAME_LENGTH) )         server_cmd("hostname ^"%s^" ", buffer); }
__________________

Last edited by DJEarthQuake; 09-20-2020 at 01:48. Reason: Example
DJEarthQuake is offline
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 15:17.


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