/*================================================================================
=
= Plugin: Time Bonus
= Version: 1.0
= Version mod: Public
=
=
= Description:
= - This is plugin add in game presents.
= Presents are given every 3 min, 5 min, 10 min, 20 min, 30 min, 1 hour.
=
= Defaults:
= 3 min - 3000 $
= 5 min - 5000 $
= 10 min - 3000 $
= 20 min - 5000 $
= 30 min - 10000 $
= 60 min - 16000 $
=================================================================================*/
#include <amxmodx>
#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(180.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)
client_printcolor(id, "^4[Time Bonus] ^1Вы получили ^4%d $^1, играя на нашем сервере^4 3 минуты.", SMALL)
}
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()
}
}
}
я не знаю как файл скинуть вам. вот что написано в сма