Prosiłbym o naprawienie tego pluginu przez niego serwer się crashuje, a w logach występują takie errory
L 02/03/2012 - 22:30:20: Player 2 is not ingame L 02/03/2012 - 22:30:20: [AMXX] Displaying debug trace (plugin "rate.amxx") L 02/03/2012 - 22:30:20: [AMXX] Run time error 10: native error (native "player_menu_info") L 02/03/2012 - 22:30:20: [AMXX] [0] rate.sma::show_menu_ (line 51)
Kod pluginu:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>
#define PLUGIN "Interp Manager"
#define VERSION "1.0"
#define AUTHOR "Hleb"
#define TASK_SHOWMENU 432
new interp_punish_limit;
new interp_punish_type;
new interp_prefix[33];
new interp_warn[33] = 0;
new interp_type[33];
new interp_check[33];
new interp_amxbans;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_Spawn, "player", "client_spawn", 1)
register_cvar("amx_interp_type", "1")
register_cvar("amx_interp_limit", "5")
register_cvar("amx_interp_prefix", "[AMXX]")
register_cvar("amx_interp_amxbans", "0")
interp_punish_limit = get_cvar_num("amx_interp_limit");
interp_punish_type = get_cvar_num("amx_interp_type");
interp_amxbans = get_cvar_num("amx_interp_amxbans");
get_cvar_string("amx_interp_prefix", interp_prefix, 32)
}
public client_putinserver(id)
{
if(!is_user_bot(id))
eventInGame(id);
}
public show_menu_(tid)
{
new id=tid-TASK_SHOWMENU;
new iTeam=get_user_team(id);
new menu_id, keys;
new menuUp = player_menu_info( id, menu_id, keys );
if(get_user_flags(id) & ADMIN_IMMUNITY)
{
client_print(id, print_chat, "%s Jestes Administratorem serwera, wiec ustaw swoj interp we wlasnym zakresie!", interp_prefix)
return PLUGIN_CONTINUE;
}
else
{
if ( iTeam && (menuUp <= 0 || menu_id < 0) )
menu_displayer(id);
else
set_task(10.0, "show_menu_", tid);
}
return PLUGIN_CONTINUE;
}
public eventInGame(id)
{
set_task(10.0, "show_menu_", id+TASK_SHOWMENU);
}
public menu_displayer(id)
{
new menu = menu_create("WYBIERZ SWOJ INTERP!!", "menu_handler")
menu_additem(menu, "Interp - 0.01", "1", 0)
menu_additem(menu, "Interp - 0.02", "2", 0)
menu_additem(menu, "Interp - 0.03", "3", 0)
menu_additem(menu, "Interp - 0.04", "4", 0)
menu_additem(menu, "Interp - 0.05", "5", 0)
menu_display(id, menu, 0)
}
public menu_handler(id, menu, item, type)
{
if (item == MENU_EXIT)
{
return PLUGIN_HANDLED;
}
new data[6], iName[64]
new name[33];
get_user_name(id, name, 32);
new iaccess, callback
menu_item_getinfo(menu, item, iaccess, data,5, iName, 63, callback)
interp_type[id] = str_to_num(data);
switch(interp_type[id])
{
case 1:
{
interp_warn[id] = 0;
client_cmd(id, "cl_updaterate 100");
client_cmd(id, "ex_interp 0.01");
client_cmd(id, "rate 25000");
client_cmd(id, "cl_cmdrate 100");
client_cmd(id, "hud_centerid 0");
client_print(id, print_chat, "%s Wybrales interp 0.01", interp_prefix);
client_print(0, print_chat, "%s Gracz %s ustawil swoj interp na 0.01", interp_prefix, name)
menu_destroy(menu)
return PLUGIN_HANDLED
}
case 2:
{
interp_warn[id] = 0;
client_cmd(id, "cl_updaterate 80");
client_cmd(id, "ex_interp 0.02");
client_cmd(id, "rate 20000");
client_cmd(id, "cl_cmdrate 80");
client_cmd(id, "hud_centerid 0");
client_print(id, print_chat, "%s Wybrales interp 0.02", interp_prefix);
client_print(0, print_chat, "%s Gracz %s ustawil swoj interp na 0.02", interp_prefix, name)
menu_destroy(menu)
return PLUGIN_HANDLED
}
case 3:
{
interp_warn[id] = 0;
client_cmd(id, "cl_updaterate 70");
client_cmd(id, "ex_interp 0.03");
client_cmd(id, "rate 18000");
client_cmd(id, "cl_cmdrate 70");
client_cmd(id, "hud_centerid 0");
client_print(id, print_chat, "%s Wybrales interp 0.03.", interp_prefix);
client_print(0, print_chat, "%s Gracz %s ustawil swoj interp na 0.03", interp_prefix, name)
menu_destroy(menu)
return PLUGIN_HANDLED
}
case 4:
{
interp_warn[id] = 0;
client_cmd(id, "cl_updaterate 60");
client_cmd(id, "ex_interp 0.04");
client_cmd(id, "rate 15000");
client_cmd(id, "cl_cmdrate 60");
client_cmd(id, "hud_centerid 0");
client_print(id, print_chat, "%s Wybrales interp 0.04.", interp_prefix);
client_print(0, print_chat, "%s Gracz %s ustawil swoj interp na 0.04", interp_prefix, name)
menu_destroy(menu)
return PLUGIN_HANDLED
}
case 5:
{
interp_warn[id] = 0;
client_cmd(id, "cl_updaterate 45");
client_cmd(id, "ex_interp 0.05");
client_cmd(id, "rate 10000");
client_cmd(id, "cl_cmdrate 45");
client_cmd(id, "hud_centerid 0");
client_print(id, print_chat, "%s Wybrales interp 0.05.", interp_prefix);
client_print(0, print_chat, "%s Gracz %s ustawil swoj interp na 0.05", interp_prefix, name)
menu_destroy(menu)
return PLUGIN_HANDLED
}
}
menu_destroy(menu)
return PLUGIN_HANDLED
}
public unregister(h)
{
unregister_forward(FM_CmdStart, h, 1)
}
public CheckInterp(id, uc_handle, seed)
{
if(interp_check[id])
{
static value
value = get_uc(uc_handle, UC_LerpMsec)
if(interp_type[id] == 1 && value > 9)
{
interp_warn[id]++;
client_cmd(id, "cl_updaterate 100");
client_cmd(id, "ex_interp 0.01");
client_cmd(id, "rate 25000");
client_cmd(id, "cl_cmdrate 100");
client_print(id, print_chat, "%s Auto ustawienie interpu na 0.01 (WIM %d/%d)",interp_prefix, interp_warn[id], interp_punish_limit)
}
if(interp_type[id] == 2 && value > 18)
{
interp_warn[id]++;
client_cmd(id, "cl_updaterate 80");
client_cmd(id, "ex_interp 0.02");
client_cmd(id, "rate 20000");
client_cmd(id, "cl_cmdrate 80");
client_print(id, print_chat, "%s Auto ustawienie interpu na 0.02 (WIM %d/%d)",interp_prefix, interp_warn[id], interp_punish_limit)
}
if(interp_type[id] == 3 && value > 28)
{
interp_warn[id]++;
client_cmd(id, "cl_updaterate 70");
client_cmd(id, "ex_interp 0.03");
client_cmd(id, "rate 18000");
client_cmd(id, "cl_cmdrate 70");
client_print(id, print_chat, "%s Auto ustawienie interpu na 0.03 (WIM %d/%d)",interp_prefix, interp_warn[id], interp_punish_limit)
}
if(interp_type[id] == 4 && value > 39)
{
interp_warn[id]++;
client_cmd(id, "cl_updaterate 60");
client_cmd(id, "ex_interp 0.04");
client_cmd(id, "rate 15000");
client_cmd(id, "cl_cmdrate 60");
client_print(id, print_chat, "%s Auto ustawienie interpu na 0.04 (WIM %d/%d)",interp_prefix, interp_warn[id], interp_punish_limit)
}
if(interp_type[id] == 5 && value > 50)
{
interp_warn[id]++;
client_cmd(id, "cl_updaterate 45");
client_cmd(id, "ex_interp 0.05");
client_cmd(id, "rate 10000");
client_cmd(id, "cl_cmdrate 45");
client_print(id, print_chat, "%s Auto ustawienie interpu na 0.05 (WIM %d/%d)",interp_prefix, interp_warn[id], interp_punish_limit)
}
if(interp_warn[id] == interp_punish_limit)
Punish(id);
interp_check[id] = false;
}
}
public Punish(id)
{
new name[32]
get_user_name(id, name, 31)
if(interp_amxbans == 0)
{
if (interp_punish_type == 0)
{
server_cmd("amx_kick %s ^"Zly Interp^"", name)
client_cmd(id, "echo ^"%s Zostales wyrzucony z powodu zlego interpu...^"", interp_prefix)
client_cmd(id, "echo ^"%s Jak juz wybierzesz swoj interp to go przestrzegaj...^"", interp_prefix)
client_print(0, print_chat, "%s %s zostal rozlaczony za zly interp!",interp_prefix, name)
}
else if (interp_punish_type == 1)
{
server_cmd("amx_banip %s 1 ^"Zly Interp^"", name)
client_cmd(id, "echo ^"%s Zostales zbanowany na 1 minute z powodu zlego interpu...^"", interp_prefix)
client_cmd(id, "echo ^"%s Jak juz wybierzesz swoj interp to go przestrzegaj...^"", interp_prefix)
client_print(0, print_chat, "%s %s zostal zbanowany na 1 minute za zly interp!",interp_prefix, name)
}
else if (interp_punish_type == 2)
{
server_cmd("amx_banip %s 5 ^"Zly Interp^"", name)
client_cmd(id, "echo ^"%s Zostales zbanowany na 5 minut z powodu zlego interpu...^"", interp_prefix)
client_cmd(id, "echo ^"%s Jak juz wybierzesz swoj interp to go przestrzegaj...^"", interp_prefix)
client_print(0, print_chat, "%s %s zostal zbanowany na 5 minut za zly interp!",interp_prefix, name)
}
}
else if (interp_amxbans == 1)
{
if (interp_punish_type == 0)
{
server_cmd("amx_kick %s ^"Zly Interp^"", name)
client_cmd(id, "echo ^"%s Zostales wyrzucony z powodu zlego interpu...^"", interp_prefix)
client_cmd(id, "echo ^"%s Jak juz wybierzesz swoj interp to go przestrzegaj...^"", interp_prefix)
client_print(0, print_chat, "%s %s zostal rozlaczony za zly interp!",interp_prefix, name)
}
else if (interp_punish_type == 1)
{
server_cmd("amx_ban 1 %s ^"Zly Interp^"", name)
client_cmd(id, "echo ^"%s Zostales zbanowany na 1 minute z powodu zlego interpu...^"", interp_prefix)
client_cmd(id, "echo ^"%s Jak juz wybierzesz swoj interp to go przestrzegaj...^"", interp_prefix)
client_print(0, print_chat, "%s %s zostal zbanowany na 1 minute za zly interp!",interp_prefix, name)
}
else if (interp_punish_type == 2)
{
server_cmd("amx_ban 5 %s ^"Zly Interp^"", name)
client_cmd(id, "echo ^"%s Zostales zbanowany na 5 minut z powodu zlego interpu...^"", interp_prefix)
client_cmd(id, "echo ^"%s Jak juz wybierzesz swoj interp to go przestrzegaj...^"", interp_prefix)
client_print(0, print_chat, "%s %s zostal zbanowany na 5 minut za zly interp!",interp_prefix, name)
}
}
return PLUGIN_CONTINUE;
}
public client_spawn(id)
{
if (is_user_connected(id) && (!(is_user_bot(id))))
{
interp_check[id] = true;
static h;
h = register_forward(FM_CmdStart, "CheckInterp", 1)
set_task(0.01, "unregister", h)
}
}
public client_disconnect(id)
{
interp_warn[id] = 0;
}
public client_connect(id)
{
interp_warn[id] = 0;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1250\\ deff0\\ deflang1045{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/
[uwaga=benio101]Ten temat został zamknięty przez moderatora.
Powód: Autor tematu zbanowany
Jeśli się z tym nie zgadzasz,
raportuj ten post, a moderator lub administrator rozpatrzy go ponownie.Z pozdrowieniami,
Zespół AMXX.PL[/uwaga]
Użytkownik benio101 edytował ten post 05.01.2013 01:32


Dodatki SourceMod



Temat jest zamknięty







