=================================================================================*/
#include <amxmodx> // Èñïîëüçóåìûå ìîäóëè
#include <hamsandwich>
#include <cstrike>
/*================================================================================
[Macros]
=================================================================================*/
#define SMALL 1000
#define AVERAGE 1500
#define LARGE 3000
#define MAX 5000
#define PRO 10000
#define HARD 16000
/*================================================================================
[Plugin Init]
=================================================================================*/
public plugin_init()
{
register_plugin("Time Bonus", "1.1", "SKOBAR1K")
}
/*================================================================================
[Set Tasks]
=================================================================================*/
public client_putinserver(id)
{
set_task(10.0, "small_present", id)
set_task(300.0, "average_present", id)
set_task(600.0, "large_present", id)
set_task(1200.0, "max_present", id)
set_task(1800.0, "pro_present", id)
set_task(3600.0, "hard_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)
server_cmd("amx_givexp @all 300", get_user_userid(id))
client_printcolor(id, "^4[Time Bonus]Âû ïîëó÷èëè áîíóñ 1000$ è 300XP")
}
public average_present(id)
{
cs_set_user_money(id, min(cs_get_user_money(id) + AVERAGE, 16000), 1)
client_printcolor(id, "^4[Time Bonus] ^1Âû ïîëó÷èëè ^4%d $^1, èãðàÿ íà íàøåì ñåðâåðå^4 5 ìèíóò.", AVERAGE)
}
public large_present(id)
{
cs_set_user_money(id, min(cs_get_user_money(id) + LARGE, 16000), 1)
client_printcolor(id, "^4[Time Bonus] ^1Âû ïîëó÷èëè ^4%d $^1, èãðàÿ íà íàøåì ñåðâåðå^4 10 ìèíóò.", LARGE)
}
public max_present(id)
{
cs_set_user_money(id, min(cs_get_user_money(id) + MAX, 16000), 1)
client_printcolor(id, "^4[Time Bonus] ^1Âû ïîëó÷èëè ^4%d $^1, èãðàÿ íà íàøåì ñåðâåðå^4 20 ìèíóò.", MAX)
}
public pro_present(id)
{
cs_set_user_money(id, min(cs_get_user_money(id) + PRO, 16000), 1)
client_printcolor(id, "^4[Time Bonus] ^1Âû ïîëó÷èëè ^4%d $^1, èãðàÿ íà íàøåì ñåðâåðå^4 30 ìèíóò.", PRO)
}
public hard_present(id)
{
cs_set_user_money(id, min(cs_get_user_money(id) + HARD, 16000), 1)
client_printcolor(id, "^4[Time Bonus] ^1Âû ïîëó÷èëè ^4%d $^1, èãðàÿ íà íàøåì ñåðâåðå^4 1 ÷àñ.", HARD)
}
/*================================================================================
[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()
}
}
}