AMX MOD X
Пятница, 19.04.2024, 06:06:59



Приветствую Вас Гость | RSS
[ Главная ] [ Скрестил AMXX Ban Snapshot и Amxbans - AMX Mod X Форум ] [ Регистрация ] [ Вход ]
[ Новые сообщения · Участники · Правила форума · Поиск · RSS ]

Вниманию участников! Данный форум теперь является архивом и вскором времени здесь нельзя будет создавать новых тем! Просьба всем для общения и создания новых тем перейти на наш новый форум: http://amxmodx.su/

  • Страница 1 из 1
  • 1
Модератор форума: slogic, AlMod  
AMX Mod X Форум » Скриптинг » Помощь по скриптингу » Скрестил AMXX Ban Snapshot и Amxbans (1 ошибка не пойму))
Скрестил AMXX Ban Snapshot и Amxbans
LeXiKoNДата: Воскресенье, 10.05.2009, 20:58:17 | Сообщение # 1
Майор
Группа: Пользователи
Сообщений: 85
Репутация: 1
Статус: Не в сети
Писал автору плага amxx ban snaphots чтобы он сделал меню для банов через него...сказал что это не нужно никому...короче тупит <_<
Решил тупо скрестить с amxbans!
Помогите плиз! есть одна осталась ошибка, остальные вроде как исправил
короче взял функцию с amx_ban_snapshot
Code
public cmdBansSS(id,level,cid)
{
  if (get_pcvar_num(g_BanType) !=2)
   return PLUGIN_HANDLED
   
  if(!cmd_access(id, level, cid, 2))
   return PLUGIN_HANDLED
    
  new name[32], timer[32],hostname[64], name2[32], ip[32],authid2[32], country[33], site[64]
  new arg[8], arg2[32], arg3[64]
  read_argv(1,arg,7)
  read_argv(2,arg2,31)
  read_argv(3,arg3,63)
  new bantime = str_to_num(arg)
  new target = cmd_target(id, arg2, 10)
  new id = get_user_userid(target)
  get_user_name(id, name, 31)
  get_user_name(target, name2, 31)
  get_user_authid(target, authid2, 31)
  get_user_ip(target, ip, 31, 1)
  geoip_country(ip, country)
  get_time("%d/%m/%Y - %H:%M:%S", timer, 63)
  get_pcvar_string(g_Hostname, hostname, charsmax(hostname))
  get_pcvar_string(g_UnbanURL, site, charsmax(site))
   
  if(!target)
   return PLUGIN_HANDLED
   
  new iMsgType = get_pcvar_num(g_MessageType);
   
  switch( iMsgType ) {
   case 1: {
    /* Show screen messages in chat */
    client_printc(target,"%L", target, "SS_MSG1", name)
    client_printc(target,"%L", target, "SS_MSG2", timer, hostname)
    client_printc(target,"%L", target, "SS_MSG3", name2, ip, authid2, country)
    client_printc(target,"%L", target, "SS_MSG4", site)
   }
   case 2: {  
    /* Show screen messages in hud */
    set_hudmessage(150, 0, 255, -1.0, 0.1, 0, 0.25, 1.0, 0.0, 0.0, 4)
    show_hudmessage(target, "%L", target, "SS_MSG_HUD", timer, hostname, name2, ip, authid2, country, site)
   }
   case 3: {  
    /* Show screen messages in chat */
    client_printc(target,"%L", target, "SS_MSG1", name)
    client_printc(target,"%L", target, "SS_MSG2", timer, hostname)
    client_printc(target,"%L", target, "SS_MSG3", name2, ip, authid2, country)
    client_printc(target,"%L", target, "SS_MSG4", site)
     
    /* Show screen messages in hud */
    set_hudmessage(150, 0, 255, -1.0, 0.1, 0, 0.25, 1.0, 0.0, 0.0, 4)
    show_hudmessage(target, "%L", target, "SS_MSG_HUD", timer, hostname, name2, ip, authid2, country, site)
   }
  }
  client_cmd(target,"snapshot;wait;snapshot;wait;snapshot")
   
  /* Confirm for the admin in console that the command was commited */
  console_print(id,"%L", id, "SS_CONSOLE", name2)
   
  if(bantime == 0)
  {
   /* Ban player permenetly */
   server_cmd("amx_ban 0 #%d %s", id, arg3)
    
   } else {
    
   /* Ban plyer by time */
   server_cmd("amx_ban %d #%d %s", bantime, id, arg3)
  }
  return PLUGIN_HANDLED
}

использовал часть ее в amxbans
там же в amxbans заменил ф-ю public delayed_kick
Code

public delayed_kick(id_str[])
{
  new player_id = str_to_num(id_str)
  new userid = get_user_userid(player_id)

  new target = cmd_target(id, arg2, 10)
  new id = get_user_userid(target)

  new name[32], timer[32],hostname[64], name2[32], ip[32],authid2[32], country[33], site[64]
  new arg[8], arg2[32], arg3[64]
  read_argv(1,arg,7)
  read_argv(2,arg2,31)
  read_argv(3,arg3,63)
  get_user_name(id, name, 31)
  get_user_name(target, name2, 31)
  get_user_authid(target, authid2, 31)
  get_user_ip(target, ip, 31, 1)
  geoip_country(ip, country)
  get_time("%d/%m/%Y - %H:%M:%S", timer, 63)
  get_pcvar_string(g_Hostname, hostname, charsmax(hostname))
  get_pcvar_string(g_UnbanURL, site, charsmax(site))

  if ( get_pcvar_num(amxbans_debug) == 1 )
   log_amx("[AMXBANS DEBUG] Delayed Kick ID: <%s>", id_str)
           
  if(!target)
   return PLUGIN_HANDLED
   
  new iMsgType = get_pcvar_num(g_MessageType);
   
  switch( iMsgType ) {
   case 1: {
    /* Show screen messages in chat */
    client_printc(target,"%L", target, "SS_MSG1", name)
    client_printc(target,"%L", target, "SS_MSG2", timer, hostname)
    client_printc(target,"%L", target, "SS_MSG3", name2, ip, authid2, country)
    client_printc(target,"%L", target, "SS_MSG4", site)
   }
   case 2: {  
    /* Show screen messages in hud */
    set_hudmessage(150, 0, 255, -1.0, 0.1, 0, 0.25, 1.0, 0.0, 0.0, 4)
    show_hudmessage(target, "%L", target, "SS_MSG_HUD", timer, hostname, name2, ip, authid2, country, site)
   }
   case 3: {  
    /* Show screen messages in chat */
    client_printc(target,"%L", target, "SS_MSG1", name)
    client_printc(target,"%L", target, "SS_MSG2", timer, hostname)
    client_printc(target,"%L", target, "SS_MSG3", name2, ip, authid2, country)
    client_printc(target,"%L", target, "SS_MSG4", site)
     
    /* Show screen messages in hud */
    set_hudmessage(150, 0, 255, -1.0, 0.1, 0, 0.25, 1.0, 0.0, 0.0, 4)
    show_hudmessage(target, "%L", target, "SS_MSG_HUD", timer, hostname, name2, ip, authid2, country, site)
   }
  }
  client_cmd(target,"snapshot;wait;snapshot;wait;snapshot;wait;snapshot")
   
  /* Confirm for the admin in console that the command was commited */
  console_print(id,"%L", id, "SS_CONSOLE", name2)

  set_task(1.0, "actual_kick", userid)

    
  return PLUGIN_CONTINUE
}

public actual_kick(userid)
{
  new kick_message[128]
  format(kick_message,127,"%L", LANG_PLAYER,"KICK_MESSAGE")
  server_cmd("kick #%d  %s",userid, kick_message)
}

что то тут не так(( с этими
Quote
new player_id = str_to_num(id_str)
new userid = get_user_userid(player_id)

new target = cmd_target(id, arg2, 10)
new id = get_user_userid(target)

Прикрепления: amx_ban_snapsho.sma (10.7 Kb) · amxbans5.1scr.sma (27.2 Kb)
 
RockonДата: Понедельник, 11.05.2009, 16:50:58 | Сообщение # 2
Подполковник
Группа: Скриптеры
Сообщений: 137
Репутация: 1
Статус: Не в сети
было бы прощевыложить весь исходник :)
 
LeXiKoNДата: Понедельник, 11.05.2009, 17:15:15 | Сообщение # 3
Майор
Группа: Пользователи
Сообщений: 85
Репутация: 1
Статус: Не в сети
я выложил весь исходник)
 
LeXiKoNДата: Воскресенье, 17.05.2009, 18:19:37 | Сообщение # 4
Майор
Группа: Пользователи
Сообщений: 85
Репутация: 1
Статус: Не в сети
короче я сделал сам) всем спасибо за помощь))) выкладываю модифицированый amxbans) делает 4 скрина на клиенте и банит.... скрины с инфой о времени в чате и HUD)) короче все возможности amx_ban_snapshot

Добавлено (2009-05-17, 6:18 Pm)
---------------------------------------------
тему поднимаю! решил чуть переделать то что делал выше в теме)) Был недоволен тем что скрины делались после показа motd окна! Поэтому сообщения HUD и в чате невозможно было прочитать!!
Нужно сделать чтоб скрины делались ДО показа мотд окна!
сделал тупо в menu.inl но тогда скрины делаются токо если банить через меню....
Опять байда...
надо как то предположим функцию

Code
public amxbans_ss(id,level,cid)
{
  if(!cmd_access(id, level, cid, 2))
   return PLUGIN_HANDLED
    
  new name[32], timer[32],hostname[64], name2[32], ip[32],authid2[32], country[33], site[64]
  new arg[8], arg2[32], arg3[64]
  read_argv(1,arg,7)
  read_argv(2,arg2,31)
  read_argv(3,arg3,63)
  new target = cmd_target(id, arg2, 10)
  new id = get_user_userid(target)
  get_user_name(id, name, 31)
  get_user_name(target, name2, 31)
  get_user_authid(target, authid2, 31)
  get_user_ip(target, ip, 31, 1)
  geoip_country(ip, country)
  get_time("%d/%m/%Y - %H:%M:%S", timer, 63)
  get_pcvar_string(g_Hostname, hostname, charsmax(hostname))
  get_pcvar_string(g_UnbanURL, site, charsmax(site))
   
  if(!target)
   return PLUGIN_HANDLED
   
  new iMsgType = get_pcvar_num(g_MessageType);
   
  switch( iMsgType ) {
   case 1: {
    /* Show screen messages in chat */
    client_printc(target,"%L", target, "AMXBANS_SS_MSG1", name)
    client_printc(target,"%L", target, "AMXBANS_SS_MSG2", timer, hostname)
    client_printc(target,"%L", target, "AMXBANS_SS_MSG3", name2, ip, authid2, country)
    client_printc(target,"%L", target, "AMXBANS_SS_MSG4", site)
   }
   case 2: {  
    /* Show screen messages in hud */
    set_hudmessage(150, 0, 255, -1.0, 0.1, 0, 0.25, 1.0, 0.0, 0.0, 4)
    show_hudmessage(target, "%L", target, "AMXBANS_SS_MSG_HUD", timer, hostname, name2, ip, authid2, country, site)
   }
   case 3: {  
    /* Show screen messages in chat */
    client_printc(target,"%L", target, "AMXBANS_SS_MSG1", name)
    client_printc(target,"%L", target, "AMXBANS_SS_MSG2", timer, hostname)
    client_printc(target,"%L", target, "AMXBANS_SS_MSG3", name2, ip, authid2, country)
    client_printc(target,"%L", target, "AMXBANS_SS_MSG4", site)
     
    /* Show screen messages in hud */
    set_hudmessage(150, 0, 255, -1.0, 0.1, 0, 0.25, 1.0, 0.0, 0.0, 4)
    show_hudmessage(target, "%L", target, "AMXBANS_SS_MSG_HUD", timer, hostname, name2, ip, authid2, country, site)
   }
  }
  client_cmd(target,"snapshot;wait;snapshot;wait;snapshot;wait;snapshot")
   
  /* Confirm for the admin in console that the command was commited */
  console_print(id,"%L", id, "AMXBANS_SS_CONSOLE", name2)
   
  return PLUGIN_HANDLED
}

встроить в функцию самого бана public cmdBan(id, level, cid)
вопрос как это сделать? )) через set_task бред мне кажется!
функция бана находится в cmdBan.inl

Добавлено (2009-05-17, 6:19 Pm)
---------------------------------------------
выручайте

Прикрепления: 0887715.sma (26.4 Kb) · amxbans_screen_.txt (6.6 Kb)
 
AMX Mod X Форум » Скриптинг » Помощь по скриптингу » Скрестил AMXX Ban Snapshot и Amxbans (1 ошибка не пойму))
  • Страница 1 из 1
  • 1
Поиск:

AMX Mod X Russian Community © 2006-2024