public StworzApteczke(id)
{
if (!ilosc_apteczek_gracza[id])
{
client_print(id, print_center, "Mozesz uzyc tylko jednej apteczki na runde!");
return PLUGIN_CONTINUE;
}
if(inteligencja_gracza[id] < 1)
client_print(id, print_center, "Aby wzmocnic apteczke, zwieksz inteligencje!");
ilosc_apteczek_gracza[id]--;
new Float:origin[3];
entity_get_vector(id, EV_VEC_origin, origin);
new ent = create_entity("info_target");
entity_set_string(ent, EV_SZ_classname, "Apteczka");
entity_set_edict(ent, EV_ENT_owner, id);
entity_set_int(ent, EV_INT_solid, SOLID_NOT);
entity_set_vector(ent, EV_VEC_origin, origin);
entity_set_float(ent, EV_FL_ltime, halflife_time() + 7 + 0.1);
entity_set_model(ent, "models/w_medkit.mdl");
set_rendering ( ent, kRenderFxGlowShell, 255,0,0, kRenderFxNone, 255 ) ;
drop_to_floor(ent);
entity_set_float(ent, EV_FL_nextthink, halflife_time() + 0.1);
return PLUGIN_CONTINUE;
}
public ApteczkaThink(ent)
{
new id = entity_get_edict(ent, EV_ENT_owner);
new totem_dist = 300;
new totem_heal = 25;
if (entity_get_edict(ent, EV_ENT_euser2) == 1)
{
new Float:forigin[3], origin[3];
entity_get_vector(ent, EV_VEC_origin, forigin);
FVecIVec(forigin,origin);
new entlist[33];
new numfound = find_sphere_class(0,"player",totem_dist+0.0,entlist, 32,forigin);
for (new i=0; i < numfound; i++)
{
new pid = entlist[i];
if (get_user_team(pid) != get_user_team(id))
continue;
new zdrowie = get_user_health(pid);
new nowe_zdrowie = (zdrowie+totem_heal<maksymalne_zdrowie_gracza[pid])?zdrowie+totem_heal:maksymalne_zdrowie_gracza[pid];
if (is_user_alive(pid)) set_user_health(pid, nowe_zdrowie);
}
entity_set_edict(ent, EV_ENT_euser2, 0);
entity_set_float(ent, EV_FL_nextthink, halflife_time() + 0.6);
return PLUGIN_CONTINUE;
}
if (entity_get_float(ent, EV_FL_ltime) < halflife_time() || !is_user_alive(id))
{
remove_entity(ent);
return PLUGIN_CONTINUE;
}
if (entity_get_float(ent, EV_FL_ltime)-2.0 < halflife_time())
set_rendering ( ent, kRenderFxGlowShell, 255,0,0, kRenderFxNone, 255 );
new Float:forigin[3], origin[3];
entity_get_vector(ent, EV_VEC_origin, forigin);
FVecIVec(forigin,origin);
//Find people near and give them health
message_begin( MSG_BROADCAST, SVC_TEMPENTITY, origin );
write_byte( TE_BEAMCYLINDER );
write_coord( origin[0] );
write_coord( origin[1] );
write_coord( origin[2] );
write_coord( origin[0] );
write_coord( origin[1] + totem_dist );
write_coord( origin[2] + totem_dist );
write_short( sprite_white );
write_byte( 0 ); // startframe
write_byte( 0 ); // framerate
write_byte( 10 ); // life
write_byte( 10 ); // width
write_byte( 255 ); // noise
write_byte( 255 ); // r, g, b
write_byte( 100 );// r, g, b
write_byte( 100 ); // r, g, b
write_byte( 128 ); // brightness
write_byte( 5 ); // speed
message_end();
entity_set_edict(ent, EV_ENT_euser2 ,1);
entity_set_float(ent, EV_FL_nextthink, halflife_time() + 0.5);
return PLUGIN_CONTINUE;
}Mam taki problem: Powyższy kod przedstawia moja apteczke (totem leczacy) wszystko ladnie dziala totem leczy, ale jak wlaczylem podbot zeby przetestowac apteczke to gdy ja wlaczylem to bedace w jej zasiegu podboty od razu padly trupem. Wie ktos co jest zle w tym kodzie ze tak sie dzieje. Mam wewnetrzne IP wiec nie mam jak inaczej sprawdzic , tylko na podbot. Czy jeśli boty mi zabija w ten sposob to graczy na serwerze tez tak bedzie??
Z góry dziękuję za pomoc.


Dodatki SourceMod



Temat jest zamknięty








