AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   plugin load error (https://forums.alliedmods.net/showthread.php?t=29267)

JohnJ3 06-02-2006 09:19

plugin load error
 
Hi.
I need help. This plugin was compiled without errors or warnings, but result of the command "amx_plugins" is "bad load". Why?
Help me, please.

Code:

/* AMX Mod X
*  Anti Reconnect Plugin 2.0
*  Do not give to use "reconnect" or save frags and deaths of player when he use reconnect.
*/

#include <amxmodx>
#include <core>
#include <fun>

new PLUGIN[]="Anti reconnect"
new AUTHOR[]="JohnJ"
new VERSION[]="2.0"

new RTIME[]="amx_reconnect_time"
new RCAN[]="amx_reconnect_can"
new SCORESAVE[]="amx_reconnect_ss"

new t_disconnect[33] = {0, ...}
new sfrags[33] = {0, ...}
new sdeaths[33] = {0, ...}

public plugin_init()
{
        register_plugin(PLUGIN, VERSION, AUTHOR)
        register_dictionary("antireconnect.txt")
        register_cvar(RTIME, "7")
        register_cvar(RCAN, "1")
        register_cvar(SCORESAVE, "1")
}

public client_connect(id)
{
        new maxexit = get_cvar_float(RTIME)
        new canreconnect = get_cvar_num(RCAN)
        new ssave = get_cvar_num(SCORESAVE)

        if ((maxexit>0) && (canreconnect==0))
        {
                new Float:nexTime = get_gametime()
               
                if (t_disconnect[id] > nexTime)
                {
                client_cmd(id,"echo ** %d ** Anti Reconnect - wait %d sec!",maxexit)
                t_disconnect[id] = nexTime + maxexit
                    server_cmd("kick #%d ^"%L^"", get_user_userid(id), id, "NO_ENTRY")
                return PLUGIN_HANDLED
                }
        }
        if (ssave==1)
        {
                new Float:nexTime = get_gametime()

                if (t_disconnect[id] > nexTime)
                {
                set_user_deaths(id,sdeaths[id])
                set_user_frags(id,sfrags[id])
                }
                else
                {
                sdeaths[id]=0
                sfrags[id]=0
                }
        }

        return PLUGIN_CONTINUE
}

public client_disconnect(id)
{
        new maxexit = get_cvar_float(RTIME)
        new canreconnect = get_cvar_num(RCAN)
        new ssave = get_cvar_num(SCORESAVE)

        if (canreconnect==0)
        {
          new Float:theTime = get_gametime()
        t_disconnect[id] = theTime + maxexit
        }
        if (ssave==1)
        {
        sdeaths[id] = get_user_deaths(id)
        sfrags[id] = get_user_frags(id)
        }
        return PLUGIN_CONTINUE
}

Thank you.

Brad 06-02-2006 09:33

Place "debug" after your plugin in plugins.ini and then see what it says about the bad load in the AMXX log.

Your line in plugins.ini should look something like this:
Code:

antireconnect.amxx debug

shino 06-02-2006 09:41

check your modules.ini if core and fun modules are enabled. also check if you have entered the right name of plugin in plugins.ini.

JohnJ3 06-02-2006 10:28

I'm use <cstrike> and "cs_set_user_deaths", but not "set_user_deaths". It's work. Thank for info about log :)


All times are GMT -4. The time now is 16:22.

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