谁好心帮我改下plmenu插件
现在使用的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
g_menuOption %= ArraySize(g_bantimes);
g_menuSettings = ArrayGetCell(g_bantimes, g_menuOption);
displayBanMenu(id, g_menuPosition)
}
case 8: displayBanMenu(id, ++g_menuPosition)
case 9: displayBanMenu(id, --g_menuPosition)
default:
{
new player = g_menuPlayers * 7 + key]
new name, name2, authid, authid2
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)
if (g_menuSettings==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;
formatex(tempTime,sizeof(tempTime)-1,"%d",g_menuSettings);
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
get_user_ip(player, ipa, 31, 1)
server_cmd("addip %d %s;writeip", g_menuSettings, ipa)
}
else
{
server_cmd("banid %d #%d kick;writeid", g_menuSettings, userid2)
}
server_exec()
displayBanMenu(id, g_menuPosition)
#include <amxmodx>
#include <amxmisc>
/* Player Menus */
#define MAX_MENU_NUM 24
new g_MenuName[ MAX_MENU_NUM ]
new g_MenuCmd[ MAX_MENU_NUM ]
new PMenuName[] = "Player Menu"
new g_MenuItem[] = {
"More",
"Back",
"Exit"
}
new g_cNum
new g_menuPosition
public plugin_init() {
register_plugin("Player Menu","0.1","nwb13")
register_menucmd(register_menuid( PMenuName ),1023,"actionPlMenu")
register_clcmd("say menu","PlMenu",ADMIN_ALL, "display player menu" )
new configs
get_configsdir(configs, 63)
format(configs, 63, "%s/%s", configs, "plmenu.ini")
loadSettings(configs)
}
loadSettings(plmenuconfig[]) {
if (!file_exists(plmenuconfig))
return 0
new temp
new a, pos = 0
while ( g_cNum < MAX_MENU_NUM && read_file(plmenuconfig,pos++,temp,255,a) ) {
if ( temp == ';' )
continue
if (parse(temp,g_MenuName,31,g_MenuCmd,31) < 2)
continue
++g_cNum
}
return 1
}
public PlMenu(id){
if (is_user_connected(id))
disPlayerMenu(id,g_menuPosition = 0)
return PLUGIN_HANDLED
}
disPlayerMenu(id,pos) {
if (pos < 0)return
new menuBody
new b = 0
new start = pos * 8
if (start >= g_cNum )
start = pos = g_menuPosition = 0
new len = format(menuBody,511,"\y%s\R%d/%d^n\w^n",PMenuName,pos+1,( g_cNum / 8 + ((g_cNum % 8) ? 1 : 0 )) )
new end = start + 8
new keys = MENU_KEY_0
if (end > g_cNum )
end = g_cNum
for (new a = start; a < end; ++a) {
keys |= (1<<b)
len += format(menuBody,511-len,"%d. %s^n",++b,g_MenuName)
}
if (end != g_cNum ) {
format(menuBody,511-len,"^n9. %s...^n0. %s", g_MenuItem, pos ? g_MenuItem : g_MenuItem)
keys |= MENU_KEY_9
}
else format(menuBody,511-len,"^n0. %s",pos ? g_MenuItem : g_MenuItem)
show_menu(id,keys,menuBody,-1,PMenuName)
}
public actionPlMenu(id,key){
switch(key){
case 8:{
disPlayerMenu(id,++g_menuPosition)
}
case 9:{
disPlayerMenu(id,--g_menuPosition)
}
default:{
new menuitem = g_menuPosition * 8 + key
client_cmd(id,"%s",g_MenuCmd)
}
}
return PLUGIN_HANDLED
} 厉害厉害厉害厉害 兼职是大神
佩服了~~~
福彩双色球
幸运飞艇
天津快乐十分
页:
[1]