←  Problemy z pluginami

AMXX.pl: Support AMX Mod X i SourceMod

»

Problem z dodanie do klasy 1hp.

  • +
  • -
Kolejorz1234 - zdjęcie Kolejorz1234 23.12.2013

Witam dziś chciałem zrobić sobie klasę komandos z 1hp na start, lecz cos mi nie idzie, proszę o pomoc, wynagrodzę!

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <codmod>
#include <hamsandwich>
#include <fun>

#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 = 0;
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)
{
	set_user_health(id, 1);
	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;
}

Odpowiedz

  • +
  • -
Kokalovsky. - zdjęcie Kokalovsky. 23.12.2013

new const zdrowie = 0;

zmień na


new const zdrowie = 1;

Odpowiedz

  • +
  • -
EferenTM - zdjęcie EferenTM 23.12.2013

Ale mu chodzi ogólnie o 1hp, a to jest mnożnik coda, pkt umiejętności.
 
Zamień to: 

public cod_class_enabled(id)
{
	set_user_health(id, 1);
	ma_klase[id] = true;
} 

Na to:

public cod_class_enabled(id)
{
	ma_klase[id] = true;
        set_user_health(id,1);
}

Powinno działać


Użytkownik .Eferen. edytował ten post 23.12.2013 14:09
Odpowiedz