Поиск 'You have the bomb' plugin

Сообщения
283
Реакции
28
Помог
2 раз(а)
Looking for a plugin that announces the tero with the bomb at every round start through a hud/dhud message : "You have the bomb!"
 
Сообщения
165
Реакции
-8
Kobra,
Код:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

#define MSG_MODE // DHUD/HUD
#define SOUND // INFO SOUND

#define MSG "!~ You have the bomb C4 ~!"

#define IsPlayer(%1) (1 <= %1 <= players)
new players;

new const C4_Info_Sound[] = "events/tutor_msg.wav";

public plugin_init(){
   
    register_plugin("C4 Info", "1.0",  "SCHOCKKWAVE");
    register_event("HLTV", "event_NewRound", "a", "1=0", "2=0")
   
    players = get_maxplayers();
   
}

public event_NewRound(id) set_task(1.0, "C4_Info", id)

public C4_Info()
{
    for(new i = 1; i <= players; i++) {
       
        if( is_user_connected( i ) && cs_get_user_team( i ) == CS_TEAM_T && user_has_weapon(i, CSW_C4) )  {  
       
            #if defined MSG_MODE
            set_dhudmessage(i, 255, 255, -1.0, -0.70, 0, 6.0, 0.1, 0.01, 1.5 )
            show_dhudmessage(i, MSG)
            #else
            set_hudmessage(i, 255, 255, -1.0, -0.70, 1, 0.0, 4.0, 0.0, 0.0, 1)
            show_hudmessage(i, MSG)
            #endif
           
             #if defined SOUND
             client_cmd(i, "spk %s", C4_Info_Sound)
             #endif
        }
    }
}
 

Вложения

Сообщения
475
Реакции
249
Помог
6 раз(а)
Так такое сообщение же стандартно показывается внизу. Зачем дублировать?

2.PNG

Да и желание людей пострелять вместо того, чтобы ставить бомбу, простыми сообщениями не перебьёшь)

Но если мои аргументы не убеждают, вот ReAPI версия плагина, предоставленного выше (про модуль cstrike уже забыть пора):
Код:
#include <amxmodx>
#include <reapi>

#define MSG_MODE    // DHUD/HUD
#define SOUND        // INFO SOUND

new const g_szInfoMessage[] = "!~ You have the bomb C4 ~!"

#define IsPlayer(%0) (1 <= %0 <= MaxClients)

new const g_szInfoSound[] = "events/tutor_msg.wav"

public plugin_init() {
    register_plugin("C4 Info", "2.0 [ReAPI]", "SCHOCKKWAVE & CHEL74")

    RegisterHookChain(RG_CBasePlayer_MakeBomber, "MakeBomber_Post", true)
}

public MakeBomber_Post(pPlayer) {
    #if defined MSG_MODE
        set_dhudmessage(pPlayer, 255, 255, 255, -1.0, -0.70, 0, 6.0, 0.1, 0.01, 1.5)
        show_dhudmessage(pPlayer, g_szInfoMessage)
    #else
        set_hudmessage(pPlayer, 255, 255, 255, -1.0, -0.70, 1, 0.0, 4.0, 0.0, 0.0, -1)
        show_hudmessage(pPlayer, g_szInfoMessage)
    #endif

    #if defined SOUND
        rg_send_audio(pPlayer, g_szInfoSound)
    #endif
}
 
Последнее редактирование:

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

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