Pomoc w przerobieniu klasy
ZiomKiller 01.02.2012
<p>Witam proszę o dodanie podwójnego skoku,oraz cichego chodzenia do klasy komandos.Dam ++.
[code=auto:0]
#include #include #include #include #include #include #include #define DMG_BULLET (1
Użytkownik ZiomKiller edytował ten post 01.02.2012 10:54
[code=auto:0]
#include #include #include #include #include #include #include #define DMG_BULLET (1
Użytkownik ZiomKiller edytował ten post 01.02.2012 10:54
Oporowiec 01.02.2012
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <codmod>
#include <hamsandwich>
#define DMG_BULLET (1<<1)
new bool:ma_klase[33];
new const nazwa[] = "Komandos";
new const opis[] = "Natychmiastowe zabicie z noza(PPM)";
new const bronie = 1<<CSW_DEAGLE;
new const zdrowie = 40;
new const kondycja = 60;
new const inteligencja = 5;
new const wytrzymalosc = 0;
public plugin_init()
{
register_plugin(nazwa, "1.0", "QTM_Peyote");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
}
public cod_class_enabled(id)
ma_klase[id] = true;
public cod_class_disabled(id)
ma_klase[id] = false;
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_weapon(idattacker) == CSW_KNIFE && damagebits & DMG_BULLET && damage > 20.0)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
return HAM_IGNORED;
}
masz gotowca, na nastepny raz uzywaj amxx.pl/generator-klas/
Jeansy 01.02.2012
a ciche chodzenie to nie widzę żeby było dodane oraz podwojny skok
#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>
new const nazwa[] = "Komandos";
new const opis[] = "Natychmiastowe zabicie z noza(PPM)";
new const bronie = (1<<CSW_DEAGLE);
new const zdrowie = 40;
new const kondycja = 60;
new const inteligencja = 5;
new const wytrzymalosc = 0;
new skoki[33];
new ostatnio_prawym[33];
new ma_klase[33];
public plugin_init()
{
register_plugin(nazwa, "1.0", "QTM_Peyote");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
register_forward(FM_CmdStart, "fwCmdStart_MultiJump");
RegisterHam(Ham_TakeDamage, "player", "fwTakeDamage_JedenCios");
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_knife", "fwPrimaryAttack_JedenCios");
RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_knife", "fwSecondaryAttack_JedenCios");
}
public cod_class_enabled(id)
set_user_footsteps(id, 1);
public cod_class_disabled(id)
set_user_footsteps(id, 0);
}
public cod_class_enabled(id)
{
ma_klase[id] = true;
}
public cod_class_disabled(id)
{
ma_klase[id] = false;
}
public fwCmdStart_MultiJump(id, uc_handle)
{
if(!is_user_alive(id) || !ma_klase[id])
return FMRES_IGNORED;
new flags = pev(id, pev_flags);
if((get_uc(uc_handle, UC_Buttons) & IN_JUMP) && !(flags & FL_ONGROUND) && !(pev(id, pev_oldbuttons) & 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] = 1;
return FMRES_IGNORED;
}
public fwTakeDamage_JedenCios(id, ent, attacker)
{
if(is_user_alive(attacker) && ma_klase[attacker] && get_user_weapon(attacker) == CSW_KNIFE && ostatnio_prawym[id])
{
cs_set_user_armor(id, 0, CS_ARMOR_NONE);
SetHamParamFloat(4, float(get_user_health(id) + 1));
return HAM_HANDLED;
}
return HAM_IGNORED;
}
public fwPrimaryAttack_JedenCios(ent)
{
new id = pev(ent, pev_owner);
ostatnio_prawym[id] = 1;
}
public fwSecondaryAttack_JedenCios(ent)
{
new id = pev(ent, pev_owner);
ostatnio_prawym[id] = 0;
}
ZiomKiller 01.02.2012
Tuptusiowy-4+ dla ciebie a mógł byś zmienić na klase premium(obojetnie jaka flaga)?
RPK. Macior-dla ciebie 3+ bo nie było wszyskiego.
RPK. Macior-dla ciebie 3+ bo nie było wszyskiego.
Oporowiec 01.02.2012
public cod_class_enabled(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL_H))
{
client_print(id, print_chat, "[Komandos] Nie masz uprawnien, aby uzywac tej klasy.")
return COD_STOP;
}
return COD_CONTINUE;
}
daj to na koniec kodu klasy // flaga H
Jeansy 01.02.2012
Sprawdz czy się kompiluje jak nie to napisz:)
#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>
new const nazwa[] = "Komandos";
new const opis[] = "Natychmiastowe zabicie z noza(PPM)[font=monospace] Ciche chodzenie podwojny skok[/font]";
new const bronie = (1<<CSW_DEAGLE);
new const zdrowie = 40;
new const kondycja = 60;
new const inteligencja = 5;
new const wytrzymalosc = 0;
new skoki[33];
new ostatnio_prawym[33];
new ma_klase[33];
public plugin_init()
{
register_plugin(nazwa, "1.0", "QTM_Peyote");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
register_forward(FM_CmdStart, "fwCmdStart_MultiJump");
RegisterHam(Ham_TakeDamage, "player", "fwTakeDamage_JedenCios");
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_knife", "fwPrimaryAttack_JedenCios");
RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_knife", "fwSecondaryAttack_JedenCios");
}
public cod_class_enabled(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL_H))
{
client_print(id, print_chat, "[Komandos] Nie masz uprawnien, aby uzywac tej klasy.")
return COD_STOP;
}
return COD_CONTINUE;
}
public cod_class_enabled(id)
set_user_footsteps(id, 1);
public cod_class_disabled(id)
set_user_footsteps(id, 0);
}
public cod_class_enabled(id)
{
ma_klase[id] = true;
}
public cod_class_disabled(id)
{
ma_klase[id] = false;
}
public fwCmdStart_MultiJump(id, uc_handle)
{
if(!is_user_alive(id) || !ma_klase[id])
return FMRES_IGNORED;
new flags = pev(id, pev_flags);
if((get_uc(uc_handle, UC_Buttons) & IN_JUMP) && !(flags & FL_ONGROUND) && !(pev(id, pev_oldbuttons) & 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] = 1;
return FMRES_IGNORED;
}
public fwTakeDamage_JedenCios(id, ent, attacker)
{
if(is_user_alive(attacker) && ma_klase[attacker] && get_user_weapon(attacker) == CSW_KNIFE && ostatnio_prawym[id])
{
cs_set_user_armor(id, 0, CS_ARMOR_NONE);
SetHamParamFloat(4, float(get_user_health(id) + 1));
return HAM_HANDLED;
}
return HAM_IGNORED;
}
public fwPrimaryAttack_JedenCios(ent)
{
new id = pev(ent, pev_owner);
ostatnio_prawym[id] = 1;
}
public fwSecondaryAttack_JedenCios(ent)
{
new id = pev(ent, pev_owner);
ostatnio_prawym[id] = 0;
}