搜索
查看: 3046|回复: 5

请求修改showop.sma 请各位达人帮忙

[复制链接]
发表于 2008-3-7 18:23:57 | 显示全部楼层 |阅读模式 来自 中国–安徽–蚌埠
这个 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提示 都更正为 妖精提示


在此谢过各位大虾

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
发表于 2008-3-7 21:10:03 | 显示全部楼层 来自 中国–广西–百色–右江区

回复: 请求修改showop.sma 请各位达人帮忙

它不能独立显示中文...............
回复

使用道具 举报

 楼主| 发表于 2008-3-7 23:34:48 | 显示全部楼层 来自 中国–安徽–蚌埠

回复: 请求修改showop.sma 请各位达人帮忙

Post by 心静如水
它不能独立显示中文...............

我的服务器环境支持让他显示中文 只是我想把那几个OP和VIP的字符替换掉
回复

使用道具 举报

发表于 2008-3-8 02:00:00 | 显示全部楼层 来自 中国–广东–深圳

回复: 请求修改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[32]
new vip_name[32]
new g_Player[MAXPLAYERS+1]
new g_Pig[MAXPLAYERS+1]
new players[32], num

new cheat[33][33]
new choices[33][9][33]
new page[33] = { 1, ...}
new bool:counted[33]
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[id] = 0
g_Player[id] = 1
//client_print(id,print_chat,"[SWOP] 按Y键输入/op联系在线OP !")
set_task(01.0,"show_op",id,_,_,"a",1)
}
public client_dis(id)
{
g_Player[id] = 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,"[SWOP] 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,"[SWOP] 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,"[SWOP] 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,"[SWOP] 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[151]
new len,keys
len = format(MenuBody,255,"\y您有什么问题询问OP:")
len += format(MenuBody[len],150 - len,"^n\w 1. 报告OP %s 有人作弊",op_name)
len += format(MenuBody[len],150 - len,"^n\w 2. 请求OP %s 换地图",op_name)
  len += format(MenuBody[len],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[32]
  get_user_name(id,Name,31)
  set_task(1.0,"showplayers",id)
  //client_print(0,print_chat,"[SWOP] %s 举报有人作弊",Name)
}
else if(key == 1)
{
  new Name[32]
  get_user_name(id,Name,31)
  client_print(0,print_chat,"[SWOP] %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[id] = ""
    }
    new menu[256]
    format(menu,255," 举报谁在作弊 ?  ( 第 %d 页 ):^n \r请不要恶意举报!  ^n^n",page[id])
    get_players(players,num)
    new onepageplayer = num-((page[id]-1)*8)
    if(num-((page[id]-1)*8) > 8)
     onepageplayer = 8
   
    new offset = (page[id] * 8) - 8
   
    for(new i=offset;i<onepageplayer+offset;i++)
    {
     new username[33]
get_user_name(players,username,32)
       new string[256]
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[33]
  num_to_str(players,id_str,32)
  choices[id][i-offset] = id_str
}
add(menu,255,string)
    }
    if(num-((page[id]-1)*8) > 8)
    {
       choices[id][8] = "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[id] == 1)
    {
       page[id]=1
       return 1
    }
    else if(key == 9 && page[id] > 1)
    {
      page[id] -=1
      showplayers(id)
      return 1
    }
    if(equal(choices[id][key],""))
    {
      showplayers(id)
      return 1
    }
    if(key < 8)
    {
      page[id]=1
      cheat[id] = choices[id][key]
      showmenu(id,cheat[id])
      return 1
    }
    if(key == 8 && equal(choices[id][key],"Next"))
    {
      page[id] += 1
      showplayers(id)
      return 1
    }  
    return 1
}
public showmenu(id,cheat[33])
{
   
    get_players(players,num)
    for(new i=0;i<num;i++)
    {
     counted[ players ]=false
    }
  
    new choosename[32],cheatname[32]
    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,"[SWOP] %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[256]
    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[32]
  get_user_name(id,Name,31)
    switch (id,key)
    {
  case 0: client_print(0,print_chat,"[SWOP] %s 请求换地图为de_dust2",Name)
  case 1: client_print(0,print_chat,"[SWOP] %s 请求换地图为de_dust",Name)
  case 2: client_print(0,print_chat,"[SWOP] %s 请求换地图为de_aztec",Name)
  case 3: client_print(0,print_chat,"[SWOP] %s 请求换地图为de_inferno",Name)
  case 4: client_print(0,print_chat,"[SWOP] %s 请求换地图为de_train",Name)
  case 5: client_print(0,print_chat,"[SWOP] %s 请求换地图为de_nuke",Name)
  }
  return PLUGIN_CONTINUE
}  

简单改了下
编译通过
未测试
回复

使用道具 举报

发表于 2008-3-8 02:03:39 | 显示全部楼层 来自 中国–广东–深圳

回复: 请求修改showop.sma 请各位达人帮忙

[PHP]/*
*  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[32]
new vip_name[32]
new g_Player[MAXPLAYERS+1]
new g_Pig[MAXPLAYERS+1]
new players[32], num

new cheat[33][33]
new choices[33][9][33]
new page[33] = { 1, ...}
new bool:counted[33]
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[id] = 0
g_Player[id] = 1
//client_print(id,print_chat,"[妖精提示]  按Y键输入/op联系在线OP !")
set_task(01.0,"show_op",id,_,_,"a",1)
}
public client_dis(id)
{
g_Player[id] = 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[151]
new len,keys
len = format(MenuBody,255,"\y您有什么问题询问OP:")
len += format(MenuBody[len],150 - len,"^n\w 1. 报告OP %s 有人作弊",op_name)
len += format(MenuBody[len],150 - len,"^n\w 2. 请求OP %s 换地图",op_name)
  len += format(MenuBody[len],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[32]
  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[32]
  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[id] = ""
    }
    new menu[256]
    format(menu,255," 举报谁在作弊 ?  ( 第 %d 页 ):^n \r请不要恶意举报!  ^n^n",page[id])
    get_players(players,num)
    new onepageplayer = num-((page[id]-1)*8)
    if(num-((page[id]-1)*8) > 8)
     onepageplayer = 8
   
    new offset = (page[id] * 8) - 8
   
    for(new i=offset;i<onepageplayer+offset;i++)
    {
     new username[33]
get_user_name(players,username,32)
       new string[256]
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[33]
  num_to_str(players,id_str,32)
  choices[id][i-offset] = id_str
}
add(menu,255,string)
    }
    if(num-((page[id]-1)*8) > 8)
    {
       choices[id][8] = "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[id] == 1)
    {
       page[id]=1
       return 1
    }
    else if(key == 9 && page[id] > 1)
    {
      page[id] -=1
      showplayers(id)
      return 1
    }
    if(equal(choices[id][key],""))
    {
      showplayers(id)
      return 1
    }
    if(key < 8)
    {
      page[id]=1
      cheat[id] = choices[id][key]
      showmenu(id,cheat[id])
      return 1
    }
    if(key == 8 && equal(choices[id][key],"Next"))
    {
      page[id] += 1
      showplayers(id)
      return 1
    }  
    return 1
}
public showmenu(id,cheat[33])
{
   
    get_players(players,num)
    for(new i=0;i<num;i++)
    {
     counted[ players ]=false
    }
  
    new choosename[32],cheatname[32]
    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[256]
    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[32]
  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
}  [/PHP]

简单的改了下
未测试
编译通过
回复

使用道具 举报

 楼主| 发表于 2008-3-8 16:52:42 | 显示全部楼层 来自 中国–安徽–蚌埠

回复: 请求修改showop.sma 请各位达人帮忙

Post by baili1258
[php]/*
* 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 自带的批处理
回复

使用道具 举报

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

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