/*===============================================================================
=
=
= Plugin: Time Present's
= Version: 0.2
= Version mod: Public
=
=
= Description:
= - This is plugin add in game presents.
= Presents are given every 3 min, 5 min, 10 min.
=
= Defaults:
= 5 min - 500 $
= 10 min - 1000 $
= 15 min - 5000 $
=
=
================================================================================
=*/
#include <amxmodx>
#include <cstrike>
/*===============================================================================
=
[Macros]
================================================================================
=*/
#define SMALL 500
#define AVERAGE 1000
#define LARGE 2000
#define LOVE 3000
#define MM 4000
#define LSS 5000
/*===============================================================================
=
[Plugin Init]
================================================================================
=*/
public plugin_init()
{
register_plugin("Time present", "0.2", "Я и мы, да мы с тобой :)")
}
/*===============================================================================
=
[Set Tasks]
================================================================================
=*/
public client_putinserver(id)
{
set_task(600.0, "small_present", id)
set_task(1200.0, "average_present", id)
set_task(1800.0, "large_present", id)
set_task(2400.0, "love_present", id)
set_task(3000.0, "mm_present", id)
set_task(3600.0, "lss_present", id)
}
/*===============================================================================
=
[Remove Task]
================================================================================
=*/
public client_disconnect(id)
{
if(task_exists(id))
remove_task(id)
}
/*===============================================================================
=
[Give Presents]
================================================================================
=*/
public small_present(id)
{
cs_set_user_money(id, min(cs_get_user_money(id) + SMALL, 16000), 1)
client_printcolor(id, "^4[Подарок] ^1Вы получили ^4%d $^1, играя на нашем сервере^4 10 минут.", SMALL)
}
public average_present(id)
{
cs_set_user_money(id, min(cs_get_user_money(id) + AVERAGE, 16000), 1)
client_printcolor(id, "^4[Подарок] ^1Вы получили ^4%d $^1, играя на нашем сервере^4 20 минут.", AVERAGE)
}
public large_present(id)
{
cs_set_user_money(id, min(cs_get_user_money(id) + LARGE, 16000), 1)
client_printcolor(id, "^4[Подарок] ^1Вы получили ^4%d $^1, играя на нашем сервере^4 30 минут.", LARGE)
}
public large_present(id)
{
cs_set_user_money(id, min(cs_get_user_money(id) + LOVE, 16000), 1)
client_printcolor(id, "^4[Подарок] ^1Вы получили ^4%d $^1, играя на нашем сервере^4 40 минут.", LARGE)
}
public large_present(id)
{
cs_set_user_money(id, min(cs_get_user_money(id) + MM, 16000), 1)
client_printcolor(id, "^4[Подарок] ^1Вы получили ^4%d $^1, играя на нашем сервере^4 50 минут.", LARGE)
}
public large_present(id)
{
cs_set_user_money(id, min(cs_get_user_money(id) + LSS, 16000), 1)
client_printcolor(id, "^4[Подарок] ^1Вы получили ^4%d $^1, играя на нашем сервере^4 1 час=)", LARGE)
}
/*===============================================================================
=
[Stock]
================================================================================
=*/
stock client_printcolor(const id, const input[], any:...)
{
new iCount = 1, iPlayers[32]
static szMsg[191]
vformat(szMsg, charsmax(szMsg), input, 3)
replace_all(szMsg, 190, "/g", "^4")
replace_all(szMsg, 190, "/y", "^1")
replace_all(szMsg, 190, "/ctr", "^1")
replace_all(szMsg, 190, "/w", "^0")
if(id) iPlayers[0] = id
else get_players(iPlayers, iCount, "ch")
for (new i = 0; i < iCount; i++)
{
if(is_user_connected(iPlayers[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, iPlayers[i])
write_byte(iPlayers[i])
write_string(szMsg)
message_end()
}
}
}