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
CoD Nowy

Limit hp dla klasy

cod nowy

  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
1 odpowiedź w tym temacie

#1 dziobax

    Zaawansowany

  • Użytkownik

Reputacja: 7
Nowy

  • Postów:145
  • GG:
  • Imię:Przemek
  • Lokalizacja:Piotrków Trybunalski
Offline

Napisano 24.01.2012 21:29

Witam, wiele szukalem an necie ale nie znalazlem nic pomocnego, chodzi mi o klase ktora posiada np 5 hp i przy rozdawaniu statystyk chciałbym aby nie zmianiala sie ilosc hp i nadal została np 5hp

Sma klasy: bo cos nie moge dodac załącznika

/* Plugin generated by AMXX-Studio */

#include
#include
#include
#include
#include
#include
#include
#include
#include

#define POKAZ_STATUS 2895
#define MINIMUM_FALL_SPEED 300
#define MAXIMUM_DAMAGE_FROM_JUMP 70.0

#define DAMAGE 30.0
#define DELAY 0.2

new const nazwa[] = "Assasin [VIP]";
new const opis[] = "Ma 20 nozy do rzucania, jest niewidzialny, po skoczeniu komus na glowe zabija go, nie slychac jego krokow, zostawia slady za soba.";
new const bronie = 1= get_user_health(Touched)){
zyje = false;
}
new origin[3];
get_user_origin(Touched,origin)
origin[2] += 25
if(zyje == true){
if(get_user_team(Touched) == get_user_team(kid))
{
new name[33]
get_user_name(kid,name,32)
client_print(0,print_chat,"%s attacked a teammate",name)
}
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(TE_BLOODSPRITE)
write_coord(origin[0])
write_coord(origin[1])
write_coord(origin[2])
write_short(blood2)
write_short(blood)
write_byte(229)
write_byte(25)
message_end()
set_user_health(Touched,get_user_health(Touched) - get_cvar_num("amx_knifedamage_mw2"));
emit_sound(Touched, CHAN_ITEM, "player/headshot1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
cod_inflict_damage(Toucher, Touched, 100.0, 1.0, 0, 0)
//cod_set_user_xp(kid, cod_get_user_xp(kid) + 100)
}

else
{
if(get_user_team(Touched) == get_user_team(kid)) {
set_user_frags(kid, get_user_frags(kid) - 1)
client_print(kid,print_center,"You killed a teammate")
}
else {
set_user_frags(kid, get_user_frags(kid) + 1)
cod_set_user_xp(kid, cod_get_user_xp(kid) + 10)
}

new gmsgScoreInfo = get_user_msgid("ScoreInfo")
new gmsgDeathMsg = get_user_msgid("DeathMsg")



message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(TE_BLOODSPRITE)
write_coord(origin[0])
write_coord(origin[1])
write_coord(origin[2])
write_short(blood2)
write_short(blood)
write_byte(229)
write_byte(25)
message_end()

set_msg_block(gmsgDeathMsg,BLOCK_ONCE)
set_msg_block(gmsgScoreInfo,BLOCK_ONCE)
user_kill(Touched,1)

message_begin(MSG_ALL,gmsgScoreInfo)
write_byte(kid)
write_short(get_user_frags(kid))
write_short(get_user_deaths(kid))
write_short(0)
write_short(get_user_team(kid))
message_end()

message_begin(MSG_ALL,gmsgScoreInfo)
write_byte(Touched)
write_short(get_user_frags(Touched))
write_short(get_user_deaths(Touched))
write_short(0)
write_short(get_user_team(Touched))
message_end()

message_begin(MSG_ALL,gmsgDeathMsg,{0,0,0},0)
write_byte(kid)
write_byte(Touched)
write_byte(0)
write_string("knife")
message_end()
emit_sound(Touched, CHAN_ITEM, "player/die1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
}
//usuwam noz
remove_entity(Toucher)
}
}

public paint_fire(id)
{
new ent = create_entity("info_target")
if (pev_valid(ent) && is_user_alive(id) && ma_klase[id] && noze[id] > 0)
{

new Float:vangles[3], Float:nvelocity[3], Float:voriginf[3], vorigin[3];

set_pev(ent, pev_owner, id);
set_pev(ent, pev_classname, "throw_knife");
engfunc(EngFunc_SetModel, ent, "models/w_throw.mdl");
set_pev(ent, pev_gravity, get_cvar_float("amx_knifegravity_mw2"));
set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0);
get_user_origin(id, vorigin, 1);

IVecFVec(vorigin, voriginf);
set_pev(ent,pev_origin,voriginf)

static Float:player_angles[3]
pev(id, pev_angles, player_angles)
player_angles[2] = 0.0
set_pev(ent, pev_angles, player_angles);

pev(id, pev_v_angle, vangles);
set_pev(ent, pev_v_angle, vangles);
pev(id, pev_view_ofs, vangles);
set_pev(ent, pev_view_ofs, vangles);

new veloc = get_cvar_num("amx_knifespeed_mw2")

set_pev(ent, pev_movetype, MOVETYPE_TOSS);
set_pev(ent, pev_solid, 2);
velocity_by_aim(id, veloc, nvelocity);

set_pev(ent, pev_velocity, nvelocity);
set_pev(ent, pev_effects, pev(ent, pev_effects) & ~EF_NODRAW);
set_pev(ent,pev_sequence,0)
set_pev(ent,pev_framerate,1.0)

entity_set_edict(ent, EV_ENT_owner, id)
noze[id]-= 1
}
return ent;
}

public Punch_View(id, Float:ViewAngle[3])
{
set_pev(id, pev_punchangle, ViewAngle)
}
public forward_touch(toucher, touched) // This function is called every time a player touches another player.
{
// NOTE: The toucher is the player standing/falling on top of the other (touched) player's head.
if(!is_user_alive(toucher) || !is_user_alive(touched)) // The touching players can't be dead.
return;

if(!get_pcvar_num(amx_headsplash)) // If the plugin is disabled, stop messing with things.
return;
if(!ma_klase[toucher])
return;

if(falling_speed[touched]) // Check if the touched player is falling. If he/she is, don't continue.
return;

if(get_user_team(toucher) == get_user_team(touched) && !get_cvar_num("mp_friendlyfire")) // If the touchers are in the same team and friendly fire is off, don't continue.
return;

new touched_origin[3], toucher_origin[3];
get_user_origin(touched, touched_origin); // Get the origins of the players so it's possible to check if the toucher is standing on the touched's head.
get_user_origin(toucher, toucher_origin);

new Float:toucher_minsize[3], Float:touched_minsize[3];
pev(toucher,pev_mins,toucher_minsize);
pev(touched,pev_mins,touched_minsize); // If touche*_minsize is equal to -18.0, touche* is crouching.

if(touched_minsize[2] != -18.0) // If the touched player IS NOT crouching, check if the toucher is on his/her head.
{
if(!(toucher_origin[2] == touched_origin[2]+72 && toucher_minsize[2] != -18.0) && !(toucher_origin[2] == touched_origin[2]+54 && toucher_minsize[2] == -18.0))
{
return;
}
}
else // If the touched player is crouching, check if the toucher is on his/her head
{
if(!(toucher_origin[2] == touched_origin[2]+68 && toucher_minsize[2] != -18.0) && !(toucher_origin[2] == touched_origin[2]+50 && toucher_minsize[2] == -18.0))
{
return;
}
}

if(falling_speed[toucher] >= MINIMUM_FALL_SPEED) // If the toucher is falling in the required speed or faster, then landing on top of the touched's head, do some damage to the touched. MUHAHAHAHAHA!!!
{
new Float:damage = ((falling_speed[toucher] - MINIMUM_FALL_SPEED + 30) * (falling_speed[toucher] - MINIMUM_FALL_SPEED + 30)) / 1300;
if(damage > MAXIMUM_DAMAGE_FROM_JUMP) // Make shure that the touched player don't take too much damage.
damage = MAXIMUM_DAMAGE_FROM_JUMP;
damage_player(touched, toucher, damage); // Damage or kill the touched player.
damage_after[toucher][touched] = 0.0; // Reset.
}
if(is_user_alive(touched) && damage_after[toucher][touched] damage)
{
new pwned_origin[3];
get_user_origin(pwned, pwned_origin);
message_begin(MSG_BROADCAST, SVC_TEMPENTITY); // BLOOOOOOOOOOOD!!
write_byte(TE_BLOODSPRITE);
write_coord(pwned_origin[0]+8);
write_coord(pwned_origin[1]);
write_coord(pwned_origin[2]+26);
write_short(blood2);
write_short(blood);
write_byte(248);
write_byte(4);
message_end();

new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "trigger_hurt"));
if(!ent)
return;
new value[16];
float_to_str(damage * 2, value, sizeof value - 1);
set_kvd(0, KV_ClassName, "trigger_hurt");
set_kvd(0, KV_KeyName, "dmg");
set_kvd(0, KV_Value, value);
set_kvd(0, KV_fHandled, 0);
dllfunc(DLLFunc_KeyValue, ent, 0);
num_to_str(DMG_GENERIC, value, sizeof value - 1);
set_kvd(0, KV_ClassName, "trigger_hurt");
set_kvd(0, KV_KeyName, "damagetype");
set_kvd(0, KV_Value, value);
set_kvd(0, KV_fHandled, 0);
dllfunc(DLLFunc_KeyValue, ent, 0);
set_kvd(0, KV_ClassName, "trigger_hurt");
set_kvd(0, KV_KeyName, "origin");
set_kvd(0, KV_Value, "8192 8192 8192");
set_kvd(0, KV_fHandled, 0);
dllfunc(DLLFunc_KeyValue, ent, 0);
dllfunc(DLLFunc_Spawn, ent);
set_pev(ent, pev_classname, "head_splash");
dllfunc(DLLFunc_Touch, ent, pwned);
engfunc(EngFunc_RemoveEntity, ent);
}
else
{
new pwned_origin[3];
get_user_origin(pwned, pwned_origin);
message_begin(MSG_BROADCAST, SVC_TEMPENTITY); // BLOOOOOOOOOOOD!!
write_byte(TE_BLOODSPRITE);
write_coord(pwned_origin[0]+8);
write_coord(pwned_origin[1]);
write_coord(pwned_origin[2]+26);
write_short(blood2);
write_short(blood);
write_byte(248);
write_byte(12);
message_end();

set_pev(pwned, pev_frags, float(get_user_frags(pwned) + 1));
user_silentkill(pwned);
make_deathmsg(pwnzor, pwned, 1, "his/her feet :)");
if(get_user_team(pwnzor) != get_user_team(pwned)) // If it was a team kill, the pwnzor's money should get reduced instead of increased.
{
set_pev(pwnzor, pev_frags, float(get_user_frags(pwnzor) + 1));
cs_set_user_money(pwnzor, cs_get_user_money(pwnzor) + 300);
cod_set_user_xp(pwnzor, cod_get_user_xp(pwnzor) + 10)
}
else
{
set_pev(pwnzor, pev_frags, float(get_user_frags(pwnzor) - 1));
cs_set_user_money(pwnzor, cs_get_user_money(pwnzor) - 300);
}

message_begin(MSG_ALL, get_user_msgid("ScoreInfo")); // Fixes the scoreboard.
write_byte(pwnzor);
write_short(get_user_frags(pwnzor));
write_short(cs_get_user_deaths(pwnzor));
write_short(0);
write_short(get_user_team(pwnzor));
message_end();

message_begin(MSG_ALL, get_user_msgid("ScoreInfo"));
write_byte(pwned);
write_short(get_user_frags(pwned));
write_short(cs_get_user_deaths(pwned));
write_short(0);
write_short(get_user_team(pwned));
message_end();
set_pev(pwned, pev_frags, float(get_user_frags(pwned) - 1));
}
}
public death_event()
{
new kid = read_data(1)
new id = read_data(2)
if(g_isDying[id])
{
g_isDying[id] = false
remove_task(4247545+id)
}
if( kid != id && is_user_alive(kid) && ma_klase[id])
{
cod_set_user_xp(kid, cod_get_user_xp(kid) + 30)
}
}
public make_footsteps(param[])
{
new id = param[0]
if(!is_user_alive(id) || get_cvar_num("ftw_active") == 1 || get_speed(id) < 120) return
new origin[3]
get_user_origin(id, origin)
if(entity_get_int(id, EV_INT_bInDuck) == 1)
origin[2] -= 18
else
origin[2] -= 36
new Float:velocity[3]
new Float:ent_angles[3]
new Float:ent_origin[3]
new ent

entity_get_vector(id, EV_VEC_v_angle, ent_angles)
entity_get_vector(id, EV_VEC_origin, ent_origin)

ent = create_entity("info_target")
if(ent > 0)
{
ent_angles[0] = 0.0
if(g_decalSwitch[id] == 0) ent_angles[1] -= 90
else ent_angles[1] += 90
entity_set_vector(ent, EV_VEC_origin, ent_origin)
entity_set_vector(ent, EV_VEC_v_angle, ent_angles)
VelocityByAim(ent, 12, velocity)
remove_entity(ent)
}
message_begin(MSG_BROADCAST, SVC_TEMPENTITY, origin)
write_byte(116)
write_coord(origin[0] + floatround(velocity[0]))
write_coord(origin[1] + floatround(velocity[1]))
write_coord(origin[2])
write_byte(decals[g_decalSwitch[id]])
message_end()
g_decalSwitch[id] = 1 - g_decalSwitch[id]
return
}
public PlayerPreThink(id)
{
if(!ma_klase[id])
return PLUGIN_CONTINUE;

new button = pev(id, pev_button);
new oldbutton = pev(id, pev_oldbuttons);
new flags = pev(id, pev_flags);

if((button & IN_JUMP) && !(flags & FL_ONGROUND) && !(oldbutton & IN_JUMP) && skoki[id])
{
skoki[id]--;
new Float:velocity[3];
pev(id, pev_velocity, velocity);
velocity[2] = random_float(265.0,285.0);
set_pev(id, pev_velocity, velocity);
}
else if(flags & FL_ONGROUND)
skoki[id] = 3;

return PLUGIN_CONTINUE;
}

Załączone pliki


  • +
  • -
  • 0

b_350_20_000000_133807_FFFFFF_000000.png

188.165.19.26:27716
b_350_20_FFAD41_E98100_000000_591F11.png

213.189.52.228:27416

b_350_20_AE2424_FFFFFF_100B99_000000.png

5.196.210.218:10094


#2 SoPelQ

    Banned

  • Zbanowany

Reputacja: 7
Nowy

  • Postów:121
  • Lokalizacja:Utajnione
Offline

Napisano 28.01.2012 09:53

http://amxx.pl/topic...klasy-na-stale/
Zapraszam do tego tematu.





Również z jednym lub większą ilością słów kluczowych: cod nowy

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

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