请求修改showop.sma 请各位达人帮忙
这个 sma我已经修改了由于是用记事本修改的 所以编译的时候出错了那个Amxx-Studio我用不好
希望高手们帮帮我
这个插件我想修改成
1 , OP/VIP 显示为管理员/会员 (里边很多的OP和VIP字符都被我替换了)
2 , OP和VIP 进服的时候提示管理员/会员 登陆啦仅在进服的时候提示一次不再提示
3 , /OP命令里 地图改为 dod_anzio dod_donner dod_harrington dod_saint dod_chemille dod_ railroad2_b2
4 , 把所有XX提示 都更正为 妖精提示
在此谢过各位大虾
回复: 请求修改showop.sma 请各位达人帮忙
它不能独立显示中文...............回复: 请求修改showop.sma 请各位达人帮忙
Post by 心静如水它不能独立显示中文...............
我的服务器环境支持让他显示中文 只是我想把那几个OP和VIP的字符替换掉
回复: 请求修改showop.sma 请各位达人帮忙
/**AMX X Mod script.
*
* (c) Copyright 2004, caihanzi(3826)
*
* History:
* v0.1显示及提示OP登陆,在线
* v0.2添加玩家举报菜单(模仿Enigmaya的cheating_punish.sma制作)
* v0.3增加固定请求OP换地图菜单,增加VIP登陆和再线提示
* v0.4加入内网免疫,与更多设置命令
*/
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define MAXPLAYERS 32
#define MENU_PLAYERS 8
#define MENUTIME 15
#define KEY1 (1<<0)
#define KEY2 (1<<1)
#define KEY3 (1<<2)
#define KEY4 (1<<3)
#define KEY5 (1<<4)
#define KEY6 (1<<5)
#define KEY7 (1<<6)
#define KEY8 (1<<7)
#define KEY9 (1<<8)
#define KEY0 (1<<9)
new op_name
new vip_name
new g_Player
new g_Pig
new players, num
new cheat
new choices
new page = { 1, ...}
new bool:counted
public plugin_init()
{
register_plugin("show OP","0.3", "caihanzi")
register_clcmd("say /op", "showopmenu")
register_menucmd(register_menuid("\y您有什么问题询问OP:"),1023,"MenuShowOp")
register_menucmd(register_menuid("who?"), KEY1|KEY2|KEY3|KEY4|KEY5|KEY6|KEY7|KEY8|KEY9|KEY0, "choosewho")
register_menucmd(register_menuid("想请OP换哪一幅地图?"), KEY1|KEY2|KEY3|KEY4|KEY5|KEY6|KEY7|KEY8|KEY9|KEY0, "whichmap")
}
public client_putinserver(id)
{
if(is_user_connected(id) && !is_user_bot(id) && !is_user_hltv(id))
set_task(10.0,"Check_op",id,_,_,"a",1)
}
public Check_op(id)
{
g_Pig = 0
g_Player = 1
//client_print(id,print_chat," 按Y键输入/op联系在线OP !")
set_task(01.0,"show_op",id,_,_,"a",1)
}
public client_dis(id)
{
g_Player = 0
remove_task(id)
}
public show_op(id)
{
if ((get_user_flags(id) & ADMIN_IMMUNITY)) {
get_user_info(id,"name",op_name,31)
client_print(0,print_chat," OP %s 登陆啦... ",op_name)
set_hudmessage ( 30, 144, 255, 0.2, 0.90, 2, 0.02, 6.0, 0.01, 0.2, 2 )
show_hudmessage (0," OP %s 登陆啦... ",op_name)
}
else if((get_user_flags(id) & ADMIN_RESERVATION) && !(get_user_flags(id) & ADMIN_IMMUNITY)){//VIP提示
get_user_info(id,"name",vip_name,31)
client_print(0,print_chat," VIP %s 登陆啦... ",vip_name)
set_hudmessage ( 255, 0, 0, 0.2, 0.90, 2, 0.02, 6.0, 0.01, 0.2, 2 )
show_hudmessage ( 0, " VIP %s 登陆啦... ",vip_name)
}
set_task(7.0,"on_op",id,_,_,"b",1)
return PLUGIN_HANDLED
}
public on_op(id)
{
if ((get_user_flags(id) & ADMIN_IMMUNITY)) {
get_user_info(id,"name",op_name,31)
//client_print(0,print_chat," OP %s 在线.有什么问题请询问OP ",op_name)
set_hudmessage ( 30, 144, 255, 0.05, 0.90, 2, 0.02, 8.0, 0.01, 0.2, 3 )
show_hudmessage (0, " OP %s 在线.有什么问题请询问OP ",op_name)
}
else if((get_user_flags(id) & ADMIN_RESERVATION) && !(get_user_flags(id) & ADMIN_IMMUNITY)){//VIP提示
get_user_info(id,"name",vip_name,31)
//client_print(0,print_chat," VIP %s 在线 ",vip_name)
set_hudmessage ( 255, 0, 0, 0.05, 0.90, 2, 0.02, 8.0, 0.01, 0.2, 3 )
show_hudmessage (0, " VIP %s 在线 ",vip_name)
}
return PLUGIN_CONTINUE
}
public showopmenu(id,key)
{
new MenuBody
new len,keys
len = format(MenuBody,255,"\y您有什么问题询问OP:")
len += format(MenuBody,150 - len,"^n\w 1. 报告OP %s 有人作弊",op_name)
len += format(MenuBody,150 - len,"^n\w 2. 请求OP %s 换地图",op_name)
len += format(MenuBody,150 - len,"^n\w 0. 退出")
keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9)
show_menu( id, keys, MenuBody, -1 )
return PLUGIN_CONTINUE
}
public MenuShowOp(id,key)
{
if(key == 0)
{
new Name
get_user_name(id,Name,31)
set_task(1.0,"showplayers",id)
//client_print(0,print_chat," %s 举报有人作弊",Name)
}
else if(key == 1)
{
new Name
get_user_name(id,Name,31)
client_print(0,print_chat," %s 请求换地图",Name)
set_task(1.0,"showMapMenu",id)
}
else if(key == 9)
return PLUGIN_CONTINUE
}
public showplayers(id)
{
for(new i=0;i<9;i++)
{
choices = ""
}
new menu
format(menu,255," 举报谁在作弊 ?( 第 %d 页 ):^n \r请不要恶意举报!^n^n",page)
get_players(players,num)
new onepageplayer = num-((page-1)*8)
if(num-((page-1)*8) > 8)
onepageplayer = 8
new offset = (page * 8) - 8
for(new i=offset;i<onepageplayer+offset;i++)
{
new username
get_user_name(players,username,32)
new string
if((get_user_flags(players) & ADMIN_IMMUNITY ))
{
format(string,255,"\d%d. %s (管理员) ^n",i+1-offset,username)
}
else if((get_user_flags(players) & ADMIN_RESERVATION) && !(get_user_flags(players) & ADMIN_IMMUNITY))
{
format(string,255,"\d%d. %s (VIP) ^n",i+1-offset,username)
}
else
{
format(string,255,"\w%d. %s ^n",i+1-offset,username)
new id_str
num_to_str(players,id_str,32)
choices = id_str
}
add(menu,255,string)
}
if(num-((page-1)*8) > 8)
{
choices = "Next"
add(menu,255,"\w^n9. 下一页")
}
add(menu,255,"\w^n0. 返回")
show_menu(id,KEY1|KEY2|KEY3|KEY4|KEY5|KEY6|KEY7|KEY8|KEY9|KEY0,menu,MENUTIME,"who?")
return PLUGIN_CONTINUE
}
public choosewho(id,key)
{
if(key == 9 && page == 1)
{
page=1
return 1
}
else if(key == 9 && page > 1)
{
page -=1
showplayers(id)
return 1
}
if(equal(choices,""))
{
showplayers(id)
return 1
}
if(key < 8)
{
page=1
cheat = choices
showmenu(id,cheat)
return 1
}
if(key == 8 && equal(choices,"Next"))
{
page += 1
showplayers(id)
return 1
}
return 1
}
public showmenu(id,cheat)
{
get_players(players,num)
for(new i=0;i<num;i++)
{
counted[ players ]=false
}
new choosename,cheatname
get_user_name(id,choosename,32)
new tid=str_to_num(cheat)
get_user_name(tid,cheatname,32)
if ((get_user_flags(id) & ADMIN_IMMUNITY) || (get_user_flags(id) & ADMIN_KICK)) {
client_print(id,print_chat," %s 报告 %s 作弊",choosename,cheatname)
//set_hudmessage ( 255, 0, 0, 0.2, 0.2, 2, 0.4, 14.0, 0.2, 0.2, 5)
//show_hudmessage (id, "%s 报告 %s 作弊",choosename,cheatname)
}
return PLUGIN_HANDLED
}
public showMapMenu(id,key)
{
new mapmenu
format(mapmenu, 255, "想请OP换哪一幅地图?^n^n1. de_dust2^n2. de_dust^n3. de_aztec^n4. de_inferno^n5. de_train^n6. de_nuke")
show_menu(id, KEY1|KEY2|KEY3|KEY4|KEY5|KEY6|KEY7|KEY8|KEY9|KEY0, mapmenu,MENUTIME,"想请OP换哪一幅地图?")
return PLUGIN_HANDLED
}
public whichmap(id,key)
{
new Name
get_user_name(id,Name,31)
switch (id,key)
{
case 0: client_print(0,print_chat," %s 请求换地图为de_dust2",Name)
case 1: client_print(0,print_chat," %s 请求换地图为de_dust",Name)
case 2: client_print(0,print_chat," %s 请求换地图为de_aztec",Name)
case 3: client_print(0,print_chat," %s 请求换地图为de_inferno",Name)
case 4: client_print(0,print_chat," %s 请求换地图为de_train",Name)
case 5: client_print(0,print_chat," %s 请求换地图为de_nuke",Name)
}
return PLUGIN_CONTINUE
}
简单改了下
编译通过
未测试
回复: 请求修改showop.sma 请各位达人帮忙
/**AMX X Mod script.
*
* (c) Copyright 2004, caihanzi(3826)
*
* History:
* v0.1显示及提示OP登陆,在线
* v0.2添加玩家举报菜单(模仿Enigmaya的cheating_punish.sma制作)
* v0.3增加固定请求OP换地图菜单,增加VIP登陆和再线提示
* v0.4加入内网免疫,与更多设置命令
*/
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define MAXPLAYERS 32
#define MENU_PLAYERS 8
#define MENUTIME 15
#define KEY1 (1<<0)
#define KEY2 (1<<1)
#define KEY3 (1<<2)
#define KEY4 (1<<3)
#define KEY5 (1<<4)
#define KEY6 (1<<5)
#define KEY7 (1<<6)
#define KEY8 (1<<7)
#define KEY9 (1<<8)
#define KEY0 (1<<9)
new op_name
new vip_name
new g_Player
new g_Pig
new players, num
new cheat
new choices
new page = { 1, ...}
new bool:counted
public plugin_init()
{
register_plugin("show OP","0.3", "caihanzi")
register_clcmd("say /op", "showopmenu")
register_menucmd(register_menuid("\y您有什么问题询问OP:"),1023,"MenuShowOp")
register_menucmd(register_menuid("who?"), KEY1|KEY2|KEY3|KEY4|KEY5|KEY6|KEY7|KEY8|KEY9|KEY0, "choosewho")
register_menucmd(register_menuid("想请OP换哪一幅地图?"), KEY1|KEY2|KEY3|KEY4|KEY5|KEY6|KEY7|KEY8|KEY9|KEY0, "whichmap")
}
public client_putinserver(id)
{
if(is_user_connected(id) && !is_user_bot(id) && !is_user_hltv(id))
set_task(10.0,"Check_op",id,_,_,"a",1)
}
public Check_op(id)
{
g_Pig = 0
g_Player = 1
//client_print(id,print_chat,"[妖精提示]按Y键输入/op联系在线OP !")
set_task(01.0,"show_op",id,_,_,"a",1)
}
public client_dis(id)
{
g_Player = 0
remove_task(id)
}
public show_op(id)
{
if ((get_user_flags(id) & ADMIN_IMMUNITY)) {
get_user_info(id,"name",op_name,31)
client_print(0,print_chat,"[妖精提示]管理员 %s 登陆啦... ",op_name)
set_hudmessage ( 30, 144, 255, 0.2, 0.90, 2, 0.02, 6.0, 0.01, 0.2, 2 )
show_hudmessage (0," 管理员 %s 登陆啦... ",op_name)
}
else if((get_user_flags(id) & ADMIN_RESERVATION) && !(get_user_flags(id) & ADMIN_IMMUNITY)){//VIP提示
get_user_info(id,"name",vip_name,31)
client_print(0,print_chat,"[妖精提示]会员 %s 登陆啦... ",vip_name)
set_hudmessage ( 255, 0, 0, 0.2, 0.90, 2, 0.02, 6.0, 0.01, 0.2, 2 )
show_hudmessage ( 0, " 会员 %s 登陆啦... ",vip_name)
}
set_task(7.0,"on_op",id,_,_,"b",1)
return PLUGIN_HANDLED
}
public on_op(id)
{
if ((get_user_flags(id) & ADMIN_IMMUNITY)) {
get_user_info(id,"name",op_name,31)
//client_print(0,print_chat,"[妖精提示]OP %s 在线.有什么问题请询问OP ",op_name)
set_hudmessage ( 30, 144, 255, 0.05, 0.90, 2, 0.02, 8.0, 0.01, 0.2, 3 )
show_hudmessage (0, " 【管理员】 %s 在线.有什么问题请询问OP ",op_name)
}
else if((get_user_flags(id) & ADMIN_RESERVATION) && !(get_user_flags(id) & ADMIN_IMMUNITY)){//VIP提示
get_user_info(id,"name",vip_name,31)
//client_print(0,print_chat,"[妖精提示]VIP %s 在线 ",vip_name)
set_hudmessage ( 255, 0, 0, 0.05, 0.90, 2, 0.02, 8.0, 0.01, 0.2, 3 )
show_hudmessage (0, " VIP %s 在线 ",vip_name)
}
return PLUGIN_CONTINUE
}
public showopmenu(id,key)
{
new MenuBody
new len,keys
len = format(MenuBody,255,"\y您有什么问题询问OP:")
len += format(MenuBody,150 - len,"^n\w 1. 报告OP %s 有人作弊",op_name)
len += format(MenuBody,150 - len,"^n\w 2. 请求OP %s 换地图",op_name)
len += format(MenuBody,150 - len,"^n\w 0. 退出")
keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9)
show_menu( id, keys, MenuBody, -1 )
return PLUGIN_CONTINUE
}
public MenuShowOp(id,key)
{
if(key == 0)
{
new Name
get_user_name(id,Name,31)
set_task(1.0,"showplayers",id)
//client_print(0,print_chat,"[妖精提示]%s 举报有人作弊",Name)
}
else if(key == 1)
{
new Name
get_user_name(id,Name,31)
client_print(0,print_chat,"[妖精提示]%s 请求换地图",Name)
set_task(1.0,"showMapMenu",id)
}
else if(key == 9)
return PLUGIN_CONTINUE
}
public showplayers(id)
{
for(new i=0;i<9;i++)
{
choices = ""
}
new menu
format(menu,255," 举报谁在作弊 ?( 第 %d 页 ):^n \r请不要恶意举报!^n^n",page)
get_players(players,num)
new onepageplayer = num-((page-1)*8)
if(num-((page-1)*8) > 8)
onepageplayer = 8
new offset = (page * 8) - 8
for(new i=offset;i<onepageplayer+offset;i++)
{
new username
get_user_name(players,username,32)
new string
if((get_user_flags(players) & ADMIN_IMMUNITY ))
{
format(string,255,"\d%d. %s (管理员) ^n",i+1-offset,username)
}
else if((get_user_flags(players) & ADMIN_RESERVATION) && !(get_user_flags(players) & ADMIN_IMMUNITY))
{
format(string,255,"\d%d. %s (会员) ^n",i+1-offset,username)
}
else
{
format(string,255,"\w%d. %s ^n",i+1-offset,username)
new id_str
num_to_str(players,id_str,32)
choices = id_str
}
add(menu,255,string)
}
if(num-((page-1)*8) > 8)
{
choices = "Next"
add(menu,255,"\w^n9. 下一页")
}
add(menu,255,"\w^n0. 返回")
show_menu(id,KEY1|KEY2|KEY3|KEY4|KEY5|KEY6|KEY7|KEY8|KEY9|KEY0,menu,MENUTIME,"who?")
return PLUGIN_CONTINUE
}
public choosewho(id,key)
{
if(key == 9 && page == 1)
{
page=1
return 1
}
else if(key == 9 && page > 1)
{
page -=1
showplayers(id)
return 1
}
if(equal(choices,""))
{
showplayers(id)
return 1
}
if(key < 8)
{
page=1
cheat = choices
showmenu(id,cheat)
return 1
}
if(key == 8 && equal(choices,"Next"))
{
page += 1
showplayers(id)
return 1
}
return 1
}
public showmenu(id,cheat)
{
get_players(players,num)
for(new i=0;i<num;i++)
{
counted[ players ]=false
}
new choosename,cheatname
get_user_name(id,choosename,32)
new tid=str_to_num(cheat)
get_user_name(tid,cheatname,32)
if ((get_user_flags(id) & ADMIN_IMMUNITY) || (get_user_flags(id) & ADMIN_KICK)) {
client_print(id,print_chat,"[妖精提示]%s 报告 %s 作弊",choosename,cheatname)
//set_hudmessage ( 255, 0, 0, 0.2, 0.2, 2, 0.4, 14.0, 0.2, 0.2, 5)
//show_hudmessage (id, "%s 报告 %s 作弊",choosename,cheatname)
}
return PLUGIN_HANDLED
}
public showMapMenu(id,key)
{
new mapmenu
format(mapmenu, 255, "想请OP换哪一幅地图?^n^n1. dod_anzio^n2. dod_donner^n3. dod_harrington ^n4. dod_saint^n5. dod_chemille^n6. dod_railroad2_b2")
show_menu(id, KEY1|KEY2|KEY3|KEY4|KEY5|KEY6|KEY7|KEY8|KEY9|KEY0, mapmenu,MENUTIME,"想请OP换哪一幅地图?")
return PLUGIN_HANDLED
}
public whichmap(id,key)
{
new Name
get_user_name(id,Name,31)
switch (id,key)
{
case 0: client_print(0,print_chat,"[妖精提示]%s 请求换地图为dod_anzio",Name)
case 1: client_print(0,print_chat,"[妖精提示]%s 请求换地图为dod_donner",Name)
case 2: client_print(0,print_chat,"[妖精提示]%s 请求换地图为dod_harrington",Name)
case 3: client_print(0,print_chat,"[妖精提示]%s 请求换地图为dod_saint",Name)
case 4: client_print(0,print_chat,"[妖精提示]%s 请求换地图为dod_chemille",Name)
case 5: client_print(0,print_chat,"[妖精提示]%s 请求换地图为dod_railroad2_b2",Name)
}
return PLUGIN_CONTINUE
}
简单的改了下
未测试
编译通过
回复: 请求修改showop.sma 请各位达人帮忙
Post by baili1258/*
* AMX X Mod script.
*
* (c) Copyright 2004, caihanzi(3826)
*
* History:
* v0.1 显示及提示OP登陆,在线
* v0.2 添加玩家举报菜单(模仿Enigmaya的cheating_punish.sma制作)
* v0.3 增加固定请求OP换地图菜单,增加VIP登陆和再线提示
* v0.4 加入内网免疫,与更多设置命令
*/
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define ...
请问你用什么软件编译成功的 我编译就出错 我用的是AMXX 1.76c 自带的批处理
页:
[1]