Smoke giver edit reapi vip flag

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
15
Реакции
0
Hello friends

First of all, I want to congratulate everyone on the new year and if possible, a little help

This plugin can be modified in reapi and put on flag t

thanks in advance
 

Вложения

Сообщения
673
Реакции
242
Помог
11 раз(а)
Код:
#include <amxmodx>
#include <reapi>

#define PLUGIN_NAME "Smoke Grenade Giver"
#define PLUGIN_VERSION "0.1"
#define PLUGIN_AUTHOR "VEN"

#define FLAGS "t"

#define GIVE_TIME_INTERVAL 30.0

public plugin_init() {
    register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)

    set_task(GIVE_TIME_INTERVAL, "task_give_smokegren", _, _, _, "b")
}

public task_give_smokegren() {
    for(new i = 0;i <= MaxClients; i++)
    {
        if(!is_user_alive(i)) continue;
        
        if(get_user_flags(i) & read_flags(FLAGS))
            rg_give_item(i, "weapon_smokegrenade", GT_REPLACE);
    }   
}
 
Сообщения
15
Реакции
0
Код:
#include <amxmodx> 
#include <fun> 
#include <cstrike>   

public plugin_init() 
{     
    register_plugin( "Scout", "1.2", "Wrecked" )  
    register_clcmd("say /scout", "GiveScout") 
}

public GiveScout(id) 
{     
    if(cs_get_user_team(id) == CS_TEAM_CT)     
    {       
        if(is_user_alive(id) && !user_has_weapon( id, CSW_SCOUT ))
        {               
            new weapon = give_item(id, "weapon_scout") 
            
            if(weapon > 0)       
                cs_set_weapon_ammo(weapon, 0)      

            cs_set_user_bpammo(id, CSW_SCOUT, 0)     
        }    
    } 
}
Not to open a new topic for this small problem. You can modify this sma for reapi, as well as that when /scout is written, it can take scout and CT and T, and set it to a specific flag, for example t, so I will change it as needed
 
Сообщения
218
Реакции
63
Помог
2 раз(а)
zvrle13, change here
Код:
rg_give_item(i, "weapon_smokegrenade", GT_REPLACE);
to
Код:
rg_give_item(i, "weapon_scout", GT_REPLACE);
rg_set_user_bpammo(i, WEAPON_SCOUT, 90);
 
Сообщения
1,082
Реакции
58
Помог
11 раз(а)
zvrle13,
Код:
#include <amxmodx>
#include <reapi>

/*Access flag*/
#define FLAGS "t"

#define IS_ACCESS(%0,%1) bool:(get_user_flags(%0) & %1)
#define IS_TEAM(%0,%1) bool:(get_member(%0, m_iTeam) == %1)

new gBitFlags;

public plugin_init() {
    register_plugin( "Scout", "1.2", "Wrecked");

    register_clcmd("say /test", "GiveScout");
    gBitFlags = read_flags(FLAGS);
}

public GiveScout(id) {
    if(is_user_alive(id) && IS_ACCESS(id, gBitFlags) && IS_TEAM(id, TEAM_CT)) {
        if(!rg_has_item_by_name(id, "weapon_scout")) {
            rg_give_item(id, "weapon_scout", GT_REPLACE);
            rg_set_user_bpammo(id, WEAPON_SCOUT, 90);
        }
    }
}
 
Последнее редактирование:
Сообщения
15
Реакции
0
zvrle13,
Код:
#include <amxmodx>
#include <reapi>

/*Access flag*/
#define FLAGS "t"

#define IS_ACCESS(%0,%1) bool:(get_user_flags(%0) & %1)
#define IS_TEAM(%0,%1) bool:(get_member(%0, m_iTeam) == %1)

new gBitFlags;

public plugin_init() {
    register_plugin( "Scout", "1.2", "Wrecked");

    register_clcmd("say /test", "GiveScout");
    gBitFlags= read_flags(FLAGS);
}

public GiveScout(id) {
    if(is_user_alive(id) && IS_ACCESS(id, gBitFlags) && IS_TEAM(id, TEAM_CT)) {
        if(!rg_has_item_by_name(id, "weapon_scout")) {
            rg_give_item(id, "weapon_scout", GT_REPLACE);
            rg_set_user_bpammo(id, WEAPON_SCOUT, 90);
        }
    }
}
I also need it for the T team that when they enter /scout, the terrorists can also get a scout
 
Сообщения
1,082
Реакции
58
Помог
11 раз(а)
zvrle13,
Код:
-#define IS_TEAM(%0,%1) bool:(get_member(%0, m_iTeam) == %1)

-if(is_user_alive(id) && IS_ACCESS(id, gFlags) && IS_TEAM(id, TEAM_CT)) {
+if(is_user_alive(id) && IS_ACCESS(id, gFlags)) {
 
Сообщения
15
Реакции
0
Code_0xABC can you add that this /scout command can only be used 1 time during 1 round.
 
Последнее редактирование:
Сообщения
265
Реакции
0
Предупреждения
2
Помог
5 раз(а)
Vaqtincha, что ты такой агрессивный и почему тебе не дали бан, как бы справедливо оскорбления.
 
Сообщения
657
Реакции
562
Предупреждения
8
Помог
9 раз(а)
zvrle13, Я вас разочарую. Я неадекватный человек и не стоит использовать мои плагины.
 
Сообщения
137
Реакции
23
Помог
2 раз(а)
Code_0xABC can you add that this /scout command can only be used 1 time during 1 round.

C++:
#include <amxmodx>
#include <reapi>

/*Access flag*/
#define FLAGS "t"

#define IS_ACCESS(%0,%1) bool:(get_user_flags(%0) & %1)
#define IS_TEAM(%0,%1) bool:(get_member(%0, m_iTeam) == %1)

new gBitFlags, g_iRound;
new bool:g_iCommandExecuted[MAX_CLIENTS + 1];

public plugin_init() {
    register_plugin( "Scout", "1.2", "Wrecked");

    register_clcmd("say /test", "GiveScout");
    gBitFlags= read_flags(FLAGS);

    RegisterHookChain(RG_CSGameRules_RestartRound, "@CSGameRules_RestartRound_Pre", .post = false);
}

@CSGameRules_RestartRound_Pre() {
    g_iRound = get_member_game(m_bCompleteReset) ? 0 : (g_iRound + 1);
    arrayset(g_iCommandExecuted, false, sizeof g_iCommandExecuted);
}

public GiveScout(id) {
    if (is_user_alive(id) && IS_ACCESS(id, gBitFlags) && IS_TEAM(id, TEAM_CT)) {
        if (g_iCommandExecuted[id] == true) {
            client_print_color(id, print_team_default, "You have already used /test in this round.");
            return PLUGIN_HANDLED;
        }

        if (!rg_has_item_by_name(id, "weapon_scout")) {
            rg_give_item(id, "weapon_scout", GT_REPLACE);
            rg_set_user_bpammo(id, WEAPON_SCOUT, 90);
        }

        g_iCommandExecuted[id] = true;
    }

    return PLUGIN_HANDLED;
}
 
Сообщения
1,082
Реакции
58
Помог
11 раз(а)
zvrle13,
Код:
#include <amxmodx>
#include <reapi>

/*Access flag*/
#define FLAGS "t"

#define IS_ACCESS(%0,%1) bool:(get_user_flags(%0) & %1)
#define IS_TEAM(%0,%1) bool:(get_member(%0, m_iTeam) == %1)

new
    gBitFlags,
    bool:g_iCommandExecuted[MAX_CLIENTS +1];

public plugin_init() {
    register_plugin( "Scout", "1.2", "Wrecked");

    register_clcmd("say /test", "GiveScout");
    gBitFlags= read_flags(FLAGS);

    RegisterHookChain(RG_CSGameRules_RestartRound, "@CSGameRules_RestartRound_Pre");
}

@CSGameRules_RestartRound_Pre()
    arrayset(g_iCommandExecuted, false, sizeof g_iCommandExecuted);

public client_disconnected(id)
    g_iCommandExecuted[id] = false;

public GiveScout(id) {
    if(is_user_alive(id) && IS_ACCESS(id, gBitFlags) && IS_TEAM(id, TEAM_CT)) {
        if(!rg_has_item_by_name(id, "weapon_scout")) {
            if(g_iCommandExecuted[id]) {
                client_print_color(id, print_team_default, "You have already used /test in this round.");
                return PLUGIN_HANDLED;
            }

            rg_give_item(id, "weapon_scout", GT_REPLACE);
            rg_set_user_bpammo(id, WEAPON_SCOUT, 90);

            g_iCommandExecuted[id] = true;
        }
    }

    return PLUGIN_HANDLED;
}
 
Последнее редактирование:
Статус
В этой теме нельзя размещать новые ответы.

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

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