Код:
#include <amxmodx>
#include <hamsandwich>
#include <fun>
#include <cstrike>
public plugin_init()
{
#define VERSION "0.1"
register_plugin("Steam Bonus", VERSION, "Realution");
RegisterHam(Ham_Spawn, "player", "H_Spawn", 1);
}
public H_Spawn(id)
{
if(is_user_alive(id) && is_user_steam(id))
{
new Money = cs_get_user_money(id);
give_item(id, "weapon_deagle");
give_item(id, "item_assaultsuit");
give_item(id, "item_thighpack");
give_item(id, "weapon_hegrenade");
give_item(id, "weapon_flashbang");
cs_set_user_bpammo(id, CSW_FLASHBANG, 2);
cs_set_user_money(id, Money + 1000);
ChatColor(id, "^4[SteamBonus] ^1Вы получили бонус ^4щипцы, гранаты, дигл, броню, деньги ^1за ^3STEAM^1.");
}
return PLUGIN_HANDLED;
}
stock bool:is_user_steam(id)
{
static dp_pointer;
if(dp_pointer || (dp_pointer = get_cvar_pointer("dp_r_id_provider")))
{
server_cmd("dp_clientinfo %d", id);
server_exec();
return (get_pcvar_num(dp_pointer) == 2) ? true : false;
}
return false;
}
stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4") // Green Color
replace_all(msg, 190, "!y", "^1") // Default Color
replace_all(msg, 190, "!team", "^3") // Team Color
replace_all(msg, 190, "!team2", "^0") // Team2 Color
if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
write_byte(players[i])
write_string(msg)
message_end()
}
}
}
}