Knife Only with Time

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 424
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 31 пъти
Получена благодарност: 3 пъти

Knife Only with Time

Мнение от lantimilan » 15 Фев 2019, 20:21

Hello i have and one request sometime we play after from 11 pm with knife in my public server but some players when connect hit with weapons and use bomb o4 , it is any possible to have one plugin to working with time 11pm to 3 am allow players to use just knife no weapons no pistol no bomb just knife and when players want to but weapons to have message you cant buy time its just for knife ?

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Knife Only with Time

Мнение от OciXCrom » 15 Фев 2019, 20:34

Buying weapons will be disabled and weapons won't deal any damage from 23:00 to 03:00.

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <cromchat>
#include <cstrike>
#include <hamsandwich>

#if !defined CS_OnBuyAttempt
	#error This plugin requires AMXX 1.9
#endif

#if !defined DMG_SLASH
	#define DMG_SLASH (1<<2)
#endif

#define KNIFE_START 23
#define KNIFE_END 3

new bool:g_bActive

public plugin_init()
{
	register_plugin("Knife Night", "1.0", "OciXCrom")
	register_logevent("OnRoundStart", 2, "0=World triggered", "1=Round_Start")
	RegisterHam(Ham_TakeDamage, "player", "PreTakeDamage", 0)
}

public OnRoundStart()
{
	if(!g_bActive && is_knife_night(KNIFE_START, KNIFE_END))
	{
		g_bActive = true
		client_print(0, print_chat, "^4*** ^3Knife night mode enabled: ^1weapons won't deal any damage ^4***")
	}
	else if(g_bActive)
	{
		g_bActive = false
		client_print(0, print_chat, "^4*** ^3Knife night mode disabled ^4***")
	}
}

public CS_OnBuyAttempt(id, iItem)
{
	if(is_knife_night(KNIFE_START, KNIFE_END))
	{
		client_print(id, print_center, "You can't buy any weapons from %i:00 to %i:00.", KNIFE_START, KNIFE_END)
		return PLUGIN_HANDLED
	}

	return PLUGIN_CONTINUE
}

public PreTakeDamage(iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits)
{
	if(is_knife_night(KNIFE_START, KNIFE_END))
	{
		return iDamageBits & DMG_SLASH ? HAM_IGNORED : HAM_SUPERCEDE
	}

	return HAM_IGNORED
}

bool:is_knife_night(const iStart, const iEnd)
{
    static iHour; time(iHour)
    return bool:(iStart < iEnd ? (iStart <= iHour < iEnd) : (iStart <= iHour || iHour < iEnd))
}

Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 424
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 31 пъти
Получена благодарност: 3 пъти

Knife Only with Time

Мнение от lantimilan » 15 Фев 2019, 21:17

Bro you are the best thanks very much

Заключено
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Заявки за плъгини”

Кой е на линия

Потребители разглеждащи този форум: Semrush [Bot] и 4 госта