[原创插件] 34Like 刷新分数
本帖最后由 lucky109 于 2009-1-26 21:59 编辑用途﹕可随时刷新分数而不必重入。
作者﹕五味汤人 (Yin) --=wInNEr~*Like Killer#Yin*|||
版本﹕1.0
首发布﹕ http://forum.34like.com
次发布﹕ http://www.dt-club.net
安装前注意:
本插件需要开启以下两个模块﹕
cstrike_amxx.dll
fun_amxx.dll
开启模块方法﹕
1. 修改 C:\Program Files\Valve\cstrike\addons\amxmodx\configs\modules.ini
2. 开新行加入
cstrike_amxx.dll
fun_amxx.dll
(或者将 ;cstrike_amxx.dll 及 ;fun_amxx.dll 前面的分号直接删掉就可以了)
安装方法﹕
1. 将附件档案(34like_rps.amxx) 放入 "cstrike\addons\amxmodx\plugins" 内。
2. 用记事簿开启 "cstrike\addons\amxmodx\configs\plugins.ini" , 开新行加入34like_rps.amxx,存档即可。
最近在整理插件,这个已经是半年前的作品了‥‥
首次发帖,多多包涵,谢谢
还有就是‥‥我用繁体你们会看得懂吗? 没源码的..看了等如没看.......牛 没源码的..看了等如没看.......牛
点通粉丝 发表于 2009-1-26 09:31 http://www.dt-club.net/forum/images/common/back.gif
抱歉,就算在首發佈的論壇我也沒有發源碼,
階因很早的時候發現很多人修改一部份功能後,連作者的名稱也更改為自己,
版權都不會專重,所以從此我就很少發源碼了。
多多包涵 本帖最后由 xiatian 于 2009-1-26 17:36 编辑
繁体没问题,能看懂,希望楼主以后多发点插件,逛34like太幸苦了,好多白话看不懂,谢谢~~~ 繁体没问题,能看懂,希望楼主以后多发点插件,逛34like太幸苦了,好多白话看不懂,谢谢~~~
xiatian 发表于 2009-1-26 17:35 http://www.dt-club.net/forum/images/common/back.gif
好的~
謝謝你 支持一下 =] 支持一下 =]
seahoi 发表于 2009-1-28 14:30 http://www.dt-club.net/forum/images/common/back.gif
謝謝支持~~~:)
新年快樂~ 难道真的是原创.......... 这样地插件在点通早就有了....
/*
*AMX X Mod script.
*
* (c) Copyright 2006, caihanzi(3826)
*
* Note:
* ^x04 绿色
* ^x03 红色
*/
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#define PLUGIN "replace_player_Score+no_retry"
#define VERSION "1.1+"
#define AUTHOR "caihanzi&Priski"
#define MAX_PLAYERS 32
new pID
new Re_Player_Name
new MSG_1,MSG_2,MSG_3
new choices
new target
new players
new page = { 1, ...}
new bool:counted
new keys,gmsgSayText,num
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say", "replace_say")
register_concmd("amx_remenu", "readminlist",ADMIN_IMMUNITY,"admin re menu")
register_cvar("amx_retrytime","60")
register_cvar("amx_retrykick","1")
register_cvar("amx_retryshow","1")
register_cvar("amx_retrychat","1")
register_cvar("amx_remoney","800")
register_cvar("amx_retrymsg","这里不允许重复登陆, %s")
register_cvar("amx_retrykickmsg","不允许很快地重复连接")
register_cvar("amx_retrychatmsg","%s 被服务器拒绝:因为他在 %t 秒内重复连接")
register_menucmd(register_menuid("您是否想更新自己的得分?^n\r(金钱也将刷新)"),1023,"MenuReplaceBody")
register_menucmd(register_menuid("who?"),(1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9), "choosewho_re")
gmsgSayText = get_user_msgid("SayText")
set_task(30.0,"Replace_Say",888,"",0,"b")
return PLUGIN_CONTINUE
}
public client_putinserver(id) {
if ((is_user_bot(id)) || (get_user_flags(id)&ADMIN_IMMUNITY)) {
return PLUGIN_HANDLED
}
new ip
get_user_ip(id,ip,21)
for(new i = 1; i < MAX_PLAYERS; i++) {
if (equal(ip, pID, 21)) {
new name
get_user_name(id, name, 33)
if (get_cvar_num("amx_retryshow")) {
new uID
uID = id
set_task(2.0,"showMsg", id, uID, 1)
}
if (get_cvar_num("amx_retrychat")) {
new txt
get_cvar_string("amx_retrychatmsg", txt, 127)
new sec
num_to_str(get_cvar_num("amx_retrytime"),sec, 5)
replace(txt, 127, "%s", name)
replace(txt, 127, "%t", sec)
client_print( 0, print_chat, " %s", txt)
}
if (get_cvar_num("amx_retrykick")) {
new uID
uID = get_user_userid(id)
set_task(7.0,"kick",77,uID,1)
}
break
}
}
return PLUGIN_HANDLED;
}
public client_disconnect(id) {
if ((is_user_bot(id)) || (get_user_flags(id)&ADMIN_IMMUNITY)) {
return PLUGIN_HANDLED; }
new ip
get_user_ip(id,ip,21)
new found = 0;
for(new i = 1; i < MAX_PLAYERS; i++) {
if (equal(ip, pID, 21)) {
found = 1
break
}
}
if (found == 0) {
for(new i = 1; i < MAX_PLAYERS; i++) {
if (pID == 0) {
get_user_ip(id, pID, 21)
new aID
aID = i
set_task( get_cvar_float("amx_retrytime"), "cleanID", (id + MAX_PLAYERS),aID,1)
break
}
}
}
return PLUGIN_HANDLED;
}
public Replace_Say()
{
client_print(0,print_chat,"输入 /reme 或 /replace 刷新自己的得分.")
return PLUGIN_CONTINUE
}
public replace_say(id) {//说话检查
new said
read_args(said,192)
if( ( containi(said, "/replace") != -1 || containi(said, "replace") != -1 || containi(said, "/reme") != -1) || contain(said, "reme") != -1 )
set_task(0.1,"MenuReplace",id)
return PLUGIN_CONTINUE
}
public MenuReplace(id,key)
{
new MenuBody
new len
len = format(MenuBody,255,"您是否想更新自己的得分?^n\r(金钱也将刷新)")
len += format(MenuBody,150 - len,"^n\w 1. 是!")
len += format(MenuBody,150 - len,"^n\w 2. 否!")
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 show_replayers(id)
{
for(new i=0;i<9;i++)
{
choices = ""
}
new menu
format(menu,255," 想刷新谁的得分 ?( 第 %d 页 ):^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
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. 返回")
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,menu,60,"who?")
return PLUGIN_CONTINUE
}
public choosewho_re(id,key)
{
if(key == 9 && page == 1)
{
page=1
return 1
}
else if(key == 9 && page > 1)
{
page -=1
show_replayers(id)
return 1
}
if(equal(choices,""))
{
show_replayers(id)
return 1
}
if(key < 8)
{
page=1
target = choices
showmenu(id,target)
return 1
}
if(key == 8 && equal(choices,"Next"))
{
page += 1
show_replayers(id)
return 1
}
return 1
}
public showmenu(id,target)
{
get_players(players,num)
for(new i=0;i<num;i++)
{
counted[ players ]=false
}
new targetname
new tid=str_to_num(target)
get_user_name(tid,targetname,32)
set_user_frags(tid,0)
cs_set_user_deaths(tid,0)
cs_set_user_money(tid,get_cvar_num("amx_remoney"),1)
//client_print(tid,print_chat,"你的得分已被管理员强制刷新.")
format(MSG_3, 111, "^x04你的得分已被管理员强制刷新.")
print_message(tid, MSG_3)
return PLUGIN_CONTINUE
}
public readminlist(id,level,cid)
{
if (!cmd_access(id,level,cid,1))
return PLUGIN_HANDLED;
show_replayers(id)
return PLUGIN_CONTINUE
}
public MenuReplaceBody(id,key)
{
if(key == 0)
{
get_user_name(id,Re_Player_Name,32)
set_task(0.1,"RePlace",id)
}
else if(key == 1)
{
get_user_name(id,Re_Player_Name,32)
//client_print(id,print_chat,"你取消了更新得分,你的得分不会更改.")
format(MSG_1, 111, "^x04你取消了更新得分,你的得分不会更改.")
print_message(id, MSG_1)
}
return PLUGIN_CONTINUE
}
public RePlace(id)
{
set_user_frags(id,0)
cs_set_user_deaths(id,0)
cs_set_user_money(id,get_cvar_num("amx_remoney"),1)
get_user_name(id,Re_Player_Name,32)
//client_print(id,print_chat,"你的得分已刷新.")
format(MSG_2, 111, "^x04你的得分已刷新.")
print_message(id, MSG_2)
client_print(0,print_chat,"玩家 %s 得分已更新.",Re_Player_Name)
return PLUGIN_HANDLED
}
public cleanID(i[]) {
pID] = 0
}
public showMsg(pID[]) {
new txt
get_cvar_string("amx_retrymsg", txt, 127)
new playername
get_user_name(pID, playername, 33)
new sec
num_to_str(get_cvar_num("amx_retrytime"),sec, 5)
replace(txt, 127, "%s", playername)
replace(txt, 127, "%t", sec)
set_hudmessage(255, 255, 255, 0.05, 0.72, 0, 5.0, 10.0, 2.0, 0.15, 3)
show_hudmessage(pID,txt)
}
public kick(id[]) {
new txt
get_cvar_string("amx_retrykickmsg", txt, 127)
server_cmd("kick #%d ^"%s^"", id, txt)
}
print_message(id ,msg[]){
message_begin(MSG_ONE, gmsgSayText,{0,0,0},id)
write_byte(id)
write_string(msg)
message_end()
} 9# landyhsu
不同吧,這個還有管理功能/選單/重覆連接/金錢重置,檔案容量都大4陪了..
你這個可以說是一個綜合性的插件:)