Код
#include <amxmodx>
#include <cstrike>
/*===============================================================================
=
[Macros]
================================================================================
=*/
#define GIVE_FLAGS ADMIN_LEVEL_H // Выдаваемые флаги
/*===============================================================================
=
[Plugin Init]
================================================================================
=*/
public plugin_init()
{
register_plugin("Time Bonus ViP", "1.1", "7RG")
}
/*===============================================================================
=
[Set Tasks]
================================================================================
=*/
public client_putinserver(id)
{
set_task(180.0, "vip_add", id)
}
/*===============================================================================
=
[Remove Task]
================================================================================
=*/
public client_disconnect(id)
{
if(task_exists(id))
remove_task(id)
}
/*===============================================================================
=
[Give Presents]
================================================================================
=*/
public vip_add(id)
{
set_user_flags(id,GIVE_FLAGS)
client_printcolor(id, "^4[Time Bonus ViP] ^1Вы получили ^4ViP^1, играя на нашем сервере^4 3 минуты.")
}
/*===============================================================================
=
[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()
}
}
}