Правила форума Гаранты форума
Размещение рекламы AMX-X компилятор

Здравствуйте, гость Вход | Регистрация

Наши новости:

14-дек
24-апр
10-апр
11-апр

Помогите Изменить Флаг

Статус пользователя Turok005
сообщение 11.1.2010, 9:48
Сообщение #1
Стаж: 16 лет

Сообщений: 808
Благодарностей: 25
Полезность: < 0

Сам пробовал неполучилось, нужно изменить флаг n на флаг b подскажите, что нужно изменить в исходнике!? плагин adminlesten
блин почему то исходник запрещено загружать, выкладываю так

//ported by Oj@eKiLLzZz
// *******************************************************************************
// Admin Listen 2.3x, Also Copyright 2004, /dev/ urandom. No Warranties,
// either expressed or implied.
// Props to Maxim for the remake of Luke Sankeys original plugin.
// Props to Luke Sankey for the original AdminMod plugin (SankListen).
// Inspired by PsychoListen by PsychoGuard
//
// Allows administrators (with flag "n") to see all team chats, and dead chats.
//
// Use amx_adminlisten_voice 0|1 to turn off and on the hearing of voicecomms

// In 2.0 the Chat Engine was totally rewritten from ground up,
// a different, more efficent method, was used to pick up say messages,
// also fewer calculations and variables in this version.
//
// 2.1 - VoiceComm rewrite, fixed a few typos in the comments.
//
// 2.2 - Updated for Condition Zero 1.2, Note that while I've attempted to keep
// backwards compatability with other mods, I cannot vouch for it working
// in other mods as I only have a CS:CZ server to test it in.
//
// 2.3 - Updated to work with Counter-Strike after steams update June 14, 2004.
// *******************************************************************************


#include <amxmodx>
#include <amxmisc>
#include <engine>

// Counter for the SayText event.
new count[32][32]
new g_voice_status[2]

public catch_say(id)
{
new reciever = read_data(0) //Reads the ID of the message recipient
new sender = read_data(1) //Reads the ID of the sender of the message
new message[151] //Variable for the message
new channel[151]
new sender_name[32]

if (is_running("czero")||is_running("cstrike"))
{
read_data(2,channel,150)
read_data(4,message,150)
get_user_name(sender, sender_name, 31)
} else {
read_data(2,message,150)
}

// DEBUG.
// console_print(0, "DEBUG MESSAGE: %s", message)
// console_print(0, "DEBUG channel: %s", channel)
// console_print(0, "DEBUG sender: %s, %i", sender_name, sender)
// console_print(0, "DEBUG receiver: %i", reciever)

//With the SayText event, the message is sent to the person who sent it last.
//It's sent to everyone else before the sender recieves it.

// Keeps count of who recieved the message
count[sender][reciever] = 1
// If current SayText message is the last then...
if (sender == reciever)
{
new player_count = get_playersnum() //Gets the number of players on the server
new players[32] //Player IDs
get_players(players, player_count, "c")

for (new i = 0; i < player_count; i++)
{
// If the player is an admin...
if (get_user_flags(players[i]) & ADMIN_LEVEL_B)
{
// If the player did not recieve the message then...
if (count[sender][players[i]] != 1)
{
message_begin(MSG_ONE, get_user_msgid("SayText"),{0,0,0},players[i])
// Appends the ID of the sender to the message, so the engine knows what color to make the name.
write_byte(sender)
// Appends the message to the message (depending on the mod).
if (is_running("czero")||is_running("cstrike"))
{
write_string(channel)
write_string(sender_name)
}
write_string(message)
message_end()
}
}
count[sender][players[i]] = 0 //Set everyone's counter to 0 so it's ready for the next SayText
}
}

return PLUGIN_CONTINUE
}

public plugin_init(){
register_plugin("AdminListen","2.3x","/dev/ urandom")
register_srvcmd("amx_adminlisten_voice","voice_status")
register_event("SayText","catch_say","b")
return PLUGIN_CONTINUE
}

public plugin_modules(){
require_module("engine")
}

// *********************
// VoiceComm Stuff
// *********************

public client_infochanged(id)
{
if ((get_user_flags(id) & ADMIN_LEVEL_B) && equal(g_voice_status,"1")) set_speak(id, 4)
}

public client_connect(id)
{
if ((get_user_flags(id) & ADMIN_LEVEL_B) && equal(g_voice_status,"1")) set_speak(id, 4)
}

public voice_status(){
read_argv(1,g_voice_status,1)
new player_count = get_playersnum()
new players[32] //Player IDs
get_players(players, player_count, "c")
for (new i = 0; i < player_count; i++) {
if ((get_user_flags(players[i]) & ADMIN_LEVEL_B)){
if (equal(g_voice_status,"0")) set_speak(players[i], 0)
if (equal(g_voice_status,"1")) set_speak(players[i], 4)
}
}
}

Отредактировал: Turok005, - 11.1.2010, 9:51
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   Цитировать сообщение
Статус пользователя iLLuSioN
сообщение 11.1.2010, 10:47
Сообщение #2
Иконка группы

Стаж: 19 лет

Сообщений: 6911
Благодарностей: 7990
Полезность: 1639

Версия плагина по новее + флаг b
Код
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define ADMIN_ACCESS ADMIN_RESERVATION

#define SPEAK_NORMAL    0
#define SPEAK_MUTED    1
#define SPEAK_ALL        2
#define SPEAK_LISTENALL    4

new fm_plinfo[33]

public FM_SetListen(iReceiver, iSender, bListen)
{
    if( (fm_plinfo[iSender] & SPEAK_MUTED) != 0)
    {
        engfunc(EngFunc_SetClientListening, iReceiver, iSender, 0)

        forward_return(FMV_CELL,0)
        return FMRES_SUPERCEDE;
    }

    if( (fm_plinfo[iSender] & SPEAK_ALL) != 0)
    {
        engfunc(EngFunc_SetClientListening, iReceiver, iSender, 1)

        forward_return(FMV_CELL,1)
        return FMRES_SUPERCEDE;
    }

    if( (fm_plinfo[iReceiver] & SPEAK_LISTENALL) != 0)
    {
        engfunc(EngFunc_SetClientListening, iReceiver, iSender, 1)

        forward_return(FMV_CELL,1)
        return FMRES_SUPERCEDE;
    }

    return FMRES_IGNORED
}
stock fm_set_speak(id,tmp) (fm_plinfo[id] = tmp)


new count[32][32]    
new g_voice_status[2]


public plugin_init()
{
   register_plugin("AdminListen","2.5","/dev/ urandom V I R U S Hoboman")
   register_srvcmd("amx_adminlisten_voice","voice_status")
   register_event("SayText","catch_say","b")
   register_forward(FM_Voice_SetClientListening,"FM_SetListen");
   return PLUGIN_CONTINUE
}

public catch_say(id)
{
    new reciever = read_data(0)
    new sender = read_data(1)
    new message[151]
    new channel[151]
    new sender_name[32]

    if (is_running("czero")||is_running("cstrike"))
    {
        read_data(2,channel,150)
        read_data(4,message,150)
        get_user_name(sender, sender_name, 31)
    }
    else
    {
        read_data(2,message,150)
    }
    count[sender][reciever] = 1
    if (sender == reciever)
    {
        new player_count = get_playersnum()
        new players[32]
        get_players(players, player_count, "c")
    
        for (new i = 0; i < player_count; i++)
        {
            if (get_user_flags(players[i]) & ADMIN_ACCESS)
            {    
                if (count[sender][players[i]] != 1)
                {              
                    message_begin(MSG_ONE, get_user_msgid("SayText"),{0,0,0},players[i])
                    write_byte(sender)
                    if (is_running("czero")||is_running("cstrike"))
                    {
                        write_string(channel)
                        write_string(sender_name)
                    }
                    write_string(message)
                    message_end()
                }
            }
            count[sender][players[i]] = 0
        }
    }
    return PLUGIN_CONTINUE
}


public client_infochanged(id)
{
   if ((get_user_flags(id) & ADMIN_ACCESS) && equal(g_voice_status,"1") && is_user_connected(id)) fm_set_speak(id, SPEAK_LISTENALL)
}

public client_connect(id)
{
   if ((get_user_flags(id) & ADMIN_ACCESS) && equal(g_voice_status,"1") && is_user_connected(id)) fm_set_speak(id, SPEAK_LISTENALL)
}

public voice_status(id){
   read_argv(1,g_voice_status,1)
   new player_count = get_playersnum()
   new players[32]
   get_players(players, player_count, "c")
   for (new i = 0; i < player_count; i++) {
      if ((get_user_flags(players[i]) & ADMIN_ACCESS)) {        
         if (equal(g_voice_status,"0")) {
     fm_set_speak(players[i], SPEAK_NORMAL)
     }
         if (equal(g_voice_status,"1")) {
     fm_set_speak(players[i], SPEAK_LISTENALL)
     }
      }
   }
}


Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя Z[1].
сообщение 16.3.2010, 23:31
Сообщение #3


Стаж: 18 лет

Сообщений: 981
Благодарностей: 287
Полезность: 265

iLLuSioN,
просьба изменить на флаг d (бан)
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя STR@TEG
сообщение 16.3.2010, 23:58
Сообщение #4
Стаж: 16 лет

Сообщений: 4186
Благодарностей: 1763
Полезность: 837

0ne,
Раскрывающийся текст
Код
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define ADMIN_ACCESS ADMIN_BAN

#define SPEAK_NORMAL    0
#define SPEAK_MUTED    1
#define SPEAK_ALL        2
#define SPEAK_LISTENALL    4

new fm_plinfo[33]

public FM_SetListen(iReceiver, iSender, bListen)
{
    if( (fm_plinfo[iSender] & SPEAK_MUTED) != 0)
    {
        engfunc(EngFunc_SetClientListening, iReceiver, iSender, 0)

        forward_return(FMV_CELL,0)
        return FMRES_SUPERCEDE;
    }

    if( (fm_plinfo[iSender] & SPEAK_ALL) != 0)
    {
        engfunc(EngFunc_SetClientListening, iReceiver, iSender, 1)

        forward_return(FMV_CELL,1)
        return FMRES_SUPERCEDE;
    }

    if( (fm_plinfo[iReceiver] & SPEAK_LISTENALL) != 0)
    {
        engfunc(EngFunc_SetClientListening, iReceiver, iSender, 1)

        forward_return(FMV_CELL,1)
        return FMRES_SUPERCEDE;
    }

    return FMRES_IGNORED
}
stock fm_set_speak(id,tmp) (fm_plinfo[id] = tmp)


new count[32][32]    
new g_voice_status[2]


public plugin_init()
{
   register_plugin("AdminListen","2.5","/dev/ urandom V I R U S Hoboman")
   register_srvcmd("amx_adminlisten_voice","voice_status")
   register_event("SayText","catch_say","b")
   register_forward(FM_Voice_SetClientListening,"FM_SetListen");
   return PLUGIN_CONTINUE
}

public catch_say(id)
{
    new reciever = read_data(0)
    new sender = read_data(1)
    new message[151]
    new channel[151]
    new sender_name[32]

    if (is_running("czero")||is_running("cstrike"))
    {
        read_data(2,channel,150)
        read_data(4,message,150)
        get_user_name(sender, sender_name, 31)
    }
    else
    {
        read_data(2,message,150)
    }
    count[sender][reciever] = 1
    if (sender == reciever)
    {
        new player_count = get_playersnum()
        new players[32]
        get_players(players, player_count, "c")
    
        for (new i = 0; i < player_count; i++)
        {
            if (get_user_flags(players[i]) & ADMIN_ACCESS)
            {    
                if (count[sender][players[i]] != 1)
                {              
                    message_begin(MSG_ONE, get_user_msgid("SayText"),{0,0,0},players[i])
                    write_byte(sender)
                    if (is_running("czero")||is_running("cstrike"))
                    {
                        write_string(channel)
                        write_string(sender_name)
                    }
                    write_string(message)
                    message_end()
                }
            }
            count[sender][players[i]] = 0
        }
    }
    return PLUGIN_CONTINUE
}


public client_infochanged(id)
{
   if ((get_user_flags(id) & ADMIN_ACCESS) && equal(g_voice_status,"1") && is_user_connected(id)) fm_set_speak(id, SPEAK_LISTENALL)
}

public client_connect(id)
{
   if ((get_user_flags(id) & ADMIN_ACCESS) && equal(g_voice_status,"1") && is_user_connected(id)) fm_set_speak(id, SPEAK_LISTENALL)
}

public voice_status(id){
   read_argv(1,g_voice_status,1)
   new player_count = get_playersnum()
   new players[32]
   get_players(players, player_count, "c")
   for (new i = 0; i < player_count; i++) {
      if ((get_user_flags(players[i]) & ADMIN_ACCESS)) {        
         if (equal(g_voice_status,"0")) {
     fm_set_speak(players[i], SPEAK_NORMAL)
     }
         if (equal(g_voice_status,"1")) {
     fm_set_speak(players[i], SPEAK_LISTENALL)
     }
      }
   }
}
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя Z[1].
сообщение 17.3.2010, 0:58
Сообщение #5


Стаж: 18 лет

Сообщений: 981
Благодарностей: 287
Полезность: 265

STR@TEG,
отблагодарил!
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
  Тема закрытаНачать новую тему
 
0 пользователей и 2 гостей читают эту тему: