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

[ROZWIĄZANE] Pomoc w dodaniu podwójnego Skoku do klasy

cod nowy

  • Zamknięty Temat jest zamknięty
3 odpowiedzi w tym temacie

#1 ZiomKiller

    Nowy

  • Zbanowany

Reputacja: 0
Nowy

  • Postów:8
  • Imię:Paweł
  • Lokalizacja:Golub-Dobrzyń
Offline

Napisano 02.01.2012 14:55

Witam proszę o dodanie podwójnego skoku do klasy oraz jeśli są błędy proszę o poprawę.Za pomoc +++

/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <fakemeta>
#include <hamsandwich>
new const nazwa[] = "Admiral (Premium)";
new const opis[] = "Dodatkowe 25 dmg,25 hp i pelen magazynek za kazde zabojstwo,podwojny skok,dostaje wiecej expa za fraga";
new const bronie = (1<<CSW_M4A1)|(1<<CSW_DEAGLE)|1(1<<CSW_HEGRENADE);
new const zdrowie = 25;
new const kondycja = 25;
new const inteligencja = 25;
new const wytrzymalosc = 25;[/b]
[b]new bool:ma_klase[33];
new const maxClip[31] = { -1, 13, -1, 10,  1,  7,  1,  30, 30,  1,  30,  20,  25, 30, 35, 25,  12,  20,
10,  30, 100,  8, 30,  30, 20,  2,  7, 30, 30, -1,  50 };
public plugin_init() {
register_plugin(nazwa, "1.0", "QTM_Peyote");[/b][b]cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);[/b]
[b]register_forward(FM_CmdStart, "CmdStart");
register_event("DeathMsg", "DeathMsg", "ade");
}
public cod_class_enabled(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL_A))
{
  client_print(id, print_chat, "[Admiral] Nie masz uprawnien, aby uzywac tej klasy.")
  return COD_STOP;
}
ma_klase[id] = true;
return COD_CONTINUE;
}
public cod_class_disabled(id)
ma_klase[id] = false;[/b][b]public DeathMsg()
{
new killer = read_data(1);
new victim = read_data(2);[/b]
[b]if(!is_user_connected(killer))
  return PLUGIN_CONTINUE;[/b][b]if(ma_klase[victim] && !ma_klase[killer])
  cod_set_user_xp(killer, cod_get_user_xp(killer)+5000);[/b]
[b]if(ma_klase[killer])
{
  new cur_health = pev(killer, pev_health);
  new Float:max_health = 100.0+cod_get_user_health(killer);
  new Float:new_health = cur_health+25.0<max_health? cur_health+20.0: max_health;
  set_pev(killer, pev_health, new_health);

  new weapon = get_user_weapon(killer);
  if(maxClip[weapon] != -1)
   set_user_clip(killer, maxClip[weapon]);
}[/b]
[b]return PLUGIN_CONTINUE;
}
stock set_user_clip(id, ammo)
{
new weaponname[32], weaponid = -1, weapon = get_user_weapon(id, _, _);
get_weaponname(weapon, weaponname, 31);
while ((weaponid = engfunc(EngFunc_FindEntityByString, weaponid, "classname", weaponname)) != 0)
  if (pev(weaponid, pev_owner) == id) {
  set_pdata_int(weaponid, 31, ammo, 4);
  return weaponid;
}
return 0;
}
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
        if(!is_user_connected(idattacker))
                        return HAM_IGNORED;

        if(!ma_klase[idattacker])
                        return HAM_IGNORED;

        if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_M4A1 && damagebits & DMG_BULLET)
                        cod_inflict_damage(idattacker, this, 25.0, 0.0, idinflictor, damagebits);

        return HAM_IGNORED;
}


#2 Klakier

    Volenti non fit iniuria

  • Power User

Reputacja: 391
Wszechpomocny

  • Postów:878
  • GG:
  • Imię:Sebastian
  • Lokalizacja:Mogilno
Offline

Napisano 02.01.2012 20:05


#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <fakemeta>
#include <hamsandwich>

new const nazwa[] = "Admiral (Premium)";
new const opis[] = "Dodatkowe 25 dmg,25 hp i pelen magazynek za kazde zabojstwo,podwojny skok,dostaje wiecej expa za fraga";
new const bronie = (1<<CSW_M4A1)|(1<<CSW_DEAGLE)|(1<<CSW_HEGRENADE);
new const zdrowie = 25;
new const kondycja = 25;
new const inteligencja = 25;
new const wytrzymalosc = 25;

new bool:ma_klase[33];

new bool:moze_skoczyc[33];

new const maxClip[31] = { -1, 13, -1, 10, 1, 7, 1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20, 10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 };

public plugin_init()
{
register_plugin(nazwa, "1.0", "QTM_Peyote");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
register_forward(FM_CmdStart, "CmdStart");
register_event("DeathMsg", "DeathMsg", "ade");
}
public cod_class_enabled(id)
{
if((get_user_flags(id) & ADMIN_LEVEL_G))
{
client_print(id, print_chat, "[Admiral] Nie masz uprawnien, aby uzywac tej klasy.")
return COD_STOP;
}

ma_klase[id] = true;
return COD_CONTINUE;
}
public cod_class_disabled(id)
ma_klase[id] = false;

public CmdStart(id, uc_handle)
{
if(!ma_klase[id])
return FMRES_IGNORED;

new button = get_uc(uc_handle, UC_Buttons);
new oldbutton = pev(id, pev_oldbuttons);
new flags = pev(id, pev_flags);
if((button & IN_JUMP) && !(flags & FL_ONGROUND) && !(oldbutton & IN_JUMP) && moze_skoczyc[id])
{
moze_skoczyc[id] = false;
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)
moze_skoczyc[id] = true;

return FMRES_IGNORED;
}

public DeathMsg()
{
new killer = read_data(1);
new victim = read_data(2);
if(!is_user_connected(killer))
return PLUGIN_CONTINUE;
if(ma_klase[victim] && !ma_klase[killer])
cod_set_user_xp(killer, cod_get_user_xp(killer)+5000);
if(ma_klase[killer])
{
new cur_health = pev(killer, pev_health);
new Float:max_health = 100.0+cod_get_user_health(killer);
new Float:new_health = cur_health+25.0<max_health? cur_health+20.0: max_health;
set_pev(killer, pev_health, new_health);

new weapon = get_user_weapon(killer);
if(maxClip[weapon] != -1)
set_user_clip(killer, maxClip[weapon]);
}
return PLUGIN_CONTINUE;
}
stock set_user_clip(id, ammo)
{
new weaponname[32], weaponid = -1, weapon = get_user_weapon(id, _, _);
get_weaponname(weapon, weaponname, 31);
while ((weaponid = engfunc(EngFunc_FindEntityByString, weaponid, "classname", weaponname)) != 0)
if (pev(weaponid, pev_owner) == id)
{
set_pdata_int(weaponid, 31, ammo, 4);
return weaponid;
}
return 0;
}
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;

if(!ma_klase[idattacker])
return HAM_IGNORED;

if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_M4A1 && damagebits & DMG_BULLET)
cod_inflict_damage(idattacker, this, 25.0, 0.0, idinflictor, damagebits);

return HAM_IGNORED;
}

Użytkownik Klakier edytował ten post 02.01.2012 20:06

  • +
  • -
  • 1

Sell - System Klanów (wojny, top15 etc)

 

Kontakt GG: 7285018


#3 ZiomKiller

    Nowy

  • Autor tematu
  • Zbanowany

Reputacja: 0
Nowy

  • Postów:8
  • Imię:Paweł
  • Lokalizacja:Golub-Dobrzyń
Offline

Napisano 03.01.2012 06:30

Wszystko działa,dodam plusiki jak załapie gdzie się je dodaje.
PS:Jak komuś dać plusika.

#4 Goliath

    Godlike

  • Przyjaciel

Reputacja: 1 237
Godlike

  • Postów:2 334
  • GG:
  • Steam:steam
  • Imię:Maciej
  • Lokalizacja:Mońki
Offline

Napisano 03.01.2012 16:12

Wiadomość wygenerowana automatycznie


Ten temat został zamknięty przez moderatora.

Powód: Pomoc udzielona

Jeśli się z tym nie zgadzasz, Dołączona grafika raportuj ten post, a moderator lub administrator rozpatrzy go ponownie.


Z pozdrowieniami,
Zespół AMXX.PL
  • +
  • -
  • 0





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