Иконка ресурса

ReAmx Super 1.8

Нет прав для скачивания
Сообщения
278
Реакции
137
fl0wer,
I will use "rg_set_user_bpammo(id, WEAPON_M3, rg_get_iteminfo(rg_give_item(id, "weapon_m3"), ItemInfo_iMaxAmmo1);"
But I don't understand what to do here.
PHP:
           rg_set_user_bpammo(id, WEAPON_GLOCK18, 120);
            rg_set_user_bpammo(id, WEAPON_USP, 100);
            rg_set_user_bpammo(id, WEAPON_P228, 52);
            rg_set_user_bpammo(id, WEAPON_DEAGLE, 35);
            rg_set_user_bpammo(id, WEAPON_FIVESEVEN, 100);
            rg_set_user_bpammo(id, WEAPON_ELITE, 120);
            rg_set_user_bpammo(id, WEAPON_M3, 32);
            rg_set_user_bpammo(id, WEAPON_XM1014, 32);
            rg_set_user_bpammo(id, WEAPON_TMP, 120);
            rg_set_user_bpammo(id, WEAPON_MAC10, 100);
            rg_set_user_bpammo(id, WEAPON_MP5N, 120);
            rg_set_user_bpammo(id, WEAPON_P90, 120);
            rg_set_user_bpammo(id, WEAPON_UMP45, 100);
            rg_set_user_bpammo(id, WEAPON_FAMAS, 90);
            rg_set_user_bpammo(id, WEAPON_GALIL, 90);
            rg_set_user_bpammo(id, WEAPON_AK47, 90);
            rg_set_user_bpammo(id, WEAPON_M4A1, 90);
            rg_set_user_bpammo(id, WEAPON_SG552, 90);
            rg_set_user_bpammo(id, WEAPON_AUG, 90);
            rg_set_user_bpammo(id, WEAPON_SCOUT, 90);
            rg_set_user_bpammo(id, WEAPON_SG550, 90);
            rg_set_user_bpammo(id, WEAPON_AWP, 30);
            rg_set_user_bpammo(id, WEAPON_G3SG1, 90);
            rg_set_user_bpammo(id, WEAPON_M249, 90);
[/spoiler]
 
Сообщения
1,697
Реакции
1,510
Помог
25 раз(а)
Код:
    if(arg[0] == '@')
    {
        new players[MAX_CLIENTS], inum;
        if(equali("T", arg[1])) copy(arg[1], charsmax(arg), "TERRORIST");
        if(equali("ALL", arg[1])) get_players(players, inum);
        else get_players(players, inum, "ae", arg[1]);

        if(inum == 0)
        {
            console_print(id, "[AMX_FREEZE] %L", id, "REAMX_SUPER_NO_PLAYERS");
            return PLUGIN_HANDLED;
        }

        static player;
        for(new i=0; i<inum; i++)
        {
            player = players[i];
            if(id != player && get_user_flags(player) & ADMIN_IMMUNITY) continue;
            ...
        }
...
    }
    else {
        new player = cmd_target(id, arg, 7);
        if(!player) return PLUGIN_HANDLED;

...
    }
You can replace all these parts to one function and call another function with swith action. It economy around 1k lines.
14 Авг 2019
But I don't understand what to do here.
for(new WeaponIdType:i = WEAPON_NONE + 1; i < any:MAX_WEAPONS /* macros from cssdk */; i++)
+
check dummy weapons.
 
Сообщения
278
Реакции
137
I tried to make it, but actually it's kind of hard. Kind of functions are more different than others.

PHP:
reamx_super_function()
{
    new arg[32], arg2[32];
    read_argv(1, arg, charsmax(arg));
    read_argv(2, arg2, charsmax(arg2));
    new arg2_num = str_to_num(arg2);

    if(arg2_num <= 0)
    {
        console_print(id, "%L", id, "REAMX_SUPER_AMOUNT_GREATER");
        return PLUGIN_HANDLED;
    }

    if(arg[0] == '@')
    {
        new players[MAX_CLIENTS], inum;
        if(equali("T", arg[1])) copy(arg[1], charsmax(arg), "TERRORIST");
        if(equali("ALL", arg[1])) get_players(players, inum);
        else get_players(players, inum, "ae", arg[1]);

        if(inum == 0)
        {
            console_print(id, "[AMX_HEAL] %L", id, "REAMX_SUPER_NO_PLAYERS");
            return PLUGIN_HANDLED;
        }

        static ss;
        for(new i=0; i<inum; i++)
        {
            ss = players[i];
            if(id != ss && get_user_flags(ss) & ADMIN_IMMUNITY) continue;
            //player = ss;
            return ss;
        }
    }
}

public admin_heal(const id, const level, const cid)
{
    if(!cmd_access(id, level, cid, 3))
        return PLUGIN_HANDLED;

    new player = reamx_super_function();

    set_entvar(player, var_health, Float:get_entvar(player, var_health) + float(health));

    ...

    return PLUGIN_HANDLED;
}

for(new WeaponIdType:i = WEAPON_NONE + 1; i < any:MAX_WEAPONS /* macros from cssdk */; i++)
+
check dummy weapons.
So I will give ammo if just he has weapon?
 
Сообщения
1,697
Реакции
1,510
Помог
25 раз(а)
PurposeLess, the loop of the m_rgpPlayerItems with extract weapon.
 
Сообщения
10
Реакции
0
[AMXX] Displaying debug trace (plugin "reamx_super.amxx", version "1.4")
[AMXX] Run time error 4: index out of bounds
[AMXX] [0] reamx_super.sma :: @ call_func (line 189)
add these:
amx_restart
amx_badaim
amx_teamswap
+adminvoice
-adminvoice
 
Последнее редактирование:
Сообщения
278
Реакции
137
khashayar,
You need update your version of all. It works well for me.
I'll add these commands in other version. (amx_restart - amx_badaim will not be added cause it can be used for bad things.)
 
Последнее редактирование:
Сообщения
10
Реакции
0
I reinstalled the plugin and when I type amx_speed and some other commands the following message will be displayed
[AMXX] Displaying debug trace (plugin "reamx_super.amxx", version "1.5")
[AMXX] Run time error 4: index out of bounds
[AMXX] [0] reamx_super.sma :: @ call_func (line 193)
 
Сообщения
198
Реакции
16
Помог
1 раз(а)
khashayar,


Код:
//// reamx_super.sma
//
// Header size:           2560 bytes
// Code size:            57864 bytes
// Data size:            38672 bytes
// Stack/heap size:      16384 bytes
// Total requirements:  115480 bytes
// Done.
//
// Compilation Time: 0,75 sec
 
Сообщения
68
Реакции
8
Помог
2 раз(а)
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
есть у кого русский ланг файл?
 
Сообщения
2,750
Реакции
3,013
Помог
61 раз(а)
Код:
#include <amxmodx>

enum ACTIONS {
    ACT_HEAL,
    ACT_ARMOR
}

enum Feature {
    cmd[32],
    ACTIONS:action,
    action_access,
    description[64]
}

new const g_aActions[][Feature] = {
    {"amx_heal",    ACT_HEAL,      ADMIN_LEVEL_A, "<nick, #userid, authid or @team> <HP to give>"},
    {"amx_armor",   ACT_ARMOR,     ADMIN_LEVEL_A, "<nick, #userid, authid or @team> <ARMOR to give>"}
};

public plugin_init() {
    for(new actionID; actionID < sizeof g_aActions; actionID++) {
        register_concmd(g_aActions[actionID][cmd], "@call_func", actionID, g_aActions[actionID][description]);
    }
}

@call_func(const id, const actionID, const cid) {
    new access_level = g_aActions[actionID][action_access];
    if(~get_user_flags(id) & access_level) {
        return PLUGIN_HANDLED;
    }
    
    new ACTIONS: action_type = g_aActions[actionID][action];
    switch(action_type) {
        case ACT_HEAL: { }
        case ACT_ARMOR: { }
    }
    
    return PLUGIN_CONTINUE;
}

but, it would be better to divide everything into separate functions
 
Последнее редактирование:

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу