Jak naprawić:1) znajdź "public Create
Sentry(id)"
2) znajdź linijkę "client_print(id, print_chat, "Jestes zbyt blisko BS'A");" dopisz pod nią "ilosc[id] = 1;"
3) znajdź linijkę "client_print(id, print_chat, "Jestes zbyt blisko Respa");" dopisz pod nią "ilosc[id] = 1;"
caly etytowany public powinien wyglądać tak:
public CreateSentry(id)
{
if(!(entity_get_int(id, EV_INT_flags) & FL_ONGROUND))
return;
new entlist[3];
if(find_sphere_class(id, "func_bomb_target", 650.0, entlist, 2))
{
client_print(id, print_chat, "Jestes zbyt blisko BS'A");
ilosc[id] = 1;
return;
}
if(find_sphere_class(id, "func_buyzone", 650.0, entlist, 2))
{
client_print(id, print_chat, "Jestes zbyt blisko Respa");
ilosc[id] = 1;
return;
}
new num, players[32], Float:Origin[3];
get_players(players, num, "gh");
for(new a = 0; a < num; a++)
{
new i = players[a];
if(get_user_team(id) != get_user_team(i))
client_cmd(i, "spk sound/mw/sentrygun_enemy.wav");
else
client_cmd(i, "spk sound/mw/sentrygun_friend.wav");
}
print_info(id, "Sentry Gun");
entity_get_vector(id, EV_VEC_origin, Origin);
Origin[2] += 45.0;
new health[12], ent = create_entity("func_breakable");
get_cvar_string("zycie_sentry",health, charsmax(health));
DispatchKeyValue(ent, "health", health);
DispatchKeyValue(ent, "material", "6");
entity_set_string(ent, EV_SZ_classname, "sentryG");
entity_set_model(ent, "models/sentrygun_mw2.mdl");
entity_set_float(ent, EV_FL_takedamage, DAMAGE_YES);
entity_set_size(ent, Float:{-16.0, -16.0, 0.0}, Float:{16.0, 16.0, 48.0});
entity_set_origin(ent, Origin);
entity_set_int(ent, EV_INT_solid, SOLID_SLIDEBOX);
entity_set_int(ent, EV_INT_movetype, MOVETYPE_TOSS);
entity_set_int(ent, EV_INT_iuser2, id);
entity_set_vector(ent, EV_VEC_angles, Float:{0.0, 0.0, 0.0});
entity_set_byte(ent, EV_BYTE_controller2, 127);
entity_set_float(ent, EV_FL_nextthink, get_gametime()+1.0);
sentrys[id] = false;
emit_sound(ent, CHAN_ITEM, "mw/plant.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
}
wersja naprawiona i wersja perk w załaczniku