搜索
查看: 5884|回复: 18

1.蹲坑放风筝插件.2.前100名才得买2颗闪光,前500名只能买1颗

[复制链接]
发表于 2008-10-30 14:35:25 | 显示全部楼层 |阅读模式 来自 中国–广西–百色–田东县
简单修改:

1.(第一个34是蹲坑插件)只保证不发生冲突和服务器不卡......CS1.6....加载就行了....

2.(第二个999是蹲坑放风筝插件)...........1.76C

3.SHANDAN.AMXX是F9键买闪光弹限制,防菜鸟乱扔闪光.......需要关闭购买闪光弹

amxx.cfg文件可调时间:

// 设置设置变成风筝的启动时间 | 默认: 30秒
anticamping_camptime 30

请不要在此说原码的事,容易修改和容易找到的原码请自己搜索自己动手一下吧...........


zui hou geng xin 2008.11.5

本帖子中包含更多资源

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

×
发表于 2008-10-30 14:50:04 | 显示全部楼层 来自 中国–湖北–黄冈

回复: 新修改的反蹲坑插件,也许有人想要...

晕~哦~LZ最起码也要介绍一下~你这个和以前的有什么区别呀!~~~~~~~~
回复

使用道具 举报

发表于 2008-10-31 02:05:40 | 显示全部楼层 来自 中国–四川–成都

回复: 新修改的反蹲坑插件,也许有人想要...

楼主可否修改个"蹲坑变鸡"的插件呢?
回复

使用道具 举报

发表于 2008-11-1 05:32:11 | 显示全部楼层 来自 中国–四川–遂宁

回复: 蹲坑放风筝插件(自己修改)

发现楼主发插件...都不发源码的 = =
回复

使用道具 举报

发表于 2008-11-1 16:42:59 | 显示全部楼层 来自 中国–浙江–温州

回复: 蹲坑放风筝插件(自己修改)

随便啦,喜欢用就用,不喜欢就不用,反正我是不会用。
回复

使用道具 举报

发表于 2008-11-2 10:22:30 | 显示全部楼层 来自 中国–广东–广州–白云区

回复: 蹲坑放风筝插件(自己修改)

美女楼主你这样可不行的啊..每次改了插件..又不发下源码..次数多啦..后果会很什么的哦
到了以后你要求人帮你改什么的时侯..我看就没人愿帮你啦.你可当我多口说说..忠告
回复

使用道具 举报

发表于 2008-11-2 10:23:13 | 显示全部楼层 来自 中国–广东–广州–白云区

回复: 蹲坑放风筝插件(自己修改)

美女楼主你这样可不行的啊..每次改了插件..又不发下源码..次数多啦..后果会很什么的哦
到了以后你要求人帮你改什么的时侯..我看就没人愿帮你啦.你可当我多口说说..忠告
回复

使用道具 举报

发表于 2008-11-2 10:36:01 | 显示全部楼层 来自 中国–广东–佛山–顺德区

回复: 蹲坑放风筝插件(自己修改)

LZ  不需要spr  1.80可以的话我去试下。。。
回复

使用道具 举报

 楼主| 发表于 2008-11-2 10:57:25 | 显示全部楼层 来自 中国–广西–百色

回复: 蹲坑放风筝插件(自己修改)

一般来说,俺修改那些会群踢的插件是发原码的,因为那才觉得是贡献..

这是娱乐插件.本已满足放服务器的要求.但关系到CoVeTer战队的利益,本不想发原码的.
自己加入人颜色和用CoVerT战队的SPR牌效果更好.

#include <amxmodx>
#include <fun>

#define SND_STOP (1<<5)
#define TASK_CAMP 6666667
#define DETECT_RANGE 30.0 // 检测范围
#define ROW_NUM 5 // 进度条的数量

new playercoord0[33][3]
new playercoord1[33][3]
new playercoord2[33][3]
new playercoord3[33][3]
new playercoord4[33][3]
new campmeter[33]
new bool:pausecounter[33]
new bool:bombplanted
new bool:de_map
new camptolerancedefending = 180
new camptoleranceattacking = 200
new bool:g_pl_lim[33] // 玩家蹲坑到100%的状态
new camper_sprite
new cvarflags[8] // 惩罚方式
new bool:isSlaped[33] // 正在被煽耳光

public plugin_init() {
register_plugin("AntiCamping","1.0","MM")
register_event("Damage", "damage_event", "b", "2!0")
register_event("BarTime","bartime_event","b")
register_event("ResetHUD", "new_round", "b")
register_event("SendAudio", "bomb_planted", "a", "2&%!MRAD_BOMBPL")
register_event("SendAudio", "round_end", "a", "2&%!MRAD_terwin","2&%!MRAD_ctwin","2&%!MRAD_rounddraw")
register_event("StatusIcon", "got_bomb", "be", "1=1", "1=2", "2=c4")
register_cvar("anticamping","1") // 蹲坑检测 0=关闭, 1=开启
register_cvar("anticamping_camptime","30") // 允许蹲坑的时间上限
register_cvar("anticamping_punish_mode","a")
register_cvar("anticamping_meter","1") // 向客户端显示检测的信息, 0=关闭, 1=开启
register_cvar("anticamping_de_map_allow","1") //de_地图上是否允许防守方蹲坑

set_task(1.0,"checkcamping",1)
return PLUGIN_CONTINUE
}

public sqrt(num) {
new div = num;
new result = 1;
while (div > result) { // end when div == result, or just below
div = (div + result) / 2 // take mean value as new divisor
result = num / div
}
return div;
}

public unpausecounter(parm[]) {
new id = parm[0]
pausecounter[id] = false
return PLUGIN_CONTINUE
}

public displaymeter(id) {
if (get_cvar_num("anticamping_meter") != 0) {
new buffer[128],temp,pos
if ((get_user_team(id) == 1) && bombplanted && de_map && get_cvar_num("anticamping_de_map_allow"))
return PLUGIN_HANDLED
else if ((get_user_team(id) == 2) && (!bombplanted) && de_map && get_cvar_num("anticamping_de_map_allow"))
return PLUGIN_HANDLED
else {
temp = campmeter[id]/ROW_NUM
for (new x=0; x<temp; x++)
pos += format(buffer[pos],127-pos,"|")
for (new y=0; y<(100/ROW_NUM-temp); y++)
pos += format(buffer[pos],127-pos,"_")
pos += format(buffer[pos],127-pos,"^n蹲 坑 你 就 变 风 筝: %i%%",campmeter[id])
}
if (campmeter[id] > 99) {
set_hudmessage(255, 0, 0, -1.0, 0.85, 0, 1.0, 2.0, 0.1, 0.1, 4)
} else if (campmeter[id] > 50 ) {
set_hudmessage(255, 255, 0, -1.0, 0.85, 0, 1.0, 2.0, 0.1, 0.1, 4)
} else {
set_hudmessage(0, 255, 0, -1.0, 0.85, 0, 1.0, 2.0, 0.1, 0.1, 4)
}
show_hudmessage(id,buffer)
}
return PLUGIN_HANDLED
}

public checkcamping(){
if (!get_cvar_num("anticamping")){
set_task(1.0,"checkcamping",1)
return PLUGIN_CONTINUE
}
new players[32],variance[3],average[3]
new numberofplayers, variancetotal, standarddeviation, id, i, j, team

get_cvar_string("anticamping_punish_mode", cvarflags, 8)
get_players(players, numberofplayers, "a")
for (i = 0; i < numberofplayers; ++i) {
while (i < numberofplayers && pausecounter[players]) {
++i
}
if (i >= numberofplayers){
set_task(1.0,"checkcamping",1)
return PLUGIN_CONTINUE
}
id = players
for (j = 0; j < 3; ++j) {
playercoord4[id][j] = playercoord3[id][j]
playercoord3[id][j] = playercoord2[id][j]
playercoord2[id][j] = playercoord1[id][j]
playercoord1[id][j] = playercoord0[id][j]
}
get_user_origin(id, playercoord0[id], 0)
for (j = 0; j < 3; ++j) {
average[j] = (playercoord0[id][j] +
playercoord1[id][j] +
playercoord2[id][j] +
playercoord3[id][j] +
playercoord4[id][j]) / 5
variance[j] = (((playercoord0[id][j] - average[j]) * (playercoord0[id][j] - average[j]) +
(playercoord1[id][j] - average[j]) * (playercoord1[id][j] - average[j]) +
(playercoord2[id][j] - average[j]) * (playercoord2[id][j] - average[j]) +
(playercoord3[id][j] - average[j]) * (playercoord3[id][j] - average[j]) +
(playercoord4[id][j] - average[j]) * (playercoord4[id][j] - average[j])) / 4)
}
variancetotal=variance[0]+variance[1]+variance[2]
standarddeviation=sqrt(variancetotal)
team = get_user_team(id)
if (!de_map){
if (team == 2) // Team 1 = Terro, Team 2 = CT
campmeter[id] += (camptoleranceattacking - standarddeviation) / get_cvar_num("anticamping_camptime")
else
campmeter[id] += (camptoleranceattacking - standarddeviation) / get_cvar_num("anticamping_camptime")
}
else if (bombplanted){
if (team == 1) // Team 1 = Terro, Team 2 = CT
if (get_cvar_num("anticamping_de_map_allow"))
campmeter[id] = 0
else
campmeter[id] += (camptolerancedefending - standarddeviation) / get_cvar_num("anticamping_camptime")
else
campmeter[id] += (camptoleranceattacking - standarddeviation) / get_cvar_num("anticamping_camptime")
}
else{
if (team == 2) // Team 1 = Terro, Team 2 = CT
if (get_cvar_num("anticamping_de_map_allow"))
campmeter[id] = 0
else
campmeter[id] += (camptolerancedefending - standarddeviation) / get_cvar_num("anticamping_camptime")
else
campmeter[id] += (camptoleranceattacking - standarddeviation) / get_cvar_num("anticamping_camptime")
}
if ((campmeter[id] < 80 ) && is_user_connected(id)) {
if (g_pl_lim[id] == true){
g_pl_lim[id] = false
}
}
if ((campmeter[id] < 0) && is_user_connected(id)){
campmeter[id] = 0
} else if ((campmeter[id]>100) && is_user_connected(id)) {
if ( contain(cvarflags,"a") != -1 ) {
new ids[2]
ids[0]=id
set_task(0.1, "slap_player", 0, ids, 1, "a", 100)
}
if (g_pl_lim[id] == false){
g_pl_lim[id] = true
}
campmeter[id]=100
}
if (is_user_connected(id) && get_cvar_num("anticamping"))
displaymeter(id)
}
set_task(1.5,"checkcamping",1)
return PLUGIN_CONTINUE
}

public slap_player(ids[]) {
new id = ids[0]
if (get_user_health(id) > 1){
user_slap(id,1)

message_begin(MSG_ALL,SVC_TEMPENTITY)
write_byte(124)
write_byte(id)
write_coord(65)
write_short(camper_sprite)
write_short(32767)
message_end()
}

else if (get_user_health(id) == 1){
user_slap(id,0)

message_begin(MSG_ALL,SVC_TEMPENTITY)
write_byte(125)
write_byte(id)
message_end()
}

else if( get_user_health(id) <= 0 ){
message_begin(MSG_ALL,SVC_TEMPENTITY)
write_byte(125)
write_byte(id)
message_end()

}

return PLUGIN_CONTINUE
}

public damage_event(id) {
if (get_cvar_num("anticamping")) {
new enemy = get_user_attacker(id)
if (get_user_team(id)!=get_user_team(enemy)) {
campmeter[id]=0
campmeter[enemy]=0
}
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}

public new_round(id) {
if (get_cvar_num("anticamping")) {
bombplanted=false
pausecounter[id]=true
campmeter[id]=0
new Float:freezetime = get_cvar_float("mp_freezetime") + 3.0
new parm[1]
parm[0]=id
set_task(freezetime,"unpausecounter",0,parm,1)
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}

public bartime_event(id) {
if (get_cvar_num("anticamping")) {
pausecounter[id]=true
campmeter[id]=0
new Float:bar_time=float(read_data(1)+1)
new parm[1]
parm[0]=id
set_task(bar_time,"unpausecounter",0,parm,1)
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}

public bomb_planted() {
if (get_cvar_num("anticamping")) {
bombplanted=true
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}

public got_bomb(id) {
if (get_cvar_num("anticamping")) {
de_map=true
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}

public round_end() {
if (get_cvar_num("anticamping")) {
new players[32]
new numberofplayers
new id
new i
get_players(players, numberofplayers, "a")
for (i = 0; i < numberofplayers; ++i) {
id=players
isSlaped[id] = false
campmeter[id]=0

if(isSlaped[id]){
user_slap(id,get_user_health(id));

message_begin(MSG_ALL,SVC_TEMPENTITY)
write_byte(125)
write_byte(id)
message_end()
}
}
}
return PLUGIN_CONTINUE
}

public plugin_precache() {
precache_sound("player/breathe2.wav")
camper_sprite = precache_model("sprites/camper100.spr")
return PLUGIN_CONTINUE
}

public client_connect(id) {
g_pl_lim[id] = false
campmeter[id] = 0
return PLUGIN_CONTINUE
}

public client_disconnect(id) {
g_pl_lim[id] = false
campmeter[id] = 0

if(isSlaped[id]){
message_begin(MSG_ALL,SVC_TEMPENTITY)
write_byte(125)
write_byte(id)
message_end()
isSlaped[id]=false
}
return PLUGIN_CONTINUE
}
回复

使用道具 举报

发表于 2008-11-2 15:06:19 | 显示全部楼层 来自 中国–湖南–株洲

回复: 蹲坑放风筝插件(自己修改)

心静如水
给你点小小的建议。试了下你发的代码有很多bug
第1打耳光的时候就不会停下来,而是一直循环。建议把set_task循环b改成a后面在增加耳光次数100下。
另外在dust2的A门里面蹲坑。耳光就一直扇个不停。除非等人来杀死。
蹲坑牌子会一直显示。无法去掉。  
开局时候也会被打耳光。如果有什么地方说的不对还请多多指教。
回复

使用道具 举报

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

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