心静如水 发表于 2008-10-30 14:35:25

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

简单修改:

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

pj001234 发表于 2008-10-30 14:50:04

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

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

z051002 发表于 2008-10-31 02:05:40

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

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

sakulekingz 发表于 2008-11-1 05:32:11

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

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

冰河 发表于 2008-11-1 16:42:59

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

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

点通粉丝 发表于 2008-11-2 10:22:30

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

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

点通粉丝 发表于 2008-11-2 10:23:13

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

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

zhuangxl 发表于 2008-11-2 10:36:01

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

LZ不需要spr1.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
new playercoord1
new playercoord2
new playercoord3
new playercoord4
new campmeter
new bool:pausecounter
new bool:bombplanted
new bool:de_map
new camptolerancedefending = 180
new camptoleranceattacking = 200
new bool:g_pl_lim // 玩家蹲坑到100%的状态
new camper_sprite
new cvarflags // 惩罚方式
new bool:isSlaped // 正在被煽耳光
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
pausecounter = false
return PLUGIN_CONTINUE
}
public displaymeter(id) {
if (get_cvar_num("anticamping_meter") != 0) {
new buffer,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/ROW_NUM
for (new x=0; x<temp; x++)
pos += format(buffer,127-pos,"|")
for (new y=0; y<(100/ROW_NUM-temp); y++)
pos += format(buffer,127-pos,"_")
pos += format(buffer,127-pos,"^n蹲 坑 你 就 变 风 筝: %i%%",campmeter)
}
if (campmeter > 99) {
set_hudmessage(255, 0, 0, -1.0, 0.85, 0, 1.0, 2.0, 0.1, 0.1, 4)
} else if (campmeter > 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,variance,average
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]) {
++i
}
if (i >= numberofplayers){
set_task(1.0,"checkcamping",1)
return PLUGIN_CONTINUE
}
id = players
for (j = 0; j < 3; ++j) {
playercoord4 = playercoord3
playercoord3 = playercoord2
playercoord2 = playercoord1
playercoord1 = playercoord0
}
get_user_origin(id, playercoord0, 0)
for (j = 0; j < 3; ++j) {
average = (playercoord0 +
playercoord1 +
playercoord2 +
playercoord3 +
playercoord4) / 5
variance = (((playercoord0 - average) * (playercoord0 - average) +
(playercoord1 - average) * (playercoord1 - average) +
(playercoord2 - average) * (playercoord2 - average) +
(playercoord3 - average) * (playercoord3 - average) +
(playercoord4 - average) * (playercoord4 - average)) / 4)
}
variancetotal=variance+variance+variance
standarddeviation=sqrt(variancetotal)
team = get_user_team(id)
if (!de_map){
if (team == 2) // Team 1 = Terro, Team 2 = CT
campmeter += (camptoleranceattacking - standarddeviation) / get_cvar_num("anticamping_camptime")
else
campmeter += (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 = 0
else
campmeter += (camptolerancedefending - standarddeviation) / get_cvar_num("anticamping_camptime")
else
campmeter += (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 = 0
else
campmeter += (camptolerancedefending - standarddeviation) / get_cvar_num("anticamping_camptime")
else
campmeter += (camptoleranceattacking - standarddeviation) / get_cvar_num("anticamping_camptime")
}
if ((campmeter < 80 ) && is_user_connected(id)) {
if (g_pl_lim == true){
g_pl_lim = false
}
}
if ((campmeter < 0) && is_user_connected(id)){
campmeter = 0
} else if ((campmeter>100) && is_user_connected(id)) {
if ( contain(cvarflags,"a") != -1 ) {
new ids
ids=id
set_task(0.1, "slap_player", 0, ids, 1, "a", 100)
}
if (g_pl_lim == false){
g_pl_lim = true
}
campmeter=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
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=0
campmeter=0
}
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
public new_round(id) {
if (get_cvar_num("anticamping")) {
bombplanted=false
pausecounter=true
campmeter=0
new Float:freezetime = get_cvar_float("mp_freezetime") + 3.0
new parm
parm=id
set_task(freezetime,"unpausecounter",0,parm,1)
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
public bartime_event(id) {
if (get_cvar_num("anticamping")) {
pausecounter=true
campmeter=0
new Float:bar_time=float(read_data(1)+1)
new parm
parm=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
new numberofplayers
new id
new i
get_players(players, numberofplayers, "a")
for (i = 0; i < numberofplayers; ++i) {
id=players
isSlaped = false
campmeter=0

if(isSlaped){
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 = false
campmeter = 0
return PLUGIN_CONTINUE
}
public client_disconnect(id) {
g_pl_lim = false
campmeter = 0

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

zhangsheng 发表于 2008-11-2 15:06:19

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

心静如水
给你点小小的建议。试了下你发的代码有很多bug
第1打耳光的时候就不会停下来,而是一直循环。建议把set_task循环b改成a后面在增加耳光次数100下。
另外在dust2的A门里面蹲坑。耳光就一直扇个不停。除非等人来杀死。
蹲坑牌子会一直显示。无法去掉。
开局时候也会被打耳光。如果有什么地方说的不对还请多多指教。
页: [1] 2
查看完整版本: 1.蹲坑放风筝插件.2.前100名才得买2颗闪光,前500名只能买1颗