AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   delete (https://forums.alliedmods.net/showthread.php?t=327401)

calcs 09-16-2020 12:51

delete
 
null

drakunovu6 09-16-2020 14:25

Re: need Auto Change HostName in spesific maps
 
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"); 


Supremache 09-16-2020 16:13

Re: need Auto Change HostName in spesific maps
 
3 Attachment(s)
Quote:

Originally Posted by talnaim9999 (Post 2717939)
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

Supremache 09-16-2020 17:40

Re: need Auto Change HostName in spesific maps
 
Quote:

Originally Posted by talnaim9999 (Post 2717965)
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 09-16-2020 18:59

Re: need Auto Change HostName in spesific maps
 
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; }

OciXCrom 09-17-2020 07:39

Re: need Auto Change HostName in spesific maps
 
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

Supremache 09-17-2020 09:24

Re: need Auto Change HostName in spesific maps
 
Quote:

Originally Posted by talnaim9999 (Post 2718023)
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

DJEarthQuake 09-20-2020 01:04

Re: need Auto Change HostName in spesific maps
 
Quote:

Originally Posted by talnaim9999 (Post 2718023)
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); }


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

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