[Cerere Plugin] ANTICAMP

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
AdrianJrr
Membru, skill 0
Membru, skill 0
Posts: 16
Joined: 25 Aug 2017, 16:14
Detinator Steam: Da
CS Status: SURFEZ.PLAYARENA.RO
Detinator server CS: SURFEZ.PLAYARENA.RO
Fond eXtream: 0
Contact:

31 Jul 2019, 11:41

Plugin Cerut: anticamp
Descriere (adica ce face el mai exact): cand un player face mai mult de 10 secunde camp o sa i se blocheze arma, adica numai poate sa traga pana nu se misca, pana nu face surf.
Serverul ruleaza (HLDS/ReHLDS): HLDS
Versiune AMX Mod X: Nu conteaza.
Modul Serverului: SURF
P.S : Daca ati putea voi sa il faceti ? L-am cautat pe net si nu am gasit ceea ce caut. Va rog sa nu ma luati cu google si link-uri nefolositoare. Am cautat pe dragul nostru google si degeaba. Poate am sarit, poate n-am sarit, dar nu mai conteaza. Daca ma puteti ajuta v-as fi recunoscator.
DNS : SURFEZ.PLAYARENA.RO
IP : 188.212.101.184:27015
Enix
AdrianJrr
Membru, skill 0
Membru, skill 0
Posts: 16
Joined: 25 Aug 2017, 16:14
Detinator Steam: Da
CS Status: SURFEZ.PLAYARENA.RO
Detinator server CS: SURFEZ.PLAYARENA.RO
Fond eXtream: 0
Contact:

02 Aug 2019, 16:39

Ma scuzati, se ocupa cineva si de cererea mea? Astept de 3 zile si nici un semn, nici un ajutor. Va rog mult, am nevoie .
DNS : SURFEZ.PLAYARENA.RO
IP : 188.212.101.184:27015
AdrianJrr
Membru, skill 0
Membru, skill 0
Posts: 16
Joined: 25 Aug 2017, 16:14
Detinator Steam: Da
CS Status: SURFEZ.PLAYARENA.RO
Detinator server CS: SURFEZ.PLAYARENA.RO
Fond eXtream: 0
Contact:

03 Aug 2019, 19:40

UP! Va rog, am nevoie !
DNS : SURFEZ.PLAYARENA.RO
IP : 188.212.101.184:27015
User avatar
(c) WaRninG.
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 283
Joined: 13 Jul 2018, 13:44
Detinator Steam: Da
Detinator server CS: 《ZP.PLAYARENA.RO 》
SteamID: Andu
Reputatie: Utilizator neserios (tepar!)
Membru Club eXtreamCS (4 Ian - 4 Mai)
Nick anterior: Andrei # QualTech
-1 avertisment (2 luni club)
Fond eXtream: 0
Location: Câmpulung
Has thanked: 3 times
Contact:

04 Aug 2019, 09:55

| Afiseaza codul
/* Ultimate AntiCamping AMXMODX Plugin
* Fisier descarcat de pe www.cs-gothic.ro !
* Author : SAMURAI
* Version : 0.1
* event_hud codes from amxmod, cvars by SpaceDude -> ported to AMXX
* defined X & Y Position 
* Description : With this plugin add on you server an camper detector; Display on client's "Your Camping %value"
*               and have some punishments; slap, heartbert
*
* Thanks to razvy_10 for sugestion 
*/

#include <amxmodx>
#include <fun>

#define SND_STOP (1<<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



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) {
		if (campmeter[id] > 100) {
			set_hudmessage(255, 0, 0, -1.0, 0.85, 0, 1.0, 2.0, 0.1, 0.1, 4)
			show_hudmessage(id,"Your camping: %i%",campmeter[id])
		} else if (campmeter[id] > 90) {
			set_hudmessage(255, 0, 0, -1.0, 0.85, 0, 1.0, 2.0, 0.1, 0.1, 4)
			show_hudmessage(id,"Your camping: %i%",campmeter[id])
		} else if (campmeter[id] > 80){
			set_hudmessage(255, 100, 0, -1.0, 0.85, 0, 1.0, 2.0, 0.1, 0.1, 4)
			show_hudmessage(id,"Your camping: %i%",campmeter[id])
		} else if (campmeter[id] > 50 ) {
			set_hudmessage(255, 255, 0, -1.0, 0.85, 0, 1.0, 2.0, 0.1, 0.1, 4)
			show_hudmessage(id,"Your camping: %i%",campmeter[id])
		} else if (campmeter[id] > 20 ) {
			set_hudmessage(0, 255, 0, -1.0, 0.85, 0, 1.0, 2.0, 0.1, 0.1, 4)
			show_hudmessage(id,"Your camping: %i%",campmeter[id])
		} else {
			set_hudmessage(0, 0, 255, -1.0, 0.85, 0, 1.0, 2.0, 0.1, 0.1, 4)
			show_hudmessage(id,"Your camping: %i%",campmeter[id])
		}
	}
	return PLUGIN_HANDLED
}

public checkcamping(){
	if (get_cvar_num("anticamping") == 0){
		set_task(1.0,"checkcamping",1)
		return PLUGIN_CONTINUE
	}
	new players[32]
	new numberofplayers
	new variance[3]
	new average[3]
	new variancetotal
	new standarddeviation
	new id
	new team
	new i
	new j
	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
				campmeter[id] = 0
			else
				campmeter[id] += (camptoleranceattacking-standarddeviation)/get_cvar_num("anticamping_camptime")
		}
		else{
			if (team==2)	// Team 1 = Terro, Team 2 = CT
				campmeter[id] += (camptolerancedefending-standarddeviation)/get_cvar_num("anticamping_camptime")
			else
				campmeter[id] += (camptoleranceattacking-standarddeviation)/get_cvar_num("anticamping_camptime")
		}
		if (campmeter[id] < 80 ) {
			emit_sound(id,CHAN_VOICE,"player/heartbeat1.wav", 0.0, ATTN_NORM, SND_STOP, PITCH_NORM)
		}
		if (campmeter[id] < 0) {
			campmeter[id] = 0
		} else if (campmeter[id]>100) {
			switch(get_cvar_num("anticamping")) {
				case 1: {
					user_slap(id,get_cvar_num("anticamping_healthpunish"))
				}
				case 2: {
					set_user_health(id, get_user_health(id) - get_cvar_num("anticamping_healthpunish"))
				}
				case 3: {
					emit_sound(id,CHAN_VOICE,"player/heartbeat1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
				}
			}
			campmeter[id] = 100
		} else if (campmeter[id] > 90) {
			switch(get_cvar_num("anticamping")) {
				case 1: {
					user_slap(id,get_cvar_num("anticamping_healthpunish") / 5)
				}
				case 2: {
					set_user_health(id, get_user_health(id) - get_cvar_num("anticamping_healthpunish") / 5)
				}
				case 3: {
					emit_sound(id,CHAN_VOICE,"player/heartbeat1.wav", 0.5, ATTN_NORM, 0, PITCH_NORM)
				}
			}
		} else if (campmeter[id]>80){
			switch(get_cvar_num("anticamping")) {
				case 1: {
					user_slap(id,get_cvar_num("anticamping_healthpunish") / 10)
				}
				case 2: {
					set_user_health(id, get_user_health(id) - get_cvar_num("anticamping_healthpunish") / 10)
				}
				case 3: {
					emit_sound(id,CHAN_VOICE,"player/heartbeat1.wav", 0.1, ATTN_NORM, 0, PITCH_NORM)
				}
			}
		}
		displaymeter(id)
	}
	set_task(2.0,"checkcamping",1)
	return PLUGIN_CONTINUE
}

public damage_event(id) {
	if (get_cvar_num("anticamping") != 0) {
		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") != 0) {
		bombplanted=false
		pausecounter[id]=true
		campmeter[id]=0
		new Float:freezetime = get_cvar_float("mp_freezetime")+1.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") != 0) {
		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") != 0) {
		bombplanted=true
		return PLUGIN_CONTINUE
	}
	return PLUGIN_CONTINUE
}

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

public round_end() {
	if (get_cvar_num("anticamping") != 0) {
		new players[32]
		new numberofplayers
		new id
		new i
		get_players(players, numberofplayers, "a")
		for (i = 0; i < numberofplayers; ++i) {
			id=players
			pausecounter[id]=true
			return PLUGIN_CONTINUE
		}
	}
	return PLUGIN_CONTINUE
}

public plugin_precache() {
	precache_sound("player/heartbeat1.wav")
	return PLUGIN_CONTINUE
}
public plugin_init() {
	register_plugin("Ultimate AntiCamping","1.01","SAMURAI")
	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)  //0=Disabled, 1=Slap, 2=Health Reduction, 3=Heartbeat
	register_cvar("anticamping_camptime","20",0)  //Amount of time allowed to camp
	register_cvar("anticamping_healthpunish","5",0)  //Amount of health taken due to punishment
	register_cvar("anticamping_meter","1",0) //Display 'campmeter' to each cilent
	set_task(1.0,"checkcamping",1)
	return PLUGIN_CONTINUE
}
Cvar-uri le pui in amxx.cfg
-anticamping_camptime 20 (timpul in secunde in care un jucator poate sta la panda(ex daca sta 5 secunde incepe sa primeasca slap)
-anticamping_healthpunish 5 - cantitatea de Hp (viata) care i se va scade jucatorului pedepsit(poti pune cat doresti)(ex: daca lasi 5 la fiecare slap ii va lua 5 hp pana acesta se va misca sau pana moare daca nu se misca)


SURSA OFICIALA :
| Afiseaza codul
cereri-pluginuri/cerere-plugin-anti-camp-t321024.html
AdrianJrr
Membru, skill 0
Membru, skill 0
Posts: 16
Joined: 25 Aug 2017, 16:14
Detinator Steam: Da
CS Status: SURFEZ.PLAYARENA.RO
Detinator server CS: SURFEZ.PLAYARENA.RO
Fond eXtream: 0
Contact:

04 Aug 2019, 15:00

(c) WaRninG. wrote:
04 Aug 2019, 09:55
| Afiseaza codul
/* Ultimate AntiCamping AMXMODX Plugin
* Fisier descarcat de pe www.cs-gothic.ro !
* Author : SAMURAI
* Version : 0.1
* event_hud codes from amxmod, cvars by SpaceDude -> ported to AMXX
* defined X & Y Position 
* Description : With this plugin add on you server an camper detector; Display on client's "Your Camping %value"
*               and have some punishments; slap, heartbert
*
* Thanks to razvy_10 for sugestion 
*/

#include <amxmodx>
#include <fun>

#define SND_STOP (1<<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



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) {
		if (campmeter[id] > 100) {
			set_hudmessage(255, 0, 0, -1.0, 0.85, 0, 1.0, 2.0, 0.1, 0.1, 4)
			show_hudmessage(id,"Your camping: %i%",campmeter[id])
		} else if (campmeter[id] > 90) {
			set_hudmessage(255, 0, 0, -1.0, 0.85, 0, 1.0, 2.0, 0.1, 0.1, 4)
			show_hudmessage(id,"Your camping: %i%",campmeter[id])
		} else if (campmeter[id] > 80){
			set_hudmessage(255, 100, 0, -1.0, 0.85, 0, 1.0, 2.0, 0.1, 0.1, 4)
			show_hudmessage(id,"Your camping: %i%",campmeter[id])
		} else if (campmeter[id] > 50 ) {
			set_hudmessage(255, 255, 0, -1.0, 0.85, 0, 1.0, 2.0, 0.1, 0.1, 4)
			show_hudmessage(id,"Your camping: %i%",campmeter[id])
		} else if (campmeter[id] > 20 ) {
			set_hudmessage(0, 255, 0, -1.0, 0.85, 0, 1.0, 2.0, 0.1, 0.1, 4)
			show_hudmessage(id,"Your camping: %i%",campmeter[id])
		} else {
			set_hudmessage(0, 0, 255, -1.0, 0.85, 0, 1.0, 2.0, 0.1, 0.1, 4)
			show_hudmessage(id,"Your camping: %i%",campmeter[id])
		}
	}
	return PLUGIN_HANDLED
}

public checkcamping(){
	if (get_cvar_num("anticamping") == 0){
		set_task(1.0,"checkcamping",1)
		return PLUGIN_CONTINUE
	}
	new players[32]
	new numberofplayers
	new variance[3]
	new average[3]
	new variancetotal
	new standarddeviation
	new id
	new team
	new i
	new j
	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
				campmeter[id] = 0
			else
				campmeter[id] += (camptoleranceattacking-standarddeviation)/get_cvar_num("anticamping_camptime")
		}
		else{
			if (team==2)	// Team 1 = Terro, Team 2 = CT
				campmeter[id] += (camptolerancedefending-standarddeviation)/get_cvar_num("anticamping_camptime")
			else
				campmeter[id] += (camptoleranceattacking-standarddeviation)/get_cvar_num("anticamping_camptime")
		}
		if (campmeter[id] < 80 ) {
			emit_sound(id,CHAN_VOICE,"player/heartbeat1.wav", 0.0, ATTN_NORM, SND_STOP, PITCH_NORM)
		}
		if (campmeter[id] < 0) {
			campmeter[id] = 0
		} else if (campmeter[id]>100) {
			switch(get_cvar_num("anticamping")) {
				case 1: {
					user_slap(id,get_cvar_num("anticamping_healthpunish"))
				}
				case 2: {
					set_user_health(id, get_user_health(id) - get_cvar_num("anticamping_healthpunish"))
				}
				case 3: {
					emit_sound(id,CHAN_VOICE,"player/heartbeat1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
				}
			}
			campmeter[id] = 100
		} else if (campmeter[id] > 90) {
			switch(get_cvar_num("anticamping")) {
				case 1: {
					user_slap(id,get_cvar_num("anticamping_healthpunish") / 5)
				}
				case 2: {
					set_user_health(id, get_user_health(id) - get_cvar_num("anticamping_healthpunish") / 5)
				}
				case 3: {
					emit_sound(id,CHAN_VOICE,"player/heartbeat1.wav", 0.5, ATTN_NORM, 0, PITCH_NORM)
				}
			}
		} else if (campmeter[id]>80){
			switch(get_cvar_num("anticamping")) {
				case 1: {
					user_slap(id,get_cvar_num("anticamping_healthpunish") / 10)
				}
				case 2: {
					set_user_health(id, get_user_health(id) - get_cvar_num("anticamping_healthpunish") / 10)
				}
				case 3: {
					emit_sound(id,CHAN_VOICE,"player/heartbeat1.wav", 0.1, ATTN_NORM, 0, PITCH_NORM)
				}
			}
		}
		displaymeter(id)
	}
	set_task(2.0,"checkcamping",1)
	return PLUGIN_CONTINUE
}

public damage_event(id) {
	if (get_cvar_num("anticamping") != 0) {
		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") != 0) {
		bombplanted=false
		pausecounter[id]=true
		campmeter[id]=0
		new Float:freezetime = get_cvar_float("mp_freezetime")+1.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") != 0) {
		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") != 0) {
		bombplanted=true
		return PLUGIN_CONTINUE
	}
	return PLUGIN_CONTINUE
}

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

public round_end() {
	if (get_cvar_num("anticamping") != 0) {
		new players[32]
		new numberofplayers
		new id
		new i
		get_players(players, numberofplayers, "a")
		for (i = 0; i < numberofplayers; ++i) {
			id=players
			pausecounter[id]=true
			return PLUGIN_CONTINUE
		}
	}
	return PLUGIN_CONTINUE
}

public plugin_precache() {
	precache_sound("player/heartbeat1.wav")
	return PLUGIN_CONTINUE
}
public plugin_init() {
	register_plugin("Ultimate AntiCamping","1.01","SAMURAI")
	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)  //0=Disabled, 1=Slap, 2=Health Reduction, 3=Heartbeat
	register_cvar("anticamping_camptime","20",0)  //Amount of time allowed to camp
	register_cvar("anticamping_healthpunish","5",0)  //Amount of health taken due to punishment
	register_cvar("anticamping_meter","1",0) //Display 'campmeter' to each cilent
	set_task(1.0,"checkcamping",1)
	return PLUGIN_CONTINUE
}
Cvar-uri le pui in amxx.cfg
-anticamping_camptime 20 (timpul in secunde in care un jucator poate sta la panda(ex daca sta 5 secunde incepe sa primeasca slap)
-anticamping_healthpunish 5 - cantitatea de Hp (viata) care i se va scade jucatorului pedepsit(poti pune cat doresti)(ex: daca lasi 5 la fiecare slap ii va lua 5 hp pana acesta se va misca sau pana moare daca nu se misca)


SURSA OFICIALA :
| Afiseaza codul
cereri-pluginuri/cerere-plugin-anti-camp-t321024.html
Multumesc, dar nu asta este ceea ce caut. Eu vreau ca player-ul respectiv care face camp mai mult de 10 secunde sa ii se blocheze arma, sa numai poata sa traga pana nu face surf.
DNS : SURFEZ.PLAYARENA.RO
IP : 188.212.101.184:27015
@IONUTZ
Membru, skill +1
Membru, skill +1
Posts: 198
Joined: 17 Dec 2017, 23:11
Detinator Steam: Da
Fond eXtream: 0
Has thanked: 2 times
Been thanked: 3 times

04 Aug 2019, 15:05

AdrianJrr wrote:
04 Aug 2019, 15:00
(c) WaRninG. wrote:
04 Aug 2019, 09:55
| Afiseaza codul
/* Ultimate AntiCamping AMXMODX Plugin
* Fisier descarcat de pe www.cs-gothic.ro !
* Author : SAMURAI
* Version : 0.1
* event_hud codes from amxmod, cvars by SpaceDude -> ported to AMXX
* defined X & Y Position 
* Description : With this plugin add on you server an camper detector; Display on client's "Your Camping %value"
*               and have some punishments; slap, heartbert
*
* Thanks to razvy_10 for sugestion 
*/

#include <amxmodx>
#include <fun>

#define SND_STOP (1<<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



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) {
		if (campmeter[id] > 100) {
			set_hudmessage(255, 0, 0, -1.0, 0.85, 0, 1.0, 2.0, 0.1, 0.1, 4)
			show_hudmessage(id,"Your camping: %i%",campmeter[id])
		} else if (campmeter[id] > 90) {
			set_hudmessage(255, 0, 0, -1.0, 0.85, 0, 1.0, 2.0, 0.1, 0.1, 4)
			show_hudmessage(id,"Your camping: %i%",campmeter[id])
		} else if (campmeter[id] > 80){
			set_hudmessage(255, 100, 0, -1.0, 0.85, 0, 1.0, 2.0, 0.1, 0.1, 4)
			show_hudmessage(id,"Your camping: %i%",campmeter[id])
		} else if (campmeter[id] > 50 ) {
			set_hudmessage(255, 255, 0, -1.0, 0.85, 0, 1.0, 2.0, 0.1, 0.1, 4)
			show_hudmessage(id,"Your camping: %i%",campmeter[id])
		} else if (campmeter[id] > 20 ) {
			set_hudmessage(0, 255, 0, -1.0, 0.85, 0, 1.0, 2.0, 0.1, 0.1, 4)
			show_hudmessage(id,"Your camping: %i%",campmeter[id])
		} else {
			set_hudmessage(0, 0, 255, -1.0, 0.85, 0, 1.0, 2.0, 0.1, 0.1, 4)
			show_hudmessage(id,"Your camping: %i%",campmeter[id])
		}
	}
	return PLUGIN_HANDLED
}

public checkcamping(){
	if (get_cvar_num("anticamping") == 0){
		set_task(1.0,"checkcamping",1)
		return PLUGIN_CONTINUE
	}
	new players[32]
	new numberofplayers
	new variance[3]
	new average[3]
	new variancetotal
	new standarddeviation
	new id
	new team
	new i
	new j
	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
				campmeter[id] = 0
			else
				campmeter[id] += (camptoleranceattacking-standarddeviation)/get_cvar_num("anticamping_camptime")
		}
		else{
			if (team==2)	// Team 1 = Terro, Team 2 = CT
				campmeter[id] += (camptolerancedefending-standarddeviation)/get_cvar_num("anticamping_camptime")
			else
				campmeter[id] += (camptoleranceattacking-standarddeviation)/get_cvar_num("anticamping_camptime")
		}
		if (campmeter[id] < 80 ) {
			emit_sound(id,CHAN_VOICE,"player/heartbeat1.wav", 0.0, ATTN_NORM, SND_STOP, PITCH_NORM)
		}
		if (campmeter[id] < 0) {
			campmeter[id] = 0
		} else if (campmeter[id]>100) {
			switch(get_cvar_num("anticamping")) {
				case 1: {
					user_slap(id,get_cvar_num("anticamping_healthpunish"))
				}
				case 2: {
					set_user_health(id, get_user_health(id) - get_cvar_num("anticamping_healthpunish"))
				}
				case 3: {
					emit_sound(id,CHAN_VOICE,"player/heartbeat1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
				}
			}
			campmeter[id] = 100
		} else if (campmeter[id] > 90) {
			switch(get_cvar_num("anticamping")) {
				case 1: {
					user_slap(id,get_cvar_num("anticamping_healthpunish") / 5)
				}
				case 2: {
					set_user_health(id, get_user_health(id) - get_cvar_num("anticamping_healthpunish") / 5)
				}
				case 3: {
					emit_sound(id,CHAN_VOICE,"player/heartbeat1.wav", 0.5, ATTN_NORM, 0, PITCH_NORM)
				}
			}
		} else if (campmeter[id]>80){
			switch(get_cvar_num("anticamping")) {
				case 1: {
					user_slap(id,get_cvar_num("anticamping_healthpunish") / 10)
				}
				case 2: {
					set_user_health(id, get_user_health(id) - get_cvar_num("anticamping_healthpunish") / 10)
				}
				case 3: {
					emit_sound(id,CHAN_VOICE,"player/heartbeat1.wav", 0.1, ATTN_NORM, 0, PITCH_NORM)
				}
			}
		}
		displaymeter(id)
	}
	set_task(2.0,"checkcamping",1)
	return PLUGIN_CONTINUE
}

public damage_event(id) {
	if (get_cvar_num("anticamping") != 0) {
		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") != 0) {
		bombplanted=false
		pausecounter[id]=true
		campmeter[id]=0
		new Float:freezetime = get_cvar_float("mp_freezetime")+1.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") != 0) {
		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") != 0) {
		bombplanted=true
		return PLUGIN_CONTINUE
	}
	return PLUGIN_CONTINUE
}

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

public round_end() {
	if (get_cvar_num("anticamping") != 0) {
		new players[32]
		new numberofplayers
		new id
		new i
		get_players(players, numberofplayers, "a")
		for (i = 0; i < numberofplayers; ++i) {
			id=players
			pausecounter[id]=true
			return PLUGIN_CONTINUE
		}
	}
	return PLUGIN_CONTINUE
}

public plugin_precache() {
	precache_sound("player/heartbeat1.wav")
	return PLUGIN_CONTINUE
}
public plugin_init() {
	register_plugin("Ultimate AntiCamping","1.01","SAMURAI")
	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)  //0=Disabled, 1=Slap, 2=Health Reduction, 3=Heartbeat
	register_cvar("anticamping_camptime","20",0)  //Amount of time allowed to camp
	register_cvar("anticamping_healthpunish","5",0)  //Amount of health taken due to punishment
	register_cvar("anticamping_meter","1",0) //Display 'campmeter' to each cilent
	set_task(1.0,"checkcamping",1)
	return PLUGIN_CONTINUE
}
Cvar-uri le pui in amxx.cfg
-anticamping_camptime 20 (timpul in secunde in care un jucator poate sta la panda(ex daca sta 5 secunde incepe sa primeasca slap)
-anticamping_healthpunish 5 - cantitatea de Hp (viata) care i se va scade jucatorului pedepsit(poti pune cat doresti)(ex: daca lasi 5 la fiecare slap ii va lua 5 hp pana acesta se va misca sau pana moare daca nu se misca)


SURSA OFICIALA :
| Afiseaza codul
cereri-pluginuri/cerere-plugin-anti-camp-t321024.html
Multumesc, dar nu asta este ceea ce caut. Eu vreau ca player-ul respectiv care face camp mai mult de 10 secunde sa ii se blocheze arma, sa numai poata sa traga pana nu face surf.
Cred ca ar trebui sa cauti un scripter sa-ti faca acest plugin si gratis cu asa ceva nu cred ca te ajuta nimeni :(( dar poate cine stie se va gasi cineva.
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2554
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 37 times
Been thanked: 387 times
Contact:

08 Aug 2019, 12:48

Code: Select all

#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>

#define TIME_AS 25.0

new Float:player_origin[33][3],bool:block[33]

#define valid(%1)	!(is_user_bot(%1)||is_user_hltv(%1))

public plugin_init()
{
    RegisterHam(Ham_Spawn, "player", "e_Spawn", 1);
    register_forward(FM_PlayerPreThink, "PlayerPreThink")
}

public e_Spawn(id)	if(is_user_alive(id)&&valid(id))	set_task(TIME_AS, "get_spawn", id);

public get_spawn(id)
{
    pev(id, pev_origin, player_origin[id]);
    set_task(1.0, "check_afk", id,.flags="b");
}

public check_afk(id)
{
    if(is_user_alive(id))
    {
	if(same_origin(id)&&!block[id])	block[id]=true
	else block[id]=false
    }
}

stock same_origin(id)
{
    new Float:origin[3];
    pev(id, pev_origin, origin);
    for(new i = 0; i < 3; i++)	if(origin[i] != player_origin[id][i])	return 0;
    return 1;
}

public PlayerPreThink(id){
    if(!is_user_alive(id))	return
    new button = pev(id,pev_button)
    if(block[id] && (button & IN_ATTACK || button & IN_ATTACK2))	set_pev(id,pev_button,(button & ~IN_ATTACK) & ~IN_ATTACK2)
}

#pragma tabsize 0
Nu fac nimic contra cost! Faceți cerere bine detaliată aici, pe forum. Nu-mi mai dați add pe Steam doar pentru a mă avea în lista de prieteni.
Am cont și activez doar aici! Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz.
În cazul în care utilizați ceva din addonsurile postate de mine aici, e bine să fiți la curent cu modificările aduse unor plugine, aici.
AdrianJrr
Membru, skill 0
Membru, skill 0
Posts: 16
Joined: 25 Aug 2017, 16:14
Detinator Steam: Da
CS Status: SURFEZ.PLAYARENA.RO
Detinator server CS: SURFEZ.PLAYARENA.RO
Fond eXtream: 0
Contact:

10 Aug 2019, 01:26

L E V I N multumesc frumos.
Pwpix <3 :*
DNS : SURFEZ.PLAYARENA.RO
IP : 188.212.101.184:27015
AdrianJrr
Membru, skill 0
Membru, skill 0
Posts: 16
Joined: 25 Aug 2017, 16:14
Detinator Steam: Da
CS Status: SURFEZ.PLAYARENA.RO
Detinator server CS: SURFEZ.PLAYARENA.RO
Fond eXtream: 0
Contact:

12 Aug 2019, 15:13

Am observat niste probleme. Cand stai camp se blocheaza foarte putin timp, maxim 2 secunde si dupa poti trage iar. Apropo, se poate adauga si 1 mesaj? Ai facut camp 15 secunde, misca !
DNS : SURFEZ.PLAYARENA.RO
IP : 188.212.101.184:27015
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2554
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 37 times
Been thanked: 387 times
Contact:

12 Aug 2019, 18:37

păi dacă se mișcă logic

Code: Select all

#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>

#define TIME_AS 25.0
#define TIME_CHECK 15

new Float:player_origin[33][3],bool:block[33]

#define valid(%1)	!(is_user_bot(%1)||is_user_hltv(%1))

public plugin_init()
{
    RegisterHam(Ham_Spawn, "player", "e_Spawn", 1);
    register_forward(FM_PlayerPreThink, "PlayerPreThink")
}

public e_Spawn(id)	if(is_user_alive(id)&&valid(id))	block[id]=false,set_task(TIME_AS, "get_spawn", id);

public get_spawn(id)
{
    pev(id, pev_origin, player_origin[id]);
    set_task(float(TIME_CHECK), "check_afk", id,.flags="b");
}

public check_afk(id)
{
    if(is_user_alive(id))
    {
	if(same_origin(id)&&!block[id])
	{
		block[id]=true
		client_print(id,print_chat,"ai stat afk %d secunde",TIME_CHECK)
	}
	else block[id]=false
    }
}

stock same_origin(id)
{
    new Float:origin[3];
    pev(id, pev_origin, origin);
    for(new i = 0; i < 3; i++)	if(origin[i] != player_origin[id][i])	return 0;
    return 1;
}

public PlayerPreThink(id){
    if(!is_user_alive(id))	return
    new button = pev(id,pev_button)
    if(block[id] && (button & IN_ATTACK || button & IN_ATTACK2))	set_pev(id,pev_button,(button & ~IN_ATTACK) & ~IN_ATTACK2)
}

#pragma tabsize 0
Nu fac nimic contra cost! Faceți cerere bine detaliată aici, pe forum. Nu-mi mai dați add pe Steam doar pentru a mă avea în lista de prieteni.
Am cont și activez doar aici! Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz.
În cazul în care utilizați ceva din addonsurile postate de mine aici, e bine să fiți la curent cu modificările aduse unor plugine, aici.
AdrianJrr
Membru, skill 0
Membru, skill 0
Posts: 16
Joined: 25 Aug 2017, 16:14
Detinator Steam: Da
CS Status: SURFEZ.PLAYARENA.RO
Detinator server CS: SURFEZ.PLAYARENA.RO
Fond eXtream: 0
Contact:

18 Aug 2019, 04:07

Inca pot sa trag. Deci ca sa fie mai usor pune ca atunci cand faci camp 15 secunde sa ti se blocheze arma pentru 5 secunde, orice arma, chiar daca te misti ea sa fie blocata 5 secunde. Si as dori ca mesajul sa fie in hud, chiar in mijloc, te rog. Mersi

Știți cumva de ce apare asta în user.ini,advertisments.ini și în gamecp/config?

status == -1 errno == 104 in Socket::recvstatus == -1 errno == 104 in Socket::recvstatus == -1 errno == 104 in Socket::recvstatus == -1 errno == 104 in Socket::recvstatus == -1 errno == 104 in Socket::recvstatus == -1 errno == 104 in Socket::recvstatus == -1 errno == 104 in Socket::recvstatus == -1 errno == 104 in Socket::recvstatus == -1 errno == 104 in Socket::recvstatus == -1 errno == 104 in Socket::recvstatus == -1 errno == 104 in Socket::recvstatus == -1 errno == 104 in Socket::recv
DNS : SURFEZ.PLAYARENA.RO
IP : 188.212.101.184:27015
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 16 guests