Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <fakemeta>
- #define OFFSET_CSMONEY 115
- public plugin_init() {
- register_plugin("Respawn for money", "1.0", "Seroff");
- register_clcmd("say /respawn", "RespawnMoney");
- }
- public RespawnMoney(id)
- {
- new money = cs_get_user_money(id);
- new name[32];
- get_user_name(id, name, 31);
- if(!is_user_alive(id))
- {
- if(money < 1000)
- {
- ColorChat(id, "^1[^4Respawn^1] У Вас недостаточно средств для того чтобы воскреситься!")
- } else {
- cs_set_user_money(id, money - 1000);
- cs_user_spawn(id);
- ColorChat(0, "^1[^4Respawn^1] Игрок ^4%s ^1воскресился!", name);
- }
- } else {
- ColorChat(id, "^1[^4Respawn^1] Вы живы!")
- return PLUGIN_HANDLED;
- }
- return PLUGIN_HANDLED;
- }
- stock ColorChat(const id, const input[], any:...)
- {
- new count = 1, players[32]
- static msg[191]
- vformat(msg, 190, input, 3)
- replace_all(msg, 190, "!g", "^4") // Зелёный
- replace_all(msg, 190, "!n", "^1") // Стандартный
- replace_all(msg, 190, "!t", "^3") // Цвет команды
- 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, get_user_msgid("SayText"), _, players[i])
- write_byte(players[i]);
- write_string(msg);
- message_end();
- }
- }
- }
- }
- /* cstrike stock`s generated using fakemeta */
- stock cs_user_spawn(id) {
- set_pev(id, pev_deadflag, DEAD_RESPAWNABLE)
- dllfunc(DLLFunc_Spawn, id)
- set_pev(id, pev_iuser1, 0)
- }
- stock cs_set_user_money(index, money, flash = 1)
- {
- set_pdata_int(index, OFFSET_CSMONEY, money)
- message_begin(MSG_ONE, get_user_msgid("Money"), _, index)
- write_long(money)
- write_byte(flash ? 1 : 0)
- message_end()
- }
- stock cs_get_user_money(index)
- {
- return get_pdata_int(index, OFFSET_CSMONEY)
- }
Add Comment
Please, Sign In to add comment