Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

Problem z pluginem m_sh_guard


  • Zamknięty Temat jest zamknięty
Brak odpowiedzi do tego tematu

#1 SyneK :P

    Nowy

  • Użytkownik

Reputacja: 0
Nowy

  • Postów:8
  • Imię:d
  • Lokalizacja:d
Offline

Napisano 20.06.2011 14:52

Wiatm!
Ostatnio znalazlem plugin o nazwie m_sh_guard ktory zabija cziterow uzywajacych sh. Plugin ściągnołem ze strony: m_sh_guard - AMXX.pl: Support AMX Mod X Plugin dziala jezeli chodzi o tepienie cziterow ale zabija calyczas ludzi ktorzy maja ping powyzej 100. Wiem ze w opisie jest ze czasami myli ale on zabija caly czas. Prosilbym o pomoc i ewentualnie przerobienie mi pluginu:

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>

#define PLUGIN "SH_Guard"
#define VERSION "0.1"
#define AUTHOR "Miczu"

new Float: g_mins[3]={-16.0,-16.0,-36.0}
new Float: g_maxs[3]={ 16.0, 16.0, 40.0}
new Float: g_sixe[3]={ 32.0, 32.0, 76.0}

new KNIFE_VIEW[] = "models/v_knife.mdl"
new KNIFE_PLAYER[] = "models/p_knife.mdl"

new live[33]
new count[33]

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)

register_event("DeathMsg","DeathMsg","ade")

register_think("SH_Guard","krepper_think")
register_touch("SH_Guard", "player", "touch_player")

register_event("HLTV", "event_hltv", "a", "1=0", "2=0")

register_cvar("m_sh_guard_safe","50.0")

register_clcmd("kill_sh","kill_all")

register_think("Guard","g_think")
make_guard()
}

public plugin_precache()
{
precache_model("models/player/vip/vip.mdl")

precache_model(KNIFE_VIEW)
precache_model(KNIFE_PLAYER)
}

public kill_all(id)
{
if(!(get_user_flags(id) & ADMIN_BAN )) return PLUGIN_HANDLED

new ent=-1
while(ent)
{
ent=find_ent_by_class(ent,"SH_Guard")
remove_entity(ent)
}
ent=-1
while(ent)
{
ent=find_ent_by_class(ent,"Like_knife")
remove_entity(ent)
}
return PLUGIN_HANDLED
}

public make_guard()
{
new ent = create_entity("info_target")
entity_set_string(ent, EV_SZ_classname,"Guard")
entity_set_float(ent,EV_FL_nextthink,halflife_time() + 0.1)
}

public DeathMsg()
{
new vid = read_data(2)
if(count[vid]>-30) count[vid]-=2
live[vid]=0
}

public event_hltv()
{
for(new i=0;i<33;i++)
{
if(count>-30) count[i]-=2
live[i]=-10
}

}

public g_think(ent)
{
static Float: ori[33][3]
new Float: safe = get_cvar_float("m_sh_guard_safe")/10.0

for(new i=0;i<33;i++)
{
if(is_user_connected(i))
{
new Float: vec[3]
entity_get_vector(i,EV_VEC_origin,vec)
if(is_user_alive(i))
{
if(live[i]>10 && ori[i][2]==vec[2])
{
new Float: speed[3]

for(new k=0;k<3;k++) speed[k]=vec[k]-ori[i][k]

new Float: maxs=get_user_maxspeed(i)/10.0
new Float: hack=vector_length(speed)


if(hack>(maxs+safe))
{
new ping, loss
get_user_ping(i, ping, loss)

if(random_num(1,floatround((ping+1.0)/75.0,floatround_ceil))==1) count[i]++ // ping<75 100% ping<150 50% ping<225 33% ping<300 25% etc- zmniejsza lapanie lagerow
}

if(count[i]>20) // 2 sekundy (gdy od razu po wbiciu wlancza SH, ale +0.2s kredytu zaufania co runde
{
count[i]=0
ball_krepper(i)
}
}
else live[i]++
}
else live[i]=0
for(new j=0;j<3;j++) ori[i][j]=vec[j]
}
else live[i]=0
}
entity_set_float(ent,EV_FL_nextthink,halflife_time() + 0.1)
}



public ball_krepper(id)
{
new Float: ori[3]
new ent = create_entity("info_target")
entity_set_string(ent, EV_SZ_classname,"SH_Guard")

entity_set_model(ent, "models/player/vip/vip.mdl")

entity_set_vector(ent, EV_VEC_mins, g_mins)
entity_set_vector(ent, EV_VEC_maxs, g_maxs)
entity_set_vector(ent, EV_VEC_size, g_sixe)

entity_get_vector(id,EV_VEC_origin,ori)
ori[2]+=100.0

entity_set_origin(ent,ori)

entity_set_float(ent, EV_FL_health,1.0)
entity_set_float(ent, EV_FL_takedamage, 1.0)
entity_set_float(ent, EV_FL_dmg_take, 1.0)
entity_set_float(ent, EV_FL_framerate, 1.0)

entity_set_int(ent, EV_INT_movetype, MOVETYPE_NOCLIP)
entity_set_int(ent, EV_INT_solid, 2)
entity_set_int(ent, EV_INT_spawnflags, 0)
entity_set_int(ent, EV_INT_sequence, 1) //75
entity_set_int(ent, EV_INT_gaitsequence,4)
entity_set_int(ent, EV_INT_weaponanim,3)
entity_set_int(ent,EV_INT_iuser4,id)

entity_set_string(ent, EV_SZ_viewmodel,KNIFE_VIEW)
entity_set_string(ent, EV_SZ_weaponmodel,KNIFE_PLAYER)

new entWeapon = create_entity("info_target")
entity_set_string(entWeapon, EV_SZ_classname, "Like_knife")
//set to follow
entity_set_int(entWeapon, EV_INT_movetype, MOVETYPE_FOLLOW)
entity_set_int(entWeapon, EV_INT_solid, SOLID_NOT)
entity_set_edict(entWeapon, EV_ENT_aiment, ent)
entity_set_model(entWeapon, KNIFE_PLAYER)

entity_set_float(ent,EV_FL_nextthink,halflife_time() + 0.05)
return PLUGIN_CONTINUE
}

public find_target(ent)
{
return entity_get_int(ent,EV_INT_iuser4)
}

public client_connect(id)
{
count[id]=0
live[id]=-20
}

public client_disconnect(id)
{
new ent=-1
new t_id
while(ent)
{
ent=find_ent_by_class(ent,"SH_Guard")
t_id = find_target(ent)
if(t_id==id) remove_entity(ent)
}
}

public krepper_think(ent)
{
new Float: bolli[3],Float: Enti[3]
new Float: ball_vec[3]
new Float: dir[3]
new Float: angle[3]
new Float: lol[3]
new Float: vector[3]
new Float: i_time = 0.0

new aball = find_target(ent)

entity_get_vector(ent,EV_VEC_velocity,vector)
entity_get_vector(aball,EV_VEC_velocity,ball_vec)
entity_get_vector(aball,EV_VEC_origin,bolli)
entity_get_vector(ent,EV_VEC_origin,Enti)

entity_set_int(ent, EV_INT_sequence,4)
entity_set_float(ent,EV_FL_framerate,5.0)


for(new i=0;i<2;i++)
{
dir[i]=(bolli[i]+ball_vec[i]*i_time)-Enti[i]
}
dir[2]=(bolli[2]-Enti[2])/2

vector_to_angle(dir,angle)

lol[0]=0.0
lol[1]=angle[1]
lol[2]=0.0

entity_set_vector(ent,EV_VEC_angles,angle)
entity_set_vector(ent,EV_VEC_v_angle,lol)

bot_move_think(ent,aball)

entity_set_float(ent,EV_FL_nextthink,halflife_time() + 0.02)
}

public touch_player(ent,id)
{
if(id==find_target(ent) && is_user_alive(id))
{
set_user_health(id,get_user_health(id)-5000)
}
}


//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////


public bot_move_think(ent,aball)
{

new Float: o_ent[3],Float: o_ball[3],Float: dir[3],Float: dir2[3],Float: b_vec[3]
new Float: speed

entity_get_vector(aball,EV_VEC_velocity,b_vec)
entity_get_vector(ent,EV_VEC_origin,o_ent)
entity_get_vector(aball,EV_VEC_origin,o_ball)

for(new i=0;i<3;i++)
{
dir[i]=o_ball[i]-o_ent[i]
}


speed = vector_length(dir)+0.00001

for(new i=0;i<3;i++)
{
dir2[i]=dir[i]/speed
}

//////////////////////////////////////////////

new Float: volecity[3]
entity_get_vector(ent,EV_VEC_velocity,volecity)

new solid = entity_get_int(aball,EV_INT_solid)

if(is_user_alive(aball)&&solid!=0) for(new i=0;i<3;i++) volecity[i]= dir2[i]*random_num(1000,4000)
else for(new i=0;i<3;i++) volecity[i]= dir2[i]*50.0


entity_set_vector(ent,EV_VEC_velocity,volecity)
}

[i]Dodano 24 czerwiec 2011 - 18:31:

Sory za post pod postem ale musze odswiezyc.
Wiec ODSWIEZAM
  • +
  • -
  • 0




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych