搜索
查看: 5084|回复: 3

谁好心帮我改下plmenu插件

[复制链接]
发表于 2008-9-6 14:49:37 | 显示全部楼层 |阅读模式 来自 中国–四川–成都
现在使用的plmenu插件可以投票,但是封不到人,看了下说的是检查authid为4294967295 OR VALVE_ID_LAN OR HLTV, 才改为封玩家IP,用OP封了以后,得到结果ID: STEAM_0:0:0,有没有办法让插件检查uniqueid,如果值是VALVE_0:0:0,就改为封玩家IP,我建的服务器所有玩家的uniqueid是VALVE_0:0:0,或者不检查能直接投票封IP也好,附代码

public actionBanMenu(id, key)
{
switch (key)
{
case 7:
{
/* BEGIN OF CHANGES BY MISTAGEE ADDED A FEW MORE OPTIONS */

++g_menuOption[id]
g_menuOption[id] %= ArraySize(g_bantimes);

g_menuSettings[id] = ArrayGetCell(g_bantimes, g_menuOption[id]);
displayBanMenu(id, g_menuPosition[id])
}
case 8: displayBanMenu(id, ++g_menuPosition[id])
case 9: displayBanMenu(id, --g_menuPosition[id])
default:
{
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
new name[32], name2[32], authid[32], authid2[32]

get_user_name(player, name2, 31)
get_user_authid(id, authid, 31)
get_user_authid(player, authid2, 31)
get_user_name(id, name, 31)

new userid2 = get_user_userid(player)

log_amx("Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (minutes ^"%d^")", name, get_user_userid(id), authid, name2, userid2, authid2, g_menuSettings[id])
if (g_menuSettings[id]==0) // permanent
{
new maxpl = get_maxplayers();
for (new i = 1; i <= maxpl; i++)
{
show_activity_id(i, id, name, "%L %s %L", i, "BAN", name2, i, "PERM");
}
}
else
{
new tempTime[32];
formatex(tempTime,sizeof(tempTime)-1,"%d",g_menuSettings[id]);
new maxpl = get_maxplayers();
for (new i = 1; i <= maxpl; i++)
{
show_activity_id(i, id, name, "%L %s %L", i, "BAN", name2, i, "FOR_MIN", tempTime);
}
}
/* ---------- check for Steam ID added by MistaGee --------------------
IF AUTHID == 4294967295 OR VALVE_ID_LAN OR HLTV, BAN PER IP TO NOT BAN EVERYONE */

if (equal("4294967295", authid2)
|| equal("HLTV", authid2)
|| equal("STEAM_ID_LAN", authid2)
|| equali("VALVE_ID_LAN", authid2))
{
/* END OF MODIFICATIONS BY MISTAGEE */
new ipa[32]
get_user_ip(player, ipa, 31, 1)

server_cmd("addip %d %s;writeip", g_menuSettings[id], ipa)
}
else
{
server_cmd("banid %d #%d kick;writeid", g_menuSettings[id], userid2)
}

server_exec()
displayBanMenu(id, g_menuPosition[id])
发表于 2009-7-5 19:40:44 | 显示全部楼层 来自 中国–新疆–哈密
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. /* Player Menus */
  4. #define MAX_MENU_NUM 24
  5. new g_MenuName[ MAX_MENU_NUM ][32]
  6. new g_MenuCmd[ MAX_MENU_NUM ][32]
  7. new PMenuName[] = "Player Menu"
  8. new g_MenuItem[3][] = {
  9. "More",
  10. "Back",
  11. "Exit"
  12. }
  13. new g_cNum
  14. new g_menuPosition[33]
  15. public plugin_init() {
  16. register_plugin("Player Menu","0.1","nwb13")
  17. register_menucmd(register_menuid( PMenuName ),1023,"actionPlMenu")
  18. register_clcmd("say menu","PlMenu",ADMIN_ALL, "display player menu" )
  19. new configs[64]
  20. get_configsdir(configs, 63)
  21. format(configs, 63, "%s/%s", configs, "plmenu.ini")
  22. loadSettings(configs)
  23. }
  24. loadSettings(plmenuconfig[]) {
  25. if (!file_exists(plmenuconfig))
  26.   return 0
  27. new temp[256]
  28. new a, pos = 0
  29. while ( g_cNum < MAX_MENU_NUM && read_file(plmenuconfig,pos++,temp,255,a) ) {      
  30. if ( temp[0] == ';' )
  31.   continue
  32. if (parse(temp,g_MenuName[g_cNum],31,g_MenuCmd[g_cNum],31) < 2)
  33.   continue
  34. ++g_cNum
  35. }
  36. return 1
  37. }
  38. public PlMenu(id){
  39. if (is_user_connected(id))
  40.   disPlayerMenu(id,g_menuPosition[id] = 0)
  41. return PLUGIN_HANDLED
  42. }
  43. disPlayerMenu(id,pos) {
  44. if (pos < 0)  return
  45. new menuBody[512]
  46. new b = 0
  47. new start = pos * 8
  48. if (start >= g_cNum )
  49.   start = pos = g_menuPosition[id] = 0
  50. new len = format(menuBody,511,"\y%s\R%d/%d^n\w^n",PMenuName,pos+1,( g_cNum / 8 + ((g_cNum % 8) ? 1 : 0 )) )
  51. new end = start + 8
  52. new keys = MENU_KEY_0
  53. if (end > g_cNum )
  54.   end = g_cNum
  55. for (new a = start; a < end; ++a) {
  56.   keys |= (1<<b)
  57.   len += format(menuBody[len],511-len,"%d. %s^n",++b,g_MenuName[a])
  58. }
  59. if (end != g_cNum ) {
  60.       format(menuBody[len],511-len,"^n9. %s...^n0. %s", g_MenuItem[0], pos ? g_MenuItem[1] : g_MenuItem[2])
  61.   keys |= MENU_KEY_9
  62. }
  63. else format(menuBody[len],511-len,"^n0. %s",pos ? g_MenuItem[1] : g_MenuItem[2])
  64. show_menu(id,keys,menuBody,-1,PMenuName)
  65. }
  66. public actionPlMenu(id,key){
  67. switch(key){
  68.   case 8:{
  69.    disPlayerMenu(id,++g_menuPosition[id])
  70.   }
  71.   case 9:{
  72.    disPlayerMenu(id,--g_menuPosition[id])
  73.   }
  74.   default:{
  75.    new menuitem = g_menuPosition[id] * 8 + key
  76.    client_cmd(id,"%s",g_MenuCmd[menuitem])
  77.   }
  78. }
  79. return PLUGIN_HANDLED
  80. }
复制代码
回复

使用道具 举报

发表于 2021-2-24 23:23:59 | 显示全部楼层 来自 中国–江西–景德镇
厉害厉害厉害厉害
回复

使用道具 举报

发表于 2021-3-18 10:59:05 | 显示全部楼层 来自 中国–香港
兼职是大神
佩服了~~~
福彩双色球

幸运飞艇

天津快乐十分
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表