/* AMX Mod X - Script
* Copyright © 2014 AMX-X - L]Ep6Ep.
* https://vk.com/amxx.scripts
*
* 29.12.18 beta - обновить .amxx файл
* [!] Исправили квар fpr_time
* [!] Исправили чат-сообщение, теперь не спамит
*
* BETA 1.0
* [#] - релиз
*/
#include <amxmodx>
#include <cstrike>
#include <fakemeta_util>
#include <hamsandwich>
#if AMXX_VERSION_NUM < 183
#include <colorchat>
#endif
new firstsplayers, firstsplayerr, cvar_round, cvar_money,
cvar_players, cvar_te, cvar_ct, cvar_timegod, Curret_Round, cvar_time1, cvar_time2;
public plugin_init() {
register_plugin("FirstPlayersRespawn", "29.12.18 beta", "L]Ep6Ep.")
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
register_event("TextMsg", "event_game_restart", "a", "2=#Game_will_restart_in")
register_event("TextMsg", "event_game_restart", "a", "2=#Game_Commencing")
}
public plugin_cfg() {
server_cmd("exec addons/amxmodx/configs/FirstPlayersRespawn.cfg")
cvar_te = register_cvar("fpr_players_t", "2")
cvar_ct = register_cvar("fpr_players_ct", "2")
cvar_time1 = register_cvar("fpr_time", "30")
cvar_round = register_cvar("fpr_firstround", "1")
cvar_players = register_cvar("fpr_minplayers", "10")
cvar_timegod = register_cvar("fpr_protection", "3")
cvar_money = register_cvar("fpr_money", "650")
cvar_time2 = register_cvar("fpr_time_death", "3")
}
public client_death(killer, victim) {
if(Curret_Round < get_pcvar_num(cvar_round) || get_playersnum() < get_pcvar_num(cvar_players)) {
if(firstsplayers < get_pcvar_num(cvar_te)) {
if(get_user_team(victim) == 1) {
firstsplayers++
set_task(get_pcvar_float(cvar_time2), "respawn", victim)
client_print_color(victim, print_team_default, "^1[^4SPAWN^1] ^3Первые ^4%d ^3игрока возрождаются", get_pcvar_num(cvar_te))
}
}
if(firstsplayerr < get_pcvar_num(cvar_ct)) {
if(get_user_team(victim) == 2) {
firstsplayerr++
set_task(get_pcvar_float(cvar_time2), "respawn", victim)
client_print_color(victim, print_team_default, "^1[^4SPAWN^1] ^3Первые ^4%d ^3игрока возрождаются", get_pcvar_num(cvar_ct))
}
}
}
}
public respawn(id) {
ExecuteHamB(Ham_CS_RoundRespawn, id)
cs_set_user_money(id, cs_get_user_money(id) + get_pcvar_num(cvar_money))
fm_set_user_godmode(id, 1)
set_task(get_pcvar_float(cvar_timegod), "offgodmod", id)
}
public offgodmod(id)
fm_set_user_godmode(id, 0)
public event_game_restart()
Curret_Round = 0
public event_round_start() {
firstsplayers = 0
firstsplayerr = 0
Curret_Round++
set_task(get_pcvar_float(cvar_time1), "first_off")
}
public first_off() {
firstsplayerr++
firstsplayers++
}
/* Copyright © 2014 AMX-X - L]Ep6Ep. */