Hello I get a problem when I try to run this plugin. I compiled the plugin and no errors. Running the plugin on my server and the console show this when debuggin is active (note I have the debug mode active in 2 atm tested 1 aswell show the same thing)
L 04/28/2006 - 15:40:14: [AMXX] Run time error 19 (plugin "Minty_1.2b.amxx") - debug not enabled!
I've tried to search through the forums and the help docs and I'm not getting any wiser on this matter so I ask if someone could take a look and maybe find an answer to my problem. As the debugger says the debug mode is not enabled though it is I cant get whats cousing this problem...
Here is the plugin, I've started out from the Client cmd's menu and altered it to fit what I'm working on for my private server. Thanx for any help its apriciasiated
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
new Keys = MENU_KEY_1 | MENU_KEY_2 | MENU_KEY_3 | MENU_KEY_4 | MENU_KEY_5 | MENU_KEY_6 | MENU_KEY_7 | MENU_KEY_8 | MENU_KEY_9 | MENU_KEY_0
new g_menuPosition[33]
new g_menuPlayers[33][32]
new g_menuPlayersNum[33]
new g_menuOption[33]
new g_menuSelect[33][64]
new g_menuSelectNum[33]
new g_flaggedPlayer[33]
#define MAX_CLCMDS 24
#define MINTY_KICK 1
#define MINTY_ADMINSAYPLAYER 2
#define MINTY_ADMINSAYALL 3
#define MINTY_BAN 4
#define MINTY_SLAP 5
#define PLUGINNAME "Minty"
#define VERSION "1.1b"
#define CREATOR "Durano"
new g_clcmdName_Kick[MAX_CLCMDS][32]
new g_clcmdCmd_Kick[MAX_CLCMDS][64]
new g_clcmdMisc_Kick[MAX_CLCMDS][2]
new g_clcmdNum_Kick
new g_clcmdName_AdminSayPlayer[MAX_CLCMDS][32]
new g_clcmdCmd_AdminSayPlayer[MAX_CLCMDS][64]
new g_clcmdMisc_AdminSayPlayer[MAX_CLCMDS][2]
new g_clcmdNum_AdminSayPlayer
new g_clcmdName_AdminSayAll[MAX_CLCMDS][32]
new g_clcmdCmd_AdminSayAll[MAX_CLCMDS][64]
new g_clcmdMisc_AdminSayAll[MAX_CLCMDS][2]
new g_clcmdNum_AdminSayAll
new g_coloredMenus
new g_inCustomReason[33]
new mintyCustomCommand[33]
public plugin_natives()
{
set_module_filter("module_filter")
set_native_filter("native_filter")
}
public plugin_init()
{
register_plugin(PLUGINNAME, VERSION, CREATOR)
register_dictionary("common.txt")
register_dictionary("admincmd.txt")
register_dictionary("plmenu.txt")
register_clcmd("amx_minty", "MintyMenu", ADMIN_KICK, "- Visar minty menyn")
register_clcmd("amx_mintyPlayers", "cmdClcmdMenu", ADMIN_KICK, "- Visar minty spelar meny")
register_clcmd("amx_mintyReason", "mintyReasonMenu", ADMIN_KICK, "- Visar minty custom meny")
register_clcmd("amx_mintyCustomReason", "customReason", ADMIN_KICK, "- Visar minty custom meny")
register_clcmd("amx_mintykick", "mintyKick", ADMIN_KICK, "- Visar minty kick meny")
register_clcmd("amx_mintyplayersay", "mintyPlayerSay", ADMIN_KICK, "- Visar minty player say meny")
register_menucmd(register_menuid("Minty meny"), Keys, "actionMintyMenu")
register_menucmd(register_menuid("Minty Client Cmds Menu"), 1023, "actionClcmdMenu")
register_menucmd(register_menuid("Minty reason"), Keys, "actionMintyReason")
g_coloredMenus = colored_menus()
new clcmds_ini_file[64]
get_configsdir(clcmds_ini_file, 63)
format(clcmds_ini_file, 63, "%s/Minty_Kick.ini", clcmds_ini_file)
load_settings(clcmds_ini_file, MINTY_KICK)
get_configsdir(clcmds_ini_file, 63)
format(clcmds_ini_file, 63, "%s/Minty_AdminPlayerSay.ini", clcmds_ini_file)
load_settings(clcmds_ini_file, MINTY_ADMINSAYPLAYER)
get_configsdir(clcmds_ini_file, 63)
format(clcmds_ini_file, 63, "%s/Minty_AdminSayAll.ini", clcmds_ini_file)
load_settings(clcmds_ini_file, MINTY_ADMINSAYALL)
new i
for(i=0; i<32 ;i++)
{
g_inCustomReason[i] = 0
mintyCustomCommand[i] = 0
}
}
/* Client cmds menu */
public actionClcmdMenu(id, key)
{
new g_clcmdMisc[MAX_CLCMDS][2]
if(mintyCustomCommand[id] == MINTY_KICK){
g_clcmdMisc = g_clcmdMisc_Kick
}
else if(mintyCustomCommand[id] == MINTY_ADMINSAYPLAYER){
g_clcmdMisc = g_clcmdMisc_AdminSayPlayer
}
else if(mintyCustomCommand[id] == MINTY_SLAP){
g_clcmdMisc[id][1] = 2
}
switch (key)
{
case 8: displayClcmdMenu(id, ++g_menuPosition[id])
case 9: displayClcmdMenu(id, --g_menuPosition[id])
default:
{
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
new flags = g_clcmdMisc[g_menuSelect[id][g_menuOption[id]]][1]
if (is_user_connected(player))
{
new name[32], userid[32], command[64]
get_user_name(player, name, 31)
if(mintyCustomCommand[id] == MINTY_SLAP){
num_to_str(get_user_userid(player), userid, 31)
format(command, 63, "amx_slap #%s 0", userid)
// client_print(0,print_chat,command)
client_cmd(id,command)
displayClcmdMenu(id, g_menuPosition[id])
}else{
g_flaggedPlayer[id] = player
show_mintyReasonMenu(id)
}
// new message[1024]
// format(message,1023,"Player %s is flagged", name)
// client_print(0,print_chat,message)
}
if (flags & 8)
displayClcmdMenu(id, g_menuPosition[id])
}
}
return PLUGIN_HANDLED
}
displayClcmdMenu(id, pos)
{
if (pos < 0)
client_cmd(id,"amx_minty")
get_players(g_menuPlayers[id], g_menuPlayersNum[id])
new menuBody[512]
new b = 0
new i
new name[32]
new start = pos * 7
new menuActionName[64]
if(mintyCustomCommand[id] == MINTY_KICK){
menuActionName = "Kick Spelare"
}
else if(mintyCustomCommand[id] == MINTY_ADMINSAYPLAYER){
menuActionName = "Say Spelare"
}
else if(mintyCustomCommand[id] == MINTY_SLAP){
menuActionName = "Slap Spelare"
}
if (start >= g_menuPlayersNum[id])
start = pos = g_menuPosition[id] = 0
new len = format(menuBody, 511, "\yMinty\R%d/%d^n", id, pos + 1, (g_menuPlayersNum[id] / 7 + ((g_menuPlayersNum[id] % 7) ? 1 : 0)))
new end = start + 7
new keys = MENU_KEY_0|MENU_KEY_8
if (end > g_menuPlayersNum[id])
end = g_menuPlayersNum[id]
len += format(menuBody[len], 511-len, "%s^n\w^n", menuActionName)
for (new a = start; a < end; ++a)
{
i = g_menuPlayers[id][a]
get_user_name(i, name, 31)
if (access(i, ADMIN_IMMUNITY))
{
++b
if (g_coloredMenus)
len += format(menuBody[len], 511-len, "\d%d. %s^n\w", b, name)
else
len += format(menuBody[len], 511-len, "#. %s^n", name)
}
else {
keys |= (1<<b)
len += format(menuBody[len], 511-len, "%d. %s^n", ++b, name)
}
}
/* if (g_menuSelectNum[id])
len += format(menuBody[len], 511-len, "^n8. %s^n", g_clcmdName[g_menuSelect[id][g_menuOption[id]]])
else
len += format(menuBody[len], 511-len, "^n8. %L^n", id, "NO_CMDS")
*/
if (end != g_menuPlayersNum[id])
{
format(menuBody[len], 511-len, "^n9. %L...^n0. %L", id, "MORE", id, pos ? "BACK" : "EXIT")
keys |= MENU_KEY_9
}
else
format(menuBody[len], 511-len, "^n0. %L", id, pos ? "BACK" : "EXIT")
show_menu(id, keys, menuBody, -1, "Minty Client Cmds Menu")
}
public cmdClcmdMenu(id, level, cid)
{
if (!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED
new flags = get_user_flags(id)
new g_clcmdMisc[MAX_CLCMDS][2]
if(mintyCustomCommand[id] == MINTY_KICK){
g_clcmdMisc = g_clcmdMisc_Kick
}
else if(mintyCustomCommand[id] == MINTY_ADMINSAYPLAYER){
g_clcmdMisc = g_clcmdMisc_AdminSayPlayer
}
else if(mintyCustomCommand[id] == MINTY_SLAP){
new szAccess[32] = "u"
g_clcmdMisc[id][0] = read_flags(szAccess)
}
g_menuSelectNum[id] = 0
for (new a = 0; a < g_clcmdNum_Kick; ++a)
if (g_clcmdMisc[a][0] & flags)
g_menuSelect[id][g_menuSelectNum[id]++] = a
g_menuOption[id] = 0
displayClcmdMenu(id, g_menuPosition[id] = 0)
return PLUGIN_HANDLED
}
load_settings(szFilename[], commandfile)
{
if (!file_exists(szFilename))
return 0
new text[1024], szFlags[32], szAccess[32]
new a, pos = 0
if(commandfile == MINTY_KICK)
{
while (g_clcmdNum_Kick < MAX_CLCMDS && read_file(szFilename, pos++, text, 1023, a))
{
if (text[0] == ';') continue
if (parse(text, g_clcmdName_Kick[g_clcmdNum_Kick], 31, g_clcmdCmd_Kick[g_clcmdNum_Kick], 255, szFlags, 31, szAccess, 31) > 3)
{
while (replace(g_clcmdCmd_Kick[g_clcmdNum_Kick], 255, "\'", "^""))
{
// do nothing
}
g_clcmdMisc_Kick[g_clcmdNum_Kick][1] = read_flags(szFlags)
g_clcmdMisc_Kick[g_clcmdNum_Kick][0] = read_flags(szAccess)
g_clcmdNum_Kick++
}
}
}
if(commandfile == MINTY_ADMINSAYPLAYER)
{
while (g_clcmdNum_AdminSayPlayer < MAX_CLCMDS && read_file(szFilename, pos++, text, 1023, a))
{
if (text[0] == ';') continue
if (parse(text, g_clcmdName_AdminSayPlayer[g_clcmdNum_AdminSayPlayer], 31, g_clcmdCmd_AdminSayPlayer[g_clcmdNum_AdminSayPlayer], 255, szFlags, 31, szAccess, 31) > 3)
{
while (replace(g_clcmdCmd_AdminSayPlayer[g_clcmdNum_AdminSayPlayer], 255, "\'", "^""))
{
// do nothing
}
g_clcmdMisc_AdminSayPlayer[g_clcmdNum_AdminSayPlayer][1] = read_flags(szFlags)
g_clcmdMisc_AdminSayPlayer[g_clcmdNum_AdminSayPlayer][0] = read_flags(szAccess)
g_clcmdNum_AdminSayPlayer++
}
}
}
if(commandfile == MINTY_ADMINSAYALL)
{
while (g_clcmdNum_AdminSayAll < MAX_CLCMDS && read_file(szFilename, pos++, text, 1023, a))
{
if (text[0] == ';') continue
if (parse(text, g_clcmdName_AdminSayAll[g_clcmdNum_AdminSayAll], 31, g_clcmdCmd_AdminSayAll[g_clcmdNum_AdminSayAll], 255, szFlags, 31, szAccess, 31) > 3)
{
while (replace(g_clcmdCmd_AdminSayAll[g_clcmdNum_AdminSayAll], 255, "\'", "^""))
{
// do nothing
}
g_clcmdMisc_AdminSayAll[g_clcmdNum_AdminSayAll][1] = read_flags(szFlags)
g_clcmdMisc_AdminSayAll[g_clcmdNum_AdminSayAll][0] = read_flags(szAccess)
g_clcmdNum_AdminSayAll++
}
}
}
return 1
}
public mintyReasonMenu(id, level, cid) {
if (!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED
show_mintyReasonMenu(id)
return 1
}
show_mintyReasonMenu(id){
new menustring[1024]
new g_clcmdName[MAX_CLCMDS][32]
if(mintyCustomCommand[id] == MINTY_KICK){
g_clcmdName = g_clcmdName_Kick
}
else if(mintyCustomCommand[id] == MINTY_ADMINSAYPLAYER){
g_clcmdName = g_clcmdName_AdminSayPlayer
}
else if(mintyCustomCommand[id] == MINTY_ADMINSAYALL){
g_clcmdName = g_clcmdName_AdminSayAll
}
new menuActionName[64]
if(mintyCustomCommand[id] == MINTY_KICK){
menuActionName = "Kick Spelare"
}
else if(mintyCustomCommand[id] == MINTY_ADMINSAYPLAYER){
menuActionName = "Say Spelare"
}
format(menustring,1023,"\yMinty reason^n%s^n\w1. %s ^n2. %s ^n3. %s ^n4. %s ^n5. %s ^n6. %s ^n7. %s ^n8. %s ^n^n9. Skriv egen anledning^n^n0. back^n",menuActionName,g_clcmdName[0],g_clcmdName[1],g_clcmdName[2],g_clcmdName[3],g_clcmdName[4],g_clcmdName[5],g_clcmdName[6],g_clcmdName[7],g_clcmdName[8]) // Display menu
show_menu(id, Keys, menustring,-1,"")
return 1
}
public actionMintyReason(id, key) {
/* Menu:
* Minty
*
* 1.
* 2.
* 3.
* 4.
* 5.
* 6.
* 7.
* 8.
*
* 9. custom
*
* 0. back
*/
new g_clcmdMisc[MAX_CLCMDS][2]
new g_clcmdCmd[MAX_CLCMDS][64]
if (mintyCustomCommand[id] == MINTY_KICK) {
g_clcmdMisc = g_clcmdMisc_Kick
g_clcmdCmd = g_clcmdCmd_Kick
} else if (mintyCustomCommand[id] == MINTY_ADMINSAYPLAYER) {
g_clcmdMisc = g_clcmdMisc_AdminSayPlayer
g_clcmdCmd = g_clcmdCmd_AdminSayPlayer
} else if (mintyCustomCommand[id] == MINTY_ADMINSAYALL){
g_clcmdMisc = g_clcmdMisc_AdminSayAll
g_clcmdCmd = g_clcmdCmd_AdminSayAll
}
switch (key) {
case 8: { // 9
g_inCustomReason[id]=1
client_cmd(id,"messagemode amx_mintyCustomReason")
}
case 9: { // 0
client_cmd(id,"amx_mintyPlayers")
}
default: {
new player
player = g_flaggedPlayer[id]
new flags = g_clcmdMisc[key][1]
new command[256], authid[32], name[32], userid[32]
copy(command, 255, g_clcmdCmd[key])
get_user_authid(player, authid, 31)
get_user_name(player, name, 31)
num_to_str(get_user_userid(player), userid, 31)
replace(command, 255, "%userid%", userid)
replace(command, 255, "%authid%", authid)
replace(command, 255, "%name%", name)
// new message[1024]
// format(message,1023,"Player %s is flagged", name)
// client_print(0,print_chat,message)
// client_print(0,print_chat,command)
if (flags & 1)
{
server_cmd(command)
server_exec()
} else if (flags & 2)
client_cmd(id, command)
else if (flags & 4)
client_cmd(player, command)
}
}
}
public customReason(id,level,cid) {
if (!cmd_access(id,level,cid,1)) {
return PLUGIN_HANDLED
}
new szReason[128]
read_argv(1,szReason,127)
// new message[1024]
// client_print(0,print_chat,"Test reason menu")
// format(message,1023,"Reason: %s", szReason)
// client_print(0,print_chat,message)
new player
player = g_flaggedPlayer[id]
new command[64], name[32], userid[32]
num_to_str(get_user_userid(player), userid, 31)
get_user_name(player, name, 31)
if(mintyCustomCommand[id] == MINTY_KICK){
if (g_inCustomReason[id]) {
g_inCustomReason[id]=0
format(command, 63, "amx_kick #%s ^"%s^"", userid, szReason)
// client_print(0,print_chat,command)
client_cmd(id,command)
}
}
else if(mintyCustomCommand[id] == MINTY_ADMINSAYPLAYER){
if (g_inCustomReason[id]) {
g_inCustomReason[id]=0
format(command, 63, "amx_tsay white %s %s", name, szReason)
// client_print(0,print_chat,command)
client_cmd(id,command)
}
}
else if(mintyCustomCommand[id] == MINTY_ADMINSAYALL){
if (g_inCustomReason[id]) {
g_inCustomReason[id]=0
format(command, 63, "amx_tsay white %s", szReason)
// client_print(0,print_chat,command)
client_cmd(id,command)
}
}
return PLUGIN_HANDLED
}
public MintyMenu(id, level, cid) {
if (!cmd_access(id,level,cid,1)) {
return PLUGIN_HANDLED
}
show_menu(id, Keys, "\yMinty meny^n^n\w1. Kicka spelare^n2. Banna spelare^n3. Slappa spelare^n^n4. Say spelare^n5. Say alla^n^n6. Kart vote^n7. Kart byte^n^n0. exit^n", -1, "") // Display menu
return PLUGIN_HANDLED
}
public actionMintyMenu(id, key) {
/* Menu:
* Minty meny
*
* 1. Kicka spelare
* 2. Banna spelare
* 3. Admin say spelare
* 4. Admin say alla
* 5. Kart vote
* 6. kart byte
*
* 0. exit
*/
switch (key) {
case 0: { // 1
mintyCustomCommand[id] = MINTY_KICK
client_cmd(id,"amx_mintyPlayers")
}
case 1: { // 2
client_cmd(id,"amx_banmenu")
}
case 2: { // 3
mintyCustomCommand[id] = MINTY_SLAP
client_cmd(id,"amx_mintyPlayers")
}
case 3: { // 4
mintyCustomCommand[id] = MINTY_ADMINSAYPLAYER
client_cmd(id,"amx_mintyPlayers")
}
case 4: { // 5
mintyCustomCommand[id] = MINTY_ADMINSAYALL
client_cmd(id,"amx_mintyReason")
}
case 5: { // 6
client_cmd(id,"amx_votemapmenu")
}
case 6: { // 7
client_cmd(id,"amx_mapmenu")
}
case 9: { // 0
}
}
}
public mintyKick(id, level, cid) {
if (!cmd_access(id,level,cid,1)) {
return PLUGIN_HANDLED
}
mintyCustomCommand[id] = MINTY_KICK
client_cmd(id,"amx_mintyPlayers")
return PLUGIN_HANDLED
}
public mintyPlayerSay(id, level, cid) {
if (!cmd_access(id,level,cid,1)) {
return PLUGIN_HANDLED
}
mintyCustomCommand[id] = MINTY_ADMINSAYPLAYER
client_cmd(id,"amx_mintyPlayers")
return PLUGIN_HANDLED
}