[Cerere Plugin] no retry

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori

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
Dany3
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 78
Joined: 24 May 2018, 12:32
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Reputatie: Utilizator neserios (tepar)
Fond eXtream: 0
Contact:

28 Aug 2018, 15:41

Imi poate oferi un plugin functionabil care sa dea ban 5 minute la jucatori care isi dau retry in consola? , gen retry sa fie interzis pe server. :)
Olium
User avatar
Te-am_prins
Moderator
Moderator
Posts: 1218
Joined: 25 Jan 2014, 16:32
Detinator Steam: Da
Detinator server CS: 89.40.233.130
SteamID: Fix pe asta il stiu
Reputatie: Moderator
Membru Club eXtreamCS (7 luni)
1 avertisment scos (-2 luni club)
-1 warn (anti-tepari shop)
Location: Bucuresti
Has thanked: 37 times
Been thanked: 85 times
Contact:

07 Nov 2018, 21:57

Mutat in categoria potrivita + editat titlu
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2043
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: 33 times
Been thanked: 330 times
Contact:

07 Nov 2018, 22:40

| Afiseaza codul
/*
NO RETRY 1.10

Plugin by Priski

Usage :
kicks and/or notifies users if they use retry

CVARS :
amx_retrytime	 - time in seconds to determine if retry was used ( default: 15 )
amx_retrykick	 - set to 1 if you want to kick retry users ( default: 0 )
amx_retryshow	 - set to 0 if you want to disable public announces about use of retry ( default: 0 )
amx_retrychat	 - show usage in playerchat ( default: 1 )
amx_retrymsg	 - message which is displayed after reconnect to user ( default: "No retry allowed here, %s" ) *
amx_retrykickmsg - reason when kicked ( default: "DO NOT USE RETRY COMMAND" )
amx_retrychatmsg - message in playerchat ( default: "%s was kicked: reconnect in %t seconds" ) *

* NOTE:
%s = players name
%t = same as in amx_retrytime

Changelog :

1.16 / 2005-10-17
- added new feature cvars:
  amx_retrychat & amx_retrychatmsg
- better functionality
- hudmessages only to user who triggered

1.10 / 2005-08-17
- whole code rewritten
- bugs fixed

1.00 / 2005-08-15
- first release


*/
#include <amxmodx>
#include <amxmisc>

#define MAX_PLAYERS 32

new pID[MAX_PLAYERS][22]

public plugin_init() {
	register_plugin("No retry","1.16","Priski") 
	register_cvar("amx_retrytime","60")
	register_cvar("amx_retryban","1")
	register_cvar("amx_retrybantime","5")
	register_cvar("amx_retryshow","0")
	register_cvar("amx_retrychat","1")
	
	// %s is the player name, %t is amx_retrytime
	register_cvar("amx_retrymsg","No retry allowed here, %s")
	register_cvar("amx_retrybankmsg","Retry is not allowed!")
	register_cvar("amx_retrychatmsg","%s was banned for %x minut%y: reconnect in %t seconds")
}

public client_putinserver(id) {
	// no bots or admin immunity users
	if ((is_user_bot(id)) || (get_user_flags(id)&ADMIN_IMMUNITY)) {
		return PLUGIN_HANDLED
	}
	
	// gather info
	new ip[22]
	get_user_ip(id,ip,21)
	
	for(new i = 1; i < MAX_PLAYERS; i++) {
		if (equal(ip, pID, 21)) {
			
			new name[34]
			get_user_name(id, name, 33)
			
			if (get_cvar_num("amx_retryshow")) {
				new uID[1]
				uID[0] = id
				set_task(2.0,"showMsg", id, uID, 1)
			}
			
			if (get_cvar_num("amx_retrychat")) {
				new txt[128]
				get_cvar_string("amx_retrychatmsg", txt, 127)
				new sec[6]
				num_to_str(get_cvar_num("amx_retrytime"),sec, 5)
				
				replace(txt, 127, "%s", name)
				replace(txt, 127, "%t", sec)


				new minute[32],time[32]
				num_to_str(get_cvar_num("amx_retrybantime"),time,charsmax(time))
				replace(txt,charsmax(txt),"%x",time)

				formatex(minute,charsmax(minute),"%s",get_cvar_num("amx_retrybantime")==1?"":"e")
				replace(txt,charsmax(txt),"%y",minute)
				
				client_print( 0, print_chat, "[AMXX] %s", txt)
			}
						
			if (get_cvar_num("amx_retryban")) {
				new uID[1]
				uID[0] = get_user_userid(id)
								
				// delayed ban
				set_task(7.0,"ban",77,uID,1)
			}
			
			break
		}
	}
	
	return PLUGIN_HANDLED;
}

public client_disconnect(id) {
	// no bots or admin immunity users are in list
	if ((is_user_bot(id)) || (get_user_flags(id)&ADMIN_IMMUNITY)) {
	return PLUGIN_HANDLED; }

	// gather info
	new ip[22]
	get_user_ip(id,ip,21)
	new found = 0;
	
	for(new i = 1; i < MAX_PLAYERS; i++) {
		if (equal(ip, pID, 21)) {
			// this user has been already kicked
			found = 1
			break
		}
	}
	
	if (found == 0) {
		for(new i = 1; i < MAX_PLAYERS; i++) {
			if (pID[0] == 0) {	// found empty slot
				get_user_ip(id, pID, 21)
				new aID[1]
				aID[0] = i
				set_task( get_cvar_float("amx_retrytime"), "cleanID", (id + MAX_PLAYERS),aID,1)
						
				break
			}
		}
	}
	return PLUGIN_HANDLED;
}


public cleanID(i[]) {
	pID[i[0]][0] = 0
}

public showMsg(pID[]) {
	new txt[128]
	get_cvar_string("amx_retrymsg", txt, 127)
	
	new playername[34]
	get_user_name(pID[0], playername, 33)
	
	new sec[6]
	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[0],txt)
}

public ban(id[]) {
	new txt[128],ip[25]
	get_cvar_string("amx_retrybanmsg", txt, 127)
	get_user_ip(id[0],ip,charsmax(ip))
	server_cmd("kick #%d ^"%s^";addip %s %i", id[0], txt,ip,get_cvar_num("amx_retrybantime"))
}


sau - https://forums.alliedmods.net/showthread.php?p=197148
Post Reply

Return to “Cereri”

  • Information