Код за потвърждение: Избери целия код
new const g_eHappyHour[][HappyHour] =
{
{ 8, 14, 2 },
{ 20, 23, 3 }
}
Код за потвърждение: Избери целия код
L 04/03/2022 - 09:15:52: Start of error session.
L 04/03/2022 - 09:15:52: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20220403.log")
L 04/03/2022 - 09:15:52: [FUN] Player out of range (0)
L 04/03/2022 - 09:15:52: [AMXX] Run time error 10 (plugin "happydust.amxx") (native "set_user_frags") - debug not enabled!
L 04/03/2022 - 09:15:52: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 04/03/2022 - 15:00:49: Start of error session.
L 04/03/2022 - 15:00:49: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20220403.log")
L 04/03/2022 - 15:00:49: [FUN] Player out of range (0)
L 04/03/2022 - 15:00:49: [AMXX] Run time error 10 (plugin "happydust.amxx") (native "set_user_frags") - debug not enabled!
L 04/03/2022 - 15:00:49: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 04/03/2022 - 21:25:12: Start of error session.
L 04/03/2022 - 21:25:12: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20220403.log")
L 04/03/2022 - 21:25:12: [FUN] Player out of range (0)
L 04/03/2022 - 21:25:12: [AMXX] Displaying debug trace (plugin "happydust.amxx", version "1.0")
L 04/03/2022 - 21:25:12: [AMXX] Run time error 10: native error (native "set_user_frags")
L 04/03/2022 - 21:25:12: [AMXX] [0] happydust.sma::OnPlayerKilled (line 66)
L 04/03/2022 - 22:06:43: [FUN] Player out of range (0)
L 04/03/2022 - 22:06:43: [AMXX] Displaying debug trace (plugin "happydust.amxx", version "1.0")
L 04/03/2022 - 22:06:43: [AMXX] Run time error 10: native error (native "set_user_frags")
L 04/03/2022 - 22:06:43: [AMXX] [0] happydust.sma::OnPlayerKilled (line 66)
Благодаря !
Код за потвърждение: Избери целия код
#include <amxmodx>
#include <fun>
#if AMXX_VERSION_NUM < 183
#include <fmt>
#endif
#define PLUGIN_VERSION "1.0"
enum _:HappyHour
{
Start,
End,
Frags
}
new const g_eHappyHour[][HappyHour] =
{
{ 7, 17, 2 },
{ 18, 19, 3 }
}
new g_iBonus
new g_iObject
new g_msgSayText
new g_szMessage[128]
new const g_szPrefix[] = "^4[HappyHour]^1"
public plugin_init()
{
register_plugin("Happy Hour", PLUGIN_VERSION, "OciXCrom @ amxx-bg.info/forum")
register_event("DeathMsg", "OnPlayerKilled", "a", "1>0", "2>0", "1!2")
register_logevent("OnRoundStart", 2, "1=Round_Start")
g_msgSayText = get_user_msgid("SayText")
g_iObject = CreateHudSyncObj()
OnRoundStart()
set_task(1.0, "DisplayMessage", .flags = "b")
}
public OnRoundStart()
{
g_iBonus = 0
copy(g_szMessage, charsmax(g_szMessage), "Igraite bez hackove!^n")
new iHour; time(iHour)
for(new i; i < sizeof(g_eHappyHour); i++)
{
if(g_eHappyHour[i][Start] <= iHour <= g_eHappyHour[i][End])
{
g_iBonus = g_eHappyHour[i][Frags]
ColorChat(0, "+%i points/frags!", g_iBonus)
break
}
}
for(new i; i < sizeof(g_eHappyHour); i++)
add(g_szMessage, charsmax(g_szMessage), fmt("Happy Hour%i: %s^n", i + 1, g_iBonus == g_eHappyHour[i][Frags] ? fmt("(ON)") : fmt("%i:00 do %i:00", g_eHappyHour[i][Start], g_eHappyHour[i][End])))
}
public OnPlayerKilled()
{
if(g_iBonus)
{
new iKiller = read_data(1)
set_user_frags(iKiller, get_user_frags(iKiller) + (g_iBonus - 1))
}
}
public DisplayMessage()
{
set_hudmessage(random(256), random(256), random(256), 0.02, 0.18, 1, 2.0, 1.0, 0.5, 1.0, -1)
ShowSyncHudMsg(0, g_iObject, g_szMessage)
}
ColorChat(const id, const szInput[], any:...)
{
new iPlayers[32], iCount = 1
static szMessage[191]
vformat(szMessage, charsmax(szMessage), szInput, 3)
format(szMessage[0], charsmax(szMessage), "%s %s", g_szPrefix, szMessage)
replace_all(szMessage, charsmax(szMessage), "!g", "^4")
replace_all(szMessage, charsmax(szMessage), "!n", "^1")
replace_all(szMessage, charsmax(szMessage), "!t", "^3")
if(id)
iPlayers[0] = id
else
get_players(iPlayers, iCount, "ch")
for(new i; i < iCount; i++)
{
if(is_user_connected(iPlayers[i]))
{
message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, iPlayers[i])
write_byte(iPlayers[i])
write_string(szMessage)
message_end()
}
}
}