PHP Code:
#include <amxmodx>
public plugin_init()
{
register_plugin("anti one crash ","1.2","Lev")
}
public client_command(plrid)
{
// Get client command.
new cmd[5];
read_argv(0, cmd, sizeof(cmd) - 1);
// Check if command is drop.
if (equali(cmd, "drop"))
{
// Get player's weapons count.
new num;
new weapons[32];
get_user_weapons(plrid, weapons, num);
// Deny command if user has only 2 weapon
if (num == 2)
{
return PLUGIN_HANDLED;
}
}
return PLUGIN_CONTINUE;
}
wouldn't be better to hook the client drop command?
PHP Code:
#include <amxmodx>
public plugin_init()
{
register_plugin("anti one crash ","1.2","Lev")
register_clcmd("drop","anticrash")
}
public anticrash(plrid)
{
// Get player's weapons count.
new num;
new weapons[32];
get_user_weapons(plrid, weapons, num);
// Deny command if user has only 2 weapon
if (num == 2)
{
return PLUGIN_HANDLED;
}
}
return PLUGIN_CONTINUE;
}