←  Problemy

AMXX.pl: Support AMX Mod X i SourceMod

»

CoD Nowy
Moc dla klasy od x lvl

  • +
  • -
Przemek950720 - zdjęcie Przemek950720 24.02.2013

mam problem, chciałem zrobić żeby dana klasa miała 10 hp za killa do 20 lvl, a później już 20 hp, http://amxx.pl/topic...od-pewnego-lvl/ w tym temacie jest jak to zrobić na innej klasie, ale ja nie wiem jak to zrobić w mojej... oto sma

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

new bool:ma_klase[33];

new const nazwa[] = "Agent";
new const opis[] = "ma ubranie wroga, 10 hp za killa, na +20 lvl 20hp za killa";
new const bronie = (1<<CSW_M4A1);
new const zdrowie = 0;
new const kondycja = 0;
new const inteligencja = 0;
new const wytrzymalosc = 0;

new CT_Skins[4][] = {"sas","gsg9","urban","gign"};
new Terro_Skins[4][] = {"arctic","leet","guerilla","terror"};

public plugin_init()
{
register_plugin(nazwa, "1.0", "amxx.pl");

cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);

register_event("DeathMsg", "DeathMsg", "ade");
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
}

public cod_class_enabled(id)
{
ZmienUbranie(id, 0);
ma_klase[id] = true;
}

public cod_class_disabled(id)
{
ZmienUbranie(id, 1);
ma_klase[id] = false;
}

public ZmienUbranie(id,reset)
{
if (!is_user_connected(id))
return PLUGIN_CONTINUE;

if (reset)
cs_reset_user_model(id);
else
{
new num = random_num(0,3);
cs_set_user_model(id, (get_user_team(id) == 1)? CT_Skins[num]: Terro_Skins[num]);
}

return PLUGIN_CONTINUE;
}

public DeathMsg()
{
new killer = read_data(1);
new victim = read_data(2);

if(!is_user_connected(killer))
return PLUGIN_CONTINUE;


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+10.0<max_health? cur_health+10.0: max_health;
set_pev(killer, pev_health, new_health);
}
return PLUGIN_CONTINUE;
}


public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;

if(!ma_klase[idattacker])
return HAM_IGNORED;

return HAM_IGNORED;
}
Odpowiedz

  • +
  • -
Vasto_Lorde - zdjęcie Vasto_Lorde 24.02.2013

Zamiast:
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+10.0<max_health? cur_health+10.0: max_health;
set_pev(killer, pev_health, new_health);
}
return PLUGIN_CONTINUE;
Daj:
if(ma_klase[killer])
{
new Float: zycie_dodane=10.0;
if(cod_get_user_level(killer)>=20)
zycie_dodane+=10.0

new cur_health = pev(killer, pev_health);
new Float:max_health = 100.0+cod_get_user_health(killer);
new Float:new_health = cur_health+zycie_dodane<max_health? cur_health+zycie_dodane: max_health;
set_pev(killer, pev_health, new_health);
}
return PLUGIN_CONTINUE;
Odpowiedz