Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

FTS - zdjęcie

FTS

Rejestracja: 06.06.2015
Aktualnie: Nieaktywny
Poza forum Ostatnio: 26.02.2016 16:14
-----

Moje posty

W temacie: Votowanie czasu mapy

07.06.2015 11:18

Proszę, sprawdź czy działa :)

#include <amxmodx>

#include <amxmisc>



#define PLUGIN	"TimeVotes"

#define AUTHOR	"FTS"

#define VERSION	"1.0"



new choises[6]

new Float:g_timelimit



public plugin_init() 

{

	register_plugin("PLUGIN", "VERSION", "AUTHOR")

	set_task(180.0, "start_vote");

}



public start_vote(id)

{	

	new menu = menu_create("rWybierz czas grania tej mapy.", "menu_handler")

	menu_additem(menu, "w10 minut", "1", 0)

	menu_additem(menu, "w15 minut", "2", 0)

	menu_additem(menu, "w20 minut", "3", 0)

	menu_additem(menu, "w25 minut", "4", 0)

	menu_additem(menu, "w30 minut", "5", 0)

	menu_addblank(menu, 0)

	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)

	

	new players[32], inum

	get_players(players, inum, "ch")

	for(new i = 0; i < inum; i++)

	{

		menu_display(players[i], menu, 0)

	}

	

	set_task(15.0, "finish_vote")

	

	choises[1] = choises[2] = choises[3] = choises[4] = choises[5] = 0

	

	return 1

}



public menu_handler(id, menu, item)

{

	if (item == MENU_EXIT)

	{

		menu_cancel(id)

		return PLUGIN_HANDLED

	}

	

	new data[6], name[32]

	new access, callback

	

	menu_item_getinfo(menu, item, access, data, 5, _, _, callback)

	

	new key = str_to_num(data)

	get_user_name(id, name, 31)

	

	switch (key) 

	{

		case 1: 

		{

			client_print (0, print_chat, "[TimeVotes] %s zaglosowal na 10 minut.", name);

		}

		case 2:

		{

			client_print (0, print_chat, "[TimeVotes] %s zaglosowal na 15 minut.", name);

		}

		case 3:

		{

			client_print (0, print_chat, "[TimeVotes] %s zaglosowal na 20 minut.", name);

		}

		case 4:

		{

			client_print (0, print_chat, "[TimeVotes] %s zaglosowal na 25 minut.", name);

		}


		case 5:

		{

			client_print (0, print_chat, "[TimeVotes] %s zaglosowal na 30 minut.", name);

		}
	}

	

	++choises[key]

	

	menu_cancel(id)

	return PLUGIN_HANDLED

}



public finish_vote()

{

	g_timelimit = get_cvar_float("mp_timelimit")

	

	if(choises[1] > choises[2] && choises[1] > choises[3] && choises[1] > choises[4] && choises[1] > choises[5])

	{

		client_print(0, print_chat, "[TimeVotes] Opcja ^"10 minut^" WYGRALA  ( %d ) glosami.", choises[1])

		server_cmd("mp_timelimit 10");

	}

	else if(choises[2] > choises[1] && choises[2] > choises[3] && choises[2] > choises[4] && choises[2] > choises[5])

	{

		client_print(0, print_chat, "[TimeVotes] Opcja ^"15 minut^" WYGRALA ( %d ) glosami", choises[2])

		server_cmd("mp_timelimit 15");

	}

	else if(choises[3] > choises[1] && choises[3] > choises[2] && choises[3] > choises[4] && choises[3] > choises[5])

	{

		client_print(0, print_chat, "[TimeVotes] Opcja ^"20 minut^" WYGRALA ( %d ) glosami", choises[3])

		server_cmd("mp_timelimit 20");

	}

	else if(choises[4] > choises[1] && choises[4] > choises[2] && choises[4] > choises[3] && choises[4] > choises[5])

	{

		client_print(0, print_chat, "[TimeVotes] Opcja ^"25 minut^" WYGRALA ( %d ) glosami", choises[4])

		server_cmd("mp_timelimit 25");

	}

	else if(choises[5] > choises[1] && choises[5] > choises[2] && choises[5] > choises[3] && choises[5] > choises[4])

	{

		client_print(0, print_chat, "[TimeVotes] Opcja ^"30 minut^" WYGRALA ( %d ) glosami", choises[5])

		server_cmd("mp_timelimit 30");

	}

}  



public plugin_end() 

{

	set_cvar_float("mp_timelimit", g_timelimit)

}

W temacie: Gracze steam nie mogą się połączyć z moim serwerem

06.06.2015 18:05

# ========================================================
# 		DPROTO CONFIGURATION
# ========================================================

#
# General rule for modifying this file:
#	DONT CHANGE ANYTHING IF YOU DONT KNOW WHAT IT MEANS!
#


# ========================================================
# 		AUTHID MANAGEMENT
# ========================================================

# ClientID types (for cid_* options)
#  1: Real (or generated by HW) steam (STEAM_xx:xx:xx)
#  2: Real (or generated by HW) valve (VALVE_xx:xx:xx)
#  3: STEAM_ by IP
#  4: VALVE_ by IP
#  5: Deprecated - client will be rejected
#  6: reserved for future use
#  7: HLTV
#  8: STEAM_ID_LAN
#  9: STEAM_ID_PENDING
#  10: VALVE_ID_LAN
#  11: VALVE_ID_PENDING
#  12: STEAM_666:88:666

# Use these options to set authid's for clients

# for HLTV (default is HLTV [7])
cid_HLTV = 7

# for p.47 clients that do not support unique id generation (default is STEAM_ID_LAN [8])
cid_NoSteam47 = 3

# for p.48 clients that do not support unique id generation (default is VALVE_ID_LAN [10])
cid_NoSteam48 = 3

# For Legit Steam clients (default is real STEAM_xx:xx:xx [1])
cid_Steam = 1

# Client recognized as pending when they sucessfully authorized, but did not get steam id
# REMARK: Actually, it got steamid, but it is useless (STEAM_0:0:0 for example)
# default is STEAM_ID_PENDING [9]
cid_SteamPending = 9

# For players having revEmu ( >= 9.74) on client-side:
# default is real STEAM_xx:xx:xx [1]
cid_RevEmu = 1

# For players having RevEmu 2013 on client-side:
# default is real STEAM_xx:xx:xx [1]
cid_RevEmu2013 = 1

# For players having SteamClient 2009 / revEmu > 9.82 on client-side:
# default is real STEAM_xx:xx:xx [1]
cid_SC2009 = 1

# For players having old revEmu on client-side:
# default is real STEAM_xx:xx:xx [1]
cid_OldRevEmu = 1

# For players having hCupa's SteamEmu on client-side:
# default is real STEAM_xx:xx:xx [1]
cid_SteamEmu = 1

# For players having AVSMP (Cracked Steam) on client-side:
# default is real STEAM_xx:xx:xx [1]
cid_AVSMP = 1

# For SETTI ServerScanner
# default is STEAM_xx:xx:xx generated by IP [3]
cid_Setti = 3

# For SXEI Clients
# default is real STEAM_xx:xx:xx [1]
cid_SXEI = 1

# EnableSXEIdGeneration (0 / 1)
# Turns on steamid generation based on info sent by sXeI client
# Enable this only if you have sXeI server installed!
EnableSXEIdGeneration = 0

# SC2009_RevCompatMode (0 / 1)
# Enable fix to make steamids generated for SC2009 compatible with revEmu
SC2009_RevCompatMode = 1

# SteamEmuCompatMode (0 / 1)
# An analog for eSTEAMATiON's EnforceSteamEmuCompatIDMode option.
# Affects only Old RevEmu and SteamEmu emulators.
SteamEmuCompatMode = 1

# OldEstCompatMode (0 / 1)
# Enables/Disables fix for steamids generated by eST in 0.3.1 version.
# Set this to 1 if you want to make steamids generated by eST as in < 0.3.0 versions.
OldEstCompatMode = 0

# SteamIdHashSalt (string)
# Salt string for SteamIDs hashing. Irreversibly changes SteamIDs. Applies only to SteamIDs generated by emulators.
# Should be more than 16 chars length. If string is empty, hashing is not applied.
SteamIdHashSalt = 28472942412414684

# IPGen_Prefix1 (int)
# STEAM_a:b:c
# first prefix (a) for authids generated by IP
IPGen_Prefix1 = 0

# IPGen_Prefix2 (int)
# STEAM_a:b:c
# second prefix (b) for authids generated by IP
IPGen_Prefix2 = 4

# Native_Prefix1 (int)
# STEAM_a:b:c
# first prefix (a) for authids generated by native auth method (Steam)
Native_Prefix1 = 0;

# RevEmu_Prefix1 (int)
# STEAM_a:b:c
# first prefix (a) for authids generated by Steamclient 2009
SC2009_Prefix1 = 0;

# RevEmu_Prefix1 (int)
# STEAM_a:b:c
# first prefix (a) for authids generated by RevEmu
RevEmu_Prefix1 = 0;

# RevEmu2013_Prefix1 (int)
# STEAM_a:b:c
# first prefix (a) for authids generated by RevEmu2013
RevEmu2013_Prefix1 = 0;

# OldRevEmu_Prefix1 (int)
# STEAM_a:b:c
# first prefix (a) for authids generated by old RevEmu
OldRevEmu_Prefix1 = 0;

# SteamEmu_Prefix1 (int)
# STEAM_a:b:c
# first prefix (a) for authids generated by SteamEmu
SteamEmu_Prefix1 = 0;

# SteamEmu_Prefix1 (int)
# STEAM_a:b:c
# first prefix (a) for authids assigned for AVSMP Clients (Cracked steam)
AVSMP_Prefix1 = 0;

# Setti_Prefix1 (int)
# STEAM_a:b:c
# first prefix (a) for authids assigned for Setti server scanner
Setti_Prefix1 = 0;

# SXEI_Prefix1 (int)
# STEAM_a:b:c
# first prefix (a) for authids assigned for sXeI clients
SXEI_Prefix1 = 0;


# Note that banid will use steamid WITHOUT any prefixes!


# ========================================================
# 		ATTACKS SUPRESSION
# ========================================================

# FakePlayers_ConnectInitiationCheck (seconds)
# Sets the time, in seconds, in which client should initiate
# game session (in other words, send the "new" command) after it has
# been connected. If client did not initiated game session, it will be marked as
# fake and kicked.
#   Default is 6 seconds.
#   Use 0 to disable this check.
FakePlayers_ConnectInitiationCheck = 6

# FakePlayers_ClientValidationCheck (seconds)
# Sets the time, in seconds, in which client should answer to random unique command
# sent by the server. If client did not answered for this command, it will be marked as
# fake and kicked.
#   Default is 8 seconds.
#   Use 0 to disable this check.
FakePlayers_ClientValidationCheck = 8

# FakePlayers_AntiReconnect (0/1)
# Enables detection of fakeplayers that reconnects quickly (every < 10 seconds)
# before fake players checks have completed.
# This check will work only if FakePlayers_ClientValidationCheck and
# FakePlayers_ConnectInitiationCheck are enabled.
#   Default is 1 (ON).
FakePlayers_AntiReconnect = 1

# FakePlayers_CommandsOrderCheck (0/1)
# Enable commands order checking on the start of initiated connection.
#   Default is 1 (ON).
FakePlayers_CommandsOrderCheck = 1

# FakePlayers_BanTime (minutes)
# Dproto will ban IP spamming fakeplayers for time (in minutes) specified in this variable
#   Default is 120 minutes.
#   Use 0 for permanent ban.
#   Use negative vaules to disable ban (fake players will only be kicked).
FakePlayers_BanTime = 120

# Exploits_CheckDownloads (0/1)
# Enable checking of requested download files against precached resources.
#   Default is 1 (ON).
Exploits_CheckDownloads = 1

# Exploits_DisableUploads (0/1)
# Disable file uploads (not customizations) to the server.
#   Default is 1 (ON).
Exploits_DisableUploads = 1


# ========================================================
# 		OTHER STUFF
# ========================================================

# LoggingMode:
#   0 = None
#   1 = Console
#   2 = Log Files
#   3 = Both
LoggingMode = 2

# ThreatsLoggingMode
# Enable logging of threats details.
#   Default is 0 (OFF).
ThreatsLoggingMode = 0

# DisableNativeAuth (0/1)
# Disables valve/steam auth system.
#   For p.47 Based: Server will not connect to auth servers.
#   For All: Server will not call authorization functions.
# This is a fix for startup freeze for old (p.47) servers.
DisableNativeAuth = 0

# ServerInfoAnswerType (0/1/2)
# Sets server answer type for query requests
#   0 = New style (Source Engine)
#   1 = Old Style (Fix favorites list for p.47 clients)
#   2 = Hybrid mode - Server is visible anywhere, but there are 3 packets generated for every serverinfo request
ServerInfoAnswerType = 2

# Game_Name (string)
# Sets game name displayed for clients
# If Game_Name is empty, native game name will be used
Game_Name = JAILBREAK

# Enables fix for proper player id displaying on HLStats server monitoring
# Enable this only if you have HLStats
HLStatsPlayerIdFix = 0

# ExportVersion (0 / 1)
# Enables/Disables exporting of dp_version cvar
#   1 = dp_version cvar will be exported to server rules. It will be visible in server monitoring tools (like HLSW)
#   0 = dp_version cvar will not be exported to server rules.
ExportVersion = 1

# HLTVExcept_IP (ip addr)
# HLTV from this IP will be able to join the server even if cid_HLTV is set to 5 (deprecated)
HLTVExcept_IP = 127.0.0.1