Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

Szukam pluginu który naprawia wyrzucanie broni powyżej 30


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
27 odpowiedzi w tym temacie

#21 PANDA_2zl

    Czempion

  • Power User

Reputacja: 227
Wszechwidzący

  • Postów:830
  • Imię:Michał
  • Lokalizacja:Kraków
Offline

Napisano 30.03.2026 16:48

majster skąd te eventy wziąłeś? bo bym sam skorzystał

Z Piątnicy no bo skąd 🙈🤣

A tak serio: https://github.com/r...ripting/include

wskaż w którym pliku masz te eventy, a najlepiej zacytuj segmenty z nimi, bo chyba jestem ślepy
  • +
  • -
  • 0

#22 Misiaczek ;c

    /dev/null

  • Moderator

Reputacja: 1 681
Godlike

  • Postów:2 506
  • GG:
  • Steam:steam
  • Imię:Michał
  • Lokalizacja:Halemba
Offline

Napisano 30.03.2026 18:04

jestem ślepy


/*
* Hook API function that are available into enum.
* Look at the enums for parameter lists.
*
* @param function   The function to hook
* @param callback   The forward to call
* @param post       Whether or not to forward this in post
*
* @return           Returns a hook handle. Use EnableHookChain/DisableHookChain to toggle the forward on or off
*/
native HookChain:RegisterHookChain(ReAPIFunc:function_id, const callback[], post = 0);
...

define ReAPIFunc 				{EngineFunc, GamedllFunc, GamedllFunc_CBaseAnimating, GamedllFunc_CBasePlayer, GamedllFunc_CSGameRules, GamedllFunc_CGrenade, GamedllFunc_CWeaponBox, ReCheckerFunc, GamedllFunc_CBasePlayerWeapon, GamedllFunc_CGib, GamedllFunc_CBaseEntity, GamedllFunc_CBotManager}
edict_t* CreateEntity();
edict_t* CreateNamedEntity();

Nawet fakemeta ma takie same cuda :)
  • +
  • -
  • 0

#23 PANDA_2zl

    Czempion

  • Power User

Reputacja: 227
Wszechwidzący

  • Postów:830
  • Imię:Michał
  • Lokalizacja:Kraków
Offline

Napisano 30.03.2026 19:37

jestem ślepy

/*
* Hook API function that are available into enum.
* Look at the enums for parameter lists.
*
* @param function   The function to hook
* @param callback   The forward to call
* @param post       Whether or not to forward this in post
*
* @return           Returns a hook handle. Use EnableHookChain/DisableHookChain to toggle the forward on or off
*/
native HookChain:RegisterHookChain(ReAPIFunc:function_id, const callback[], post = 0);
...

define ReAPIFunc 				{EngineFunc, GamedllFunc, GamedllFunc_CBaseAnimating, GamedllFunc_CBasePlayer, GamedllFunc_CSGameRules, GamedllFunc_CGrenade, GamedllFunc_CWeaponBox, ReCheckerFunc, GamedllFunc_CBasePlayerWeapon, GamedllFunc_CGib, GamedllFunc_CBaseEntity, GamedllFunc_CBotManager}
edict_t* CreateEntity();
edict_t* CreateNamedEntity();
Nawet fakemeta ma takie same cuda :)

a dasz radę mi skompilować ten kod? bo nie chce mi działać, za głupi jestem
  • +
  • -
  • 0

#24 Misiaczek ;c

    /dev/null

  • Moderator

Reputacja: 1 681
Godlike

  • Postów:2 506
  • GG:
  • Steam:steam
  • Imię:Michał
  • Lokalizacja:Halemba
Offline

Napisano 31.03.2026 16:43

Jutro w domu bede to puszcze to przez kompilator :)
  • +
  • -
  • 0

#25 Misiaczek ;c

    /dev/null

  • Moderator

Reputacja: 1 681
Godlike

  • Postów:2 506
  • GG:
  • Steam:steam
  • Imię:Michał
  • Lokalizacja:Halemba
Offline

Napisano 02.04.2026 12:45

#include <amxmodx>
#include <engine>

#define PLUGIN  "Entity & Drop Fix"
#define VERSION "1.1"
#define AUTHOR  "Misiaczek ;c / Err0r"

new g_pMaxWeapons;
new g_pWeaponLife;
new g_pMaxEdicts;
new g_pDebug;
new g_iWeaponCount;

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR);

    g_pMaxWeapons = register_cvar("guard_max_weapons", "20");
    g_pWeaponLife = register_cvar("guard_weapon_life", "12.0");
    g_pMaxEdicts  = register_cvar("guard_max_edicts", "850");
    g_pDebug      = register_cvar("guard_debug", "0");

    register_event("CurWeapon", "OnWeaponDropCheck", "be");

    set_task(1.0, "CleanupWeapons", _, _, _, "b");
    set_task(3.0, "CheckEdicts", _, _, _, "b");
}

public plugin_cfg()
{
    SyncWeapons();
}

public OnWeaponDropCheck(id)
{
    if (!is_user_alive(id))
        return;

    SyncWeapons();

    if (g_iWeaponCount >= get_pcvar_num(g_pMaxWeapons))
    {
        client_print(id, print_center, "[GUARD] Za duzo broni na mapie!");
    }
}

public CleanupWeapons()
{
    new ent = -1;
    new Float:time = get_gametime();
    new Float:lifetime = get_pcvar_float(g_pWeaponLife);

    while ((ent = find_ent_by_class(ent, "weaponbox")))
    {
        if (!is_valid_ent(ent))
            continue;

        if (IsC4(ent))
            continue;

        new Float:spawn = entity_get_float(ent, EV_FL_fuser1);

        if (spawn == 0.0)
        {
            entity_set_float(ent, EV_FL_fuser1, time);
            continue;
        }

        if ((time - spawn) > lifetime)
        {
            remove_entity(ent);
        }
    }
}

public CheckEdicts()
{
    new total = 0;
    new ent = -1;

    while ((ent = find_ent_by_class(ent, "*")))
    {
        if (is_valid_ent(ent))
            total++;
    }

    if (total >= get_pcvar_num(g_pMaxEdicts))
    {
        new w = -1;

        while ((w = find_ent_by_class(w, "weaponbox")))
        {
            if (is_valid_ent(w))
                remove_entity(w);
        }

        if (get_pcvar_num(g_pDebug))
            server_print("[GUARD] CLEANUP! Edicts: %d", total);
    }
}

public SyncWeapons()
{
    new ent = -1;
    g_iWeaponCount = 0;

    while ((ent = find_ent_by_class(ent, "weaponbox")))
    {
        if (is_valid_ent(ent) && !IsC4(ent))
            g_iWeaponCount++;
    }
}

stock bool:IsC4(ent)
{
    static model[64];
    entity_get_string(ent, EV_SZ_model, model, charsmax(model));

    return containi(model, "c4") != -1;
}

mój błąd wcześniej, w reapi sugerowałem się częściowo fakemeta, przez co nieściłośc wyszła, ale prosze , to działa bez problemu

//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// test.sma
//
// Header size:            728 bytes
// Code size:             2480 bytes
// Data size:             1684 bytes
// Stack/heap size:      16384 bytes
// Total requirements:   21276 bytes
// Done.
//
// Compilation Time: 0,7 sec
// ----------------------------------------

  • +
  • -
  • 1

#26 Boziak

    Życzliwy

  • Użytkownik

Reputacja: 23
Życzliwy

  • Postów:38
  • Imię:b
Offline

Napisano 03.04.2026 08:07

/*
* Description: Called when an entity is created.
* Return type: Edict * (Entity index)
* Params: ()
*/
RH_ED_Alloc

Masz jeszcze RH_ED_Free

Jeśli chodzi o hook reapi

Użycie CurWeapon to istne marnowanie zasobów do tak trywialnego zadania.

Użytkownik Boziak edytował ten post 03.04.2026 08:09

  • +
  • -
  • 1

#27 Zjarany_Ziomek_420

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
Nowy

  • Postów:40
  • Imię:Damian
Offline

Napisano 03.04.2026 20:00

#include <amxmodx>
#include <engine>

#define PLUGIN  "Entity & Drop Fix"
#define VERSION "1.1"
#define AUTHOR  "Misiaczek ;c / Err0r"

new g_pMaxWeapons;
new g_pWeaponLife;
new g_pMaxEdicts;
new g_pDebug;
new g_iWeaponCount;

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR);

    g_pMaxWeapons = register_cvar("guard_max_weapons", "20");
    g_pWeaponLife = register_cvar("guard_weapon_life", "12.0");
    g_pMaxEdicts  = register_cvar("guard_max_edicts", "850");
    g_pDebug      = register_cvar("guard_debug", "0");

    register_event("CurWeapon", "OnWeaponDropCheck", "be");

    set_task(1.0, "CleanupWeapons", _, _, _, "b");
    set_task(3.0, "CheckEdicts", _, _, _, "b");
}

public plugin_cfg()
{
    SyncWeapons();
}

public OnWeaponDropCheck(id)
{
    if (!is_user_alive(id))
        return;

    SyncWeapons();

    if (g_iWeaponCount >= get_pcvar_num(g_pMaxWeapons))
    {
        client_print(id, print_center, "[GUARD] Za duzo broni na mapie!");
    }
}

public CleanupWeapons()
{
    new ent = -1;
    new Float:time = get_gametime();
    new Float:lifetime = get_pcvar_float(g_pWeaponLife);

    while ((ent = find_ent_by_class(ent, "weaponbox")))
    {
        if (!is_valid_ent(ent))
            continue;

        if (IsC4(ent))
            continue;

        new Float:spawn = entity_get_float(ent, EV_FL_fuser1);

        if (spawn == 0.0)
        {
            entity_set_float(ent, EV_FL_fuser1, time);
            continue;
        }

        if ((time - spawn) > lifetime)
        {
            remove_entity(ent);
        }
    }
}

public CheckEdicts()
{
    new total = 0;
    new ent = -1;

    while ((ent = find_ent_by_class(ent, "*")))
    {
        if (is_valid_ent(ent))
            total++;
    }

    if (total >= get_pcvar_num(g_pMaxEdicts))
    {
        new w = -1;

        while ((w = find_ent_by_class(w, "weaponbox")))
        {
            if (is_valid_ent(w))
                remove_entity(w);
        }

        if (get_pcvar_num(g_pDebug))
            server_print("[GUARD] CLEANUP! Edicts: %d", total);
    }
}

public SyncWeapons()
{
    new ent = -1;
    g_iWeaponCount = 0;

    while ((ent = find_ent_by_class(ent, "weaponbox")))
    {
        if (is_valid_ent(ent) && !IsC4(ent))
            g_iWeaponCount++;
    }
}

stock bool:IsC4(ent)
{
    static model[64];
    entity_get_string(ent, EV_SZ_model, model, charsmax(model));

    return containi(model, "c4") != -1;
}

mój błąd wcześniej, w reapi sugerowałem się częściowo fakemeta, przez co nieściłośc wyszła, ale proszę , to działa bez problemu

//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// test.sma
//
// Header size:            728 bytes
// Code size:             2480 bytes
// Data size:             1684 bytes
// Stack/heap size:      16384 bytes
// Total requirements:   21276 bytes
// Done.
//
// Compilation Time: 0,7 sec
// ----------------------------------------

oj cos nie dziala bo crashuje serwer itak Na serwerze wystąpił błąd: ERROR : ED_Alloc_internal: no free edicts

 


  • +
  • -
  • 0

#28 Anonymuss

    Profesjonalista

  • Użytkownik

Reputacja: 79
Zaawansowany

  • Postów:221
  • Imię:Anonimowy
  • Lokalizacja:Polska
Offline

Napisano 04.04.2026 22:28

 

#include <amxmodx>
#include <engine>

#define PLUGIN  "Entity & Drop Fix"
#define VERSION "1.1"
#define AUTHOR  "Misiaczek ;c / Err0r"

new g_pMaxWeapons;
new g_pWeaponLife;
new g_pMaxEdicts;
new g_pDebug;
new g_iWeaponCount;

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR);

    g_pMaxWeapons = register_cvar("guard_max_weapons", "20");
    g_pWeaponLife = register_cvar("guard_weapon_life", "12.0");
    g_pMaxEdicts  = register_cvar("guard_max_edicts", "850");
    g_pDebug      = register_cvar("guard_debug", "0");

    register_event("CurWeapon", "OnWeaponDropCheck", "be");

    set_task(1.0, "CleanupWeapons", _, _, _, "b");
    set_task(3.0, "CheckEdicts", _, _, _, "b");
}

public plugin_cfg()
{
    SyncWeapons();
}

public OnWeaponDropCheck(id)
{
    if (!is_user_alive(id))
        return;

    SyncWeapons();

    if (g_iWeaponCount >= get_pcvar_num(g_pMaxWeapons))
    {
        client_print(id, print_center, "[GUARD] Za duzo broni na mapie!");
    }
}

public CleanupWeapons()
{
    new ent = -1;
    new Float:time = get_gametime();
    new Float:lifetime = get_pcvar_float(g_pWeaponLife);

    while ((ent = find_ent_by_class(ent, "weaponbox")))
    {
        if (!is_valid_ent(ent))
            continue;

        if (IsC4(ent))
            continue;

        new Float:spawn = entity_get_float(ent, EV_FL_fuser1);

        if (spawn == 0.0)
        {
            entity_set_float(ent, EV_FL_fuser1, time);
            continue;
        }

        if ((time - spawn) > lifetime)
        {
            remove_entity(ent);
        }
    }
}

public CheckEdicts()
{
    new total = 0;
    new ent = -1;

    while ((ent = find_ent_by_class(ent, "*")))
    {
        if (is_valid_ent(ent))
            total++;
    }

    if (total >= get_pcvar_num(g_pMaxEdicts))
    {
        new w = -1;

        while ((w = find_ent_by_class(w, "weaponbox")))
        {
            if (is_valid_ent(w))
                remove_entity(w);
        }

        if (get_pcvar_num(g_pDebug))
            server_print("[GUARD] CLEANUP! Edicts: %d", total);
    }
}

public SyncWeapons()
{
    new ent = -1;
    g_iWeaponCount = 0;

    while ((ent = find_ent_by_class(ent, "weaponbox")))
    {
        if (is_valid_ent(ent) && !IsC4(ent))
            g_iWeaponCount++;
    }
}

stock bool:IsC4(ent)
{
    static model[64];
    entity_get_string(ent, EV_SZ_model, model, charsmax(model));

    return containi(model, "c4") != -1;
}

mój błąd wcześniej, w reapi sugerowałem się częściowo fakemeta, przez co nieściłośc wyszła, ale proszę , to działa bez problemu

//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// test.sma
//
// Header size:            728 bytes
// Code size:             2480 bytes
// Data size:             1684 bytes
// Stack/heap size:      16384 bytes
// Total requirements:   21276 bytes
// Done.
//
// Compilation Time: 0,7 sec
// ----------------------------------------

oj cos nie dziala bo crashuje serwer itak Na serwerze wystąpił błąd: ERROR : ED_Alloc_internal: no free edicts

 

 

 

 

// Time to remove item that have been dropped from the players. (in seconds)

 

mp_item_staytime "5"


  • +
  • -
  • 1




Użytkownicy przeglądający ten temat: 3

0 użytkowników, 3 gości, 0 anonimowych