Raised This Month: $51 Target: $400
 12% 

Need 1 plugin /config


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
james 007
Member
Join Date: Dec 2014
Location: Portugal
Old 08-13-2016 , 09:27   Need 1 plugin /config
Reply With Quote #1

Hello Someone can help me a plugin / config example phaco / config appears 1 config.cfg and I get the config in my cs 1.6 permanent
james 007 is offline
james 007
Member
Join Date: Dec 2014
Location: Portugal
Old 08-13-2016 , 12:13   Re: Need 1 plugin /config
Reply With Quote #2

I found this but the configs is only one round on the player and back to stay with it someone can get permanent configs and do not need to use amx_exec_cfg <nick, #userid, authid> want to make player / configs and run automatically

#include <amxmodx>
#include <amxmisc>

new g_config_file[96];

new g_accept_menu;

new g_max_players;

public plugin_init()
{
register_plugin("Execute Player Config", "0.1", "Exolent");

register_concmd("amx_exec_cfg", "CmdConfig", ADMIN_KICK, "<nick, #userid, authid> -- executes config file on player");

get_configsdir(g_config_file, 95);
add(g_config_file, 95, "/client_config.cfg");

g_accept_menu = menu_create("An admin wants to execute a config on you.^nDo you accept?", "MenuAccept");
menu_additem(g_accept_menu, "Yes", "1");
menu_additem(g_accept_menu, "No", "2");
menu_setprop(g_accept_menu, MPROP_PERPAGE, 0);

g_max_players = get_maxplayers();
}

public CmdConfig(plr, level, cid)
{
if( !cmd_access(plr, level, cid, 2) )
{
return PLUGIN_HANDLED;
}

new arg[35];
read_argv(1, arg, 34);
new target = cmd_target(plr, arg, 0);

if( !target )
{
return PLUGIN_HANDLED;
}

menu_display(target, g_accept_menu, 0);

console_print(plr, "[AMXX] A menu has been shown to player to accept the config execution.");

return PLUGIN_HANDLED;
}

public MenuAccept(plr, menu, item)
{
new _access, info[2], callback;
menu_item_getinfo(menu, item, _access, info, 1, "", 0, callback);

if( info[0] == '1' )
{
new name[32];
get_user_name(plr, name, 31);

for( new admin = 1; admin <= g_max_players; admin++ )
{
if( !is_user_connected(admin) || !access(admin, ADMIN_KICK) )
{
continue;
}

client_print(admin, print_chat, "[AMXX] %s accepted the config execution.", name);
}

if( !file_exists(g_config_file) )
{
return;
}

console_print(plr, "^nCommands executed:");

new params[2];
TaskLoadConfig(params, plr);
}
else
{
new name[32];
get_user_name(plr, name, 31);

for( new admin = 1; admin <= g_max_players; admin++ )
{
if( !is_user_connected(admin) || !access(admin, ADMIN_KICK) )
{
continue;
}

client_print(admin, print_chat, "[AMXX] %s refused the config execution.", name);
}
}
}

public TaskLoadConfig(params[], plr)
{
new line = params[0];

new f = fopen(g_config_file, "rt");

new command[128];
new executed, all;

while( !feof(f) )
{
if( all < line )
{
fgets(f, "", 0);
all++;
continue;
}

if( executed >= 20 )
{
params[0] = all;
set_task(0.1, "TaskLoadConfig", plr, params, 2);
fclose(f);

return;
}

fgets(f, command, 127);
trim(command);

all++;

if( !command[0] || command[0] == '/' && command[1] == '/' )
{
continue;
}

client_cmd(plr, "%s", command);
console_print(plr, "%s", command);

executed++;
}

fclose(f);
}
james 007 is offline
james 007
Member
Join Date: Dec 2014
Location: Portugal
Old 10-07-2016 , 09:58   Re: Need 1 plugin /config
Reply With Quote #3

Help ?
james 007 is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 10-09-2016 , 18:13   Re: Need 1 plugin /config
Reply With Quote #4

Let clients decide their cvars by themselves.
__________________
Black Rose is offline
james 007
Member
Join Date: Dec 2014
Location: Portugal
Old 10-10-2016 , 18:46   Re: Need 1 plugin /config
Reply With Quote #5

????
james 007 is offline
Reply



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 19:22.


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