"Но все още не компилира"
Код за потвърждение: Избери целия код
#include < amxmodx >
#include < amxmisc >
#include < hamsandwich >
#include < cstrike >
#include < fakemeta >
public client_putinserver(id) {
if (get_user_team(id) == CS_TEAM_CT) {
set_pdata_int(id, "knife_hits", 0);
}
}
public client_damage(id, damage, attacker, weapon, hp, ap) {
if (!is_user_connected(id) || !is_user_connected(attacker) || id == attacker)
return PLUGIN_CONTINUE;
if (is_user_alive(id) && is_user_alive(attacker) && get_user_team(id) == CS_TEAM_CT && get_user_team(attacker) == CS_TEAM_T) {
if (weapon == CSW_KNIFE) {
new hits = get_pdata_int(attacker, "knife_hits");
hits++;
if (hits >= 2) {
cs_set_user_team(id, CS_TEAM_T, true, true);
client_cmd(id, "say_team You were switched to the T team for getting knifed twice by a T player.");
}
set_pdata_int(attacker, "knife_hits", hits);
}
}
return PLUGIN_CONTINUE;
}