←  Prośby o Klasę/Perk

AMXX.pl: Support AMX Mod X i SourceMod

»

CoD Nowy
niedziałające dodatki klasy :(

  • +
  • -
porek - zdjęcie porek 01.05.2012

Siema, mam klase ktora powinna miec 1/1 awp i niewidzialnosc. 1/1 nie ma w ogóle a niewidzialne jest przez 2-3 rundy i potem widac. Oto sma:


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

new const nazwa[] = "Kapral";
new const opis[] = "1/1 z AWP, malo widoczny";
new const bronie = (1<<CSW_AWP)|(1<<CSW_DEAGLE);
new const zdrowie = 50;
new const kondycja = 30;
new const inteligencja = 30;
new const wytrzymalosc = 10;

new bool:ma_klase[33];

#define DMG_BULLET (1<<1)

public plugin_init()
{
register_plugin(nazwa, "1.0", "zQnem");
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");

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

public cod_class_enabled(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL_H))
{
client_print(id, print_chat, "[] Nie masz uprawnien, aby uzywac tej klasy. Pozdrawiam")
return COD_STOP;
}

set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 25);
return COD_CONTINUE;
}

public cod_class_disabled(id)
{
set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255);
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_AWP && damagebits & DMG_BULLET && damage > 10.0)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);

return HAM_IGNORED;
}


Odpowiedz

  • +
  • -
TheRock - zdjęcie TheRock 01.05.2012

Zamien to

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_AWP && damagebits & DMG_BULLET && damage > 10.0)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);

return HAM_IGNORED;
}


Na to

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(weapon == CSW_AWP && damage > 20.0)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);

}

return HAM_IGNORED;
}
Odpowiedz

  • +
  • -
porek - zdjęcie porek 01.05.2012

A co z niewidocznoscią? To przetestuje a tamto bys mogł zrobic? :)
Odpowiedz

  • +
  • -
TheRock - zdjęcie TheRock 01.05.2012

Zamien to


public cod_class_enabled(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL_H))
{
client_print(id, print_chat, "[] Nie masz uprawnien, aby uzywac tej klasy. Pozdrawiam")
return COD_STOP;
}

set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 25);
return COD_CONTINUE;
}

public cod_class_disabled(id)
{
set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255);
ma_klase[id] = false;

}


Na to

public cod_class_enabled(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL_H))
{
client_print(id, print_chat, "[] Nie masz uprawnien, aby uzywac tej klasy.")
return COD_STOP;
}

set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 25);
ma_klase[id] = true;

return COD_CONTINUE;
}

public cod_class_disabled(id)
{
set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255);
ma_klase[id] = false;

}


Użytkownik TheRock edytował ten post 01.05.2012 19:25
Odpowiedz

  • +
  • -
porek - zdjęcie porek 01.05.2012

Zaraz przetestuje, a tak przy okazi tamten 1/1 z awp nie dziala :<
Odpowiedz