[ROZWIĄZANE] Pomoc w przerobieniu klas.
ZiomKiller 04.01.2012
Witam proszę o dodanie do klasy "Rambo" cichego chodzenia,oraz do klasy "Elektro" podwójnego skoku.Za pomoc od ++ do +++.
#include <amxmodx> #include <amxmisc> #include <codmod> #include <fakemeta> #include <hamsandwich> new const nazwa[] = "Rambo(Premium)"; new const opis[] = "Dodatkowe 45 dmg,45 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_<img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/cool.png' class='bbc_emoticon' alt='B)' />) { client_print(id, print_chat, "[Rambo] 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)+8000); 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+45.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, 51); while ((weaponid = engfunc(EngFunc_FindEntityByString, weaponid, "classname", weaponname)) != 0) if (pev(weaponid, pev_owner) == id) { set_pdata_int(weaponid, 51, 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_weapon(idattacker) == CSW_DEAGLE && damagebits & DMG_BULLET) cod_inflict_damage(idattacker, this, 45.0, 0.0, idinflictor, damagebits); if(get_user_weapon(idattacker) == CSW_M4A1 && damagebits & DMG_BULLET) cod_inflict_damage(idattacker, this, 45.0, 0.0, idinflictor, damagebits); if(get_user_weapon(idattacker) == CSW_HEGRENADE && damagebits & DMG_BULLET) cod_inflict_damage(idattacker, this, 45.0, 0.0, idinflictor, damagebits); return HAM_IGNORED; }
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <codmod> #include <engine> #include <hamsandwich> #define DMG_BULLET (1<<1) new sprite; new ilosc_blyskawic[33],poprzednia_blyskawica[33]; new bool:ma_klase[33]; new const nazwa[] = "Elektro(Premium)"; new const opis[] = "Posiada +75 dmg wiecej,2 pioruny (uzycie klawiszem e),pełen magazynek za kazde zabojstwo"; new const bronie = (1<<CSW_M4A1)|(1<<CSW_DEAGLE)|(1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG); new const zdrowie = 75; new const kondycja = 75; new const inteligencja = 75; new const wytrzymalosc = 75; 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"); register_event("ResetHUD", "ResetHUD", "abe"); } public plugin_precache() { sprite = precache_model("sprites/lgtning.spr"); } public cod_class_enabled(id) { if(!(get_user_flags(id) & ADMIN_LEVEL_C)) { client_print(id, print_chat, "[Elektro] Nie masz uprawnien, aby uzywac tej klasy.") return COD_STOP; } ma_klase[id] = true; ilosc_blyskawic[id] = 2; return COD_CONTINUE; } public cod_class_disabled(id) { ma_klase[id] = false; ilosc_blyskawic[id] = 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(damagebits & DMG_BULLET) { new weapon = get_user_weapon(idattacker); if(get_user_weapon(idattacker) == CSW_DEAGLE && damagebits & DMG_BULLET) cod_inflict_damage(idattacker, this, 75.0, 0.0, idinflictor, damagebits); if(get_user_weapon(idattacker) == CSW_HEGRENADE && damagebits & DMG_BULLET) cod_inflict_damage(idattacker, this, 75.0, 0.0, idinflictor, damagebits); if(get_user_weapon(idattacker) == CSW_M4A1 && damagebits & DMG_BULLET) cod_inflict_damage(idattacker, this, 75.0, 0.0, idinflictor, damagebits); if(get_user_weapon(idattacker) == CSW_KNIFE && damagebits & DMG_BULLET) cod_inflict_damage(idattacker, this, 75.0, 0.0, idinflictor, damagebits); } return HAM_IGNORED; } stock set_user_clip(id, ammo) { new weaponname[32], weaponid = -1, weapon = get_user_weapon(id, _, _); get_weaponname(weapon, weaponname, 51); while ((weaponid = engfunc(EngFunc_FindEntityByString, weaponid, "classname", weaponname)) != 0) if (pev(weaponid, pev_owner) == id) { set_pdata_int(weaponid, 51, ammo, 4); return weaponid; } return 0; } public cod_class_skill_used(id) { if(!is_user_alive(id)) return PLUGIN_HANDLED; if(!ilosc_blyskawic[id]) { return PLUGIN_HANDLED; } new ofiara, body; get_user_aiming(id, ofiara, body); if(is_user_alive(ofiara)){ if(get_user_team(ofiara) == get_user_team(id)) { return PLUGIN_HANDLED; } if(poprzednia_blyskawica[id]+2.0>get_gametime()) { client_print(id,print_chat,"Blyskawicy mozesz uzyc raz na 2 sek."); return PLUGIN_HANDLED; } poprzednia_blyskawica[id] = floatround(get_gametime()); ilosc_blyskawic[id]--; puscBlyskawice(id, ofiara, 500.0, 0.5); } return PLUGIN_HANDLED; } stock Create_TE_BEAMENTS(startEntity, endEntity, iSprite, startFrame, frameRate, life, width, noise, red, green, blue, alpha, speed) { message_begin( MSG_BROADCAST, SVC_TEMPENTITY ) write_byte( TE_BEAMENTS ) write_short( startEntity ) // start entity write_short( endEntity ) // end entity write_short( iSprite ) // model write_byte( startFrame ) // starting frame write_byte( frameRate ) // frame rate write_byte( life ) // life write_byte( width ) // line width write_byte( noise ) // noise amplitude write_byte( red ) // red write_byte( green ) // green write_byte( blue ) // blue write_byte( alpha ) // brightness write_byte( speed ) // scroll speed message_end() } puscBlyskawice(id, ofiara, Float:fObrazenia = 350.0, Float:fCzas = 1.0){ //Obrazenia new ent = create_entity("info_target"); entity_set_string(ent, EV_SZ_classname, "blyskawica"); cod_inflict_damage(id, ofiara, fObrazenia, 1.0, ent, DMG_SHOCK); remove_entity(ent); //Piorun Create_TE_BEAMENTS(id, ofiara, sprite, 0, 10, floatround(fCzas*10), 150, 5, 200, 200, 200, 200, 10); } public ResetHUD(id) { if(ma_klase[id] == true) { ilosc_blyskawic[id] = 2; } }
PRoMEN 04.01.2012
rambo:
#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <fakemeta>
#include <hamsandwich>
#include <fun>
new const nazwa[] = "Rambo(Premium)";
new const opis[] = "Dodatkowe 45 dmg,45 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)
{
set_user_footsteps(id, 1);
if(!(get_user_flags(id) & ADMIN_LEVEL_)
{
client_print(id, print_chat, "[Rambo] 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)+8000);
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+45.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, 51);
while ((weaponid = engfunc(EngFunc_FindEntityByString, weaponid, "classname", weaponname)) != 0)
if (pev(weaponid, pev_owner) == id)
{
set_pdata_int(weaponid, 51, 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_weapon(idattacker) == CSW_DEAGLE && damagebits & DMG_BULLET)
cod_inflict_damage(idattacker, this, 45.0, 0.0, idinflictor, damagebits);
if(get_user_weapon(idattacker) == CSW_M4A1 && damagebits & DMG_BULLET)
cod_inflict_damage(idattacker, this, 45.0, 0.0, idinflictor, damagebits);
if(get_user_weapon(idattacker) == CSW_HEGRENADE && damagebits & DMG_BULLET)
cod_inflict_damage(idattacker, this, 45.0, 0.0, idinflictor, damagebits);
return HAM_IGNORED;
}
ZiomKiller 05.01.2012
Klasa Rambo sprawuje się dobrze dla ciebie ++.
Czekam jeszcze na pomoc w Elektro.
Czekam jeszcze na pomoc w Elektro.
ChillOut
05.01.2012
Oto Elektro, przetestuj :
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <codmod>
#include <engine>
#include <hamsandwich>
#include <fakemeta>
#define DMG_BULLET (1<<1)
new sprite;
new ilosc_blyskawic[33],poprzednia_blyskawica[33];
new bool:ma_klase[33];
new const nazwa[] = "Elektro(Premium)";
new const opis[] = "Posiada +75 dmg wiecej,2 pioruny (uzycie klawiszem e),pełen magazynek za kazde zabojstwo";
new const bronie = (1<<CSW_M4A1)|(1<<CSW_DEAGLE)|(1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG);
new const zdrowie = 75;
new const kondycja = 75;
new const inteligencja = 75;
new const wytrzymalosc = 75;
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");
register_event("ResetHUD", "ResetHUD", "abe");
register_forward(FM_CmdStart, "CmdStart");
}
public plugin_precache()
{
sprite = precache_model("sprites/lgtning.spr");
}
public cod_class_enabled(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL_C))
{
client_print(id, print_chat, "[Elektro] Nie masz uprawnien, aby uzywac tej klasy.")
return COD_STOP;
}
ma_klase[id] = true;
ilosc_blyskawic[id] = 2;
return COD_CONTINUE;
}
public cod_class_disabled(id)
{
ma_klase[id] = false;
ilosc_blyskawic[id] = 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(damagebits & DMG_BULLET)
{
new weapon = get_user_weapon(idattacker);
if(get_user_weapon(idattacker) == CSW_DEAGLE && damagebits & DMG_BULLET)
cod_inflict_damage(idattacker, this, 75.0, 0.0, idinflictor, damagebits);
if(get_user_weapon(idattacker) == CSW_HEGRENADE && damagebits & DMG_BULLET)
cod_inflict_damage(idattacker, this, 75.0, 0.0, idinflictor, damagebits);
if(get_user_weapon(idattacker) == CSW_M4A1 && damagebits & DMG_BULLET)
cod_inflict_damage(idattacker, this, 75.0, 0.0, idinflictor, damagebits);
if(get_user_weapon(idattacker) == CSW_KNIFE && damagebits & DMG_BULLET)
cod_inflict_damage(idattacker, this, 75.0, 0.0, idinflictor, damagebits);
}
return HAM_IGNORED;
}
stock set_user_clip(id, ammo)
{
new weaponname[32], weaponid = -1, weapon = get_user_weapon(id, _, _);
get_weaponname(weapon, weaponname, 51);
while ((weaponid = engfunc(EngFunc_FindEntityByString, weaponid, "classname", weaponname)) != 0)
if (pev(weaponid, pev_owner) == id) {
set_pdata_int(weaponid, 51, ammo, 4);
return weaponid;
}
return 0;
}
public cod_class_skill_used(id) {
if(!is_user_alive(id)) return PLUGIN_HANDLED;
if(!ilosc_blyskawic[id]) {
return PLUGIN_HANDLED;
}
new ofiara, body;
get_user_aiming(id, ofiara, body);
if(is_user_alive(ofiara)){
if(get_user_team(ofiara) == get_user_team(id)) {
return PLUGIN_HANDLED;
}
if(poprzednia_blyskawica[id]+2.0>get_gametime()) {
client_print(id,print_chat,"Blyskawicy mozesz uzyc raz na 2 sek.");
return PLUGIN_HANDLED;
}
poprzednia_blyskawica[id] = floatround(get_gametime());
ilosc_blyskawic[id]--;
puscBlyskawice(id, ofiara, 500.0, 0.5);
}
return PLUGIN_HANDLED;
}
stock Create_TE_BEAMENTS(startEntity, endEntity, iSprite, startFrame, frameRate, life, width, noise, red, green, blue, alpha, speed) {
message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
write_byte( TE_BEAMENTS )
write_short( startEntity ) // start entity
write_short( endEntity ) // end entity
write_short( iSprite ) // model
write_byte( startFrame ) // starting frame
write_byte( frameRate ) // frame rate
write_byte( life ) // life
write_byte( width ) // line width
write_byte( noise ) // noise amplitude
write_byte( red ) // red
write_byte( green ) // green
write_byte( blue ) // blue
write_byte( alpha ) // brightness
write_byte( speed ) // scroll speed
message_end()
}
puscBlyskawice(id, ofiara, Float:fObrazenia = 350.0, Float:fCzas = 1.0){
//Obrazenia
new ent = create_entity("info_target");
entity_set_string(ent, EV_SZ_classname, "blyskawica");
cod_inflict_damage(id, ofiara, fObrazenia, 1.0, ent, DMG_SHOCK);
remove_entity(ent);
//Piorun
Create_TE_BEAMENTS(id, ofiara, sprite, 0, 10, floatround(fCzas*10), 150, 5, 200, 200, 200, 200, 10);
}
public ResetHUD(id) {
if(ma_klase[id] == true) {
ilosc_blyskawic[id] = 2;
}
}
new skoki[33];
public CmdStart(id, uc_handle)
{
if(!is_user_alive(id) || !ma_klase[id]) //jeśli tworzymy perk, wstawiamy ma_perk zamiast ma_klase
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] = 2; //tutaj podajemy ilość skokow w powietrzu, jaką może wykonać klasa
return FMRES_IGNORED;
}
DarkGL
06.01.2012
Wiadomość wygenerowana automatycznie
Ten temat został zamknięty przez moderatora.
Powód: Pomoc udzielona
Jeśli się z tym nie zgadzasz, raportuj ten post, a moderator lub administrator rozpatrzy go ponownie.
Z pozdrowieniami,
Zespół AMXX.PL
Ten temat został zamknięty przez moderatora.
Powód: Pomoc udzielona
Jeśli się z tym nie zgadzasz, raportuj ten post, a moderator lub administrator rozpatrzy go ponownie.
Z pozdrowieniami,
Zespół AMXX.PL