←  Problemy z pluginami

AMXX.pl: Support AMX Mod X i SourceMod

»

Problem

Locked

Rubasze's Photo Rubasze 08.11.2009

Witam, przerobiłem sobie plugin timelimitvote. I w logach mam takie errory.

L 11/08/2009 - 12:18:58: [AMXX] Run time error 10 (plugin "timelimitvote.amxx") (native "menu_cancel") - debug not enabled!
L 11/08/2009 - 12:18:58: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 11/08/2009 - 14:03:35: Start of error session.
L 11/08/2009 - 14:03:35: Info (map "cs_office") (file "addons/amxmodx/logs/error_20091108.log")
L 11/08/2009 - 14:03:35: Played 3 is not in game
L 11/08/2009 - 14:03:35: [AMXX] Run time error 10 (plugin "timelimitvote.amxx") (native "menu_cancel") - debug not enabled!
L 11/08/2009 - 14:03:35: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).

Oto sma które zrobiłem.

/* Script generated by Pawn Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN	"TimeLimit vote"
#define AUTHOR	"many"
#define VERSION	"1.0.0"

new choises[6]
new Float:g_timelimit

public plugin_init() 
{
	register_plugin("PLUGIN", "VERSION", "AUTHOR")
	set_task(60.0, "start_vote");
}

public start_vote(id)
{	
	new menu = menu_create("yIle czasu gramy mapke?", "menu_handler")
	menu_additem(menu, "w20 minut", "1", 0)
	menu_additem(menu, "w25 minut", "2", 0)
	menu_additem(menu, "w30 minut", "3", 0)
	menu_addblank(menu, 0)
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
	
	new players[32], inum
	get_players(players, inum, "ch")
	for(new i = 0; i < inum; i++)
	{
		menu_display(players[i], menu, 0)
	}
	
	set_task(15.0, "finish_vote")
	
	choises[1] = choises[2] = choises[3] = 0
	
	return 1
}

public menu_handler(id, menu, item)
{
	if (item == MENU_EXIT)
	{
		menu_cancel(id)
		return PLUGIN_HANDLED
	}
	
	new data[6], name[32]
	new access, callback
	
	menu_item_getinfo(menu, item, access, data, 5, _, _, callback)
	
	new key = str_to_num(data)
	get_user_name(id, name, 31)
	
	switch (key) 
	{
		case 1: 
		{
			client_print (0, print_chat, "[AMXX] %s zaglosowal na 20 minut", name);
		}
		case 2:
		{
			client_print (0, print_chat, "[AMXX] %s zaglosowal na 25 minut", name);
		}
		case 3:
		{
			client_print (0, print_chat, "[AMXX] %s zaglosowal na 30 minut", name);
		}
	}
	
	++choises[key]
	
	menu_cancel(id)
	return PLUGIN_HANDLED
}

public finish_vote()
{
	g_timelimit = get_cvar_float("mp_timelimit")
	
	if(choises[1] > choises[2] && choises[1] > choises[3] && choises[1] > choises[4] && choises[1] > choises[5])
	{
		client_print(0, print_chat, "[AMXX] Czas mapy zostal ustawiony na ^"20 minut^", wybralo go %d osob", choises[1])
		server_cmd("mp_timelimit 20");
	}
	else if(choises[2] > choises[1] && choises[2] > choises[3] && choises[2] > choises[4] && choises[2] > choises[5])
	{
		client_print(0, print_chat, "[AMXX] Czas mapy zostal ustawiony na ^"25 minut^", wybralo go %d osob", choises[2])
		server_cmd("mp_timelimit 25");
	}
	else if(choises[3] > choises[1] && choises[3] > choises[2] && choises[3] > choises[4] && choises[3] > choises[5])
	{
		client_print(0, print_chat, "[AMXX] Czas mapy zostal ustawiony na ^"30 minut^", wybralo go %d osob", choises[3])
		server_cmd("mp_timelimit 30");
	}
}  

public plugin_end() 
{
	set_cvar_float("mp_timelimit", g_timelimit)
}

z góry dzięki dam pomógł :)
Quote

  • +
  • -
baku's Photo baku 08.11.2009

timelimitvote.amxx debug

w plugins.ini
Quote
Locked