1. Chodzi o to że jak testowalem sobie na serwerze z botami, i wybralem klase medyk i uzylem zaraz na poczatku rundy apteczki, a tu szok w promieniu apteczki wszystkich z druzyny zabilo co jest?
public StworzApteczke(id)
{
if (!ilosc_apteczek_gracza[id])
{
client_print(id, print_center, "Masz tylko 2 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 = 5+floatround(inteligencja_gracza[id]*0.5);
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() + 1.5);
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, kRenderFxNone, 255,255,255, kRenderTransAlpha, 100 ) ;
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;
}
2. Próbowalem dodać do rakiety fireballa takiego jak na ss

ale nie wyszlo, prosil bym o dodanie

public StworzRakiete(id)
{
if (!ilosc_rakiet_gracza[id])
{
client_print(id, print_center, "Wykrzystales juz wszystkie rakiety!");
return PLUGIN_CONTINUE;
}
if(poprzednia_rakieta_gracza[id] + 2.0 > get_gametime())
{
client_print(id, print_center, "Rakiet mozesz uzywac co 2 sekundy!");
return PLUGIN_CONTINUE;
}
if (is_user_alive(id))
{
if(inteligencja_gracza[id] < 1)
client_print(id, print_center, "Aby wzmocnic rakiete, zwieksz inteligencje!");
poprzednia_rakieta_gracza[id] = get_gametime();
ilosc_rakiet_gracza[id]--;
new Float: Origin[3], Float: vAngle[3], Float: Velocity[3];
entity_get_vector(id, EV_VEC_v_angle, vAngle);
entity_get_vector(id, EV_VEC_origin , Origin);
new Ent = create_entity("info_target");
entity_set_string(Ent, EV_SZ_classname, "Rocket");
entity_set_model(Ent, "models/rpgrocket.mdl");
vAngle[0] *= -1.0;
entity_set_origin(Ent, Origin);
entity_set_vector(Ent, EV_VEC_angles, vAngle);
entity_set_int(Ent, EV_INT_effects, 2);
entity_set_int(Ent, EV_INT_solid, SOLID_BBOX);
entity_set_int(Ent, EV_INT_movetype, MOVETYPE_FLY);
entity_set_edict(Ent, EV_ENT_owner, id);
VelocityByAim(id, 1000 , Velocity);
entity_set_vector(Ent, EV_VEC_velocity ,Velocity);
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(22)
write_short(Ent)
write_short(sprite_beam)
write_byte(45)
write_byte(4)
write_byte(255)
write_byte(0)
write_byte(0)
write_byte(25)
message_end()
}
return PLUGIN_CONTINUE;
}
public PolozDynamit(id)
{
if(!ilosc_dynamitow_gracza[id])
{
client_print(id, print_center, "Wykorzystales juz caly dynamit!");
return PLUGIN_CONTINUE;
}
if(inteligencja_gracza[id] < 1)
client_print(id, print_center, "Aby wzmocnic dynamit, zwieksz inteligencje!");
ilosc_dynamitow_gracza[id]--;
new Float:fOrigin[3], iOrigin[3];
entity_get_vector( id, EV_VEC_origin, fOrigin);
iOrigin[0] = floatround(fOrigin[0]);
iOrigin[1] = floatround(fOrigin[1]);
iOrigin[2] = floatround(fOrigin[2]);
message_begin(MSG_BROADCAST,SVC_TEMPENTITY, iOrigin);
write_byte(TE_EXPLOSION);
write_coord(iOrigin[0]);
write_coord(iOrigin[1]);
write_coord(iOrigin[2]);
write_short(sprite_blast);
write_byte(32);
write_byte(20);
write_byte(0);
message_end();
message_begin( MSG_BROADCAST, SVC_TEMPENTITY, iOrigin );
write_byte( TE_BEAMCYLINDER );
write_coord( iOrigin[0] );
write_coord( iOrigin[1] );
write_coord( iOrigin[2] );
write_coord( iOrigin[0] );
write_coord( iOrigin[1] + 300 );
write_coord( iOrigin[2] + 300 );
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( 8 ); // speed
message_end();
new entlist[33];
new numfound = find_sphere_class(id, "player", 300.0 , entlist, 32);
for (new i=0; i < numfound; i++)
{
new pid = entlist[i];
if (!is_user_alive(pid) || get_user_team(id) == get_user_team(pid) || informacje_przedmiotu_gracza[pid][0] == 24)
continue;
ExecuteHam(Ham_TakeDamage, pid, 0, id, 90.0+float(inteligencja_gracza[id]) , 1);
}
return PLUGIN_CONTINUE;
}