←  Problemy

AMXX.pl: Support AMX Mod X i SourceMod

»

CoD Nowy
Przewrócenie ekranu i zabicie 1 strzałem

  • +
  • -
ExuS's Photo ExuS 19.11.2011

Witam. Mam buga, który powoduje przewrócenie ekranu i możliwość zabicia osoby z tym bugiem jednym strzałem. Wygląda to tak: http://img15.imagesh...beztytuuldn.jpg

Myślę, że może to być spowodowane tą funkcją, ponieważ niedawno ją zmieniałem, bo powodowała dużo spamu w logach.

public MessageHealth(msg_id, msg_dest, msg_entity)
{
new health = get_msg_arg_int(1);

if(health < 256)
return;

if (!(health % 256))
set_pev(msg_entity,pev_health ,pev(msg_entity, pev_health)-1);

set_msg_arg_int(1, get_msg_argtype(1), 255);
}


Wcześniej przed zmianą jedna linijka wyglądała tak:
set_pev(msg_entity, pev(msg_entity, pev_health)-1);


Odświeżam.
Edited by ExuS, 19.11.2011 10:28.
Quote

  • +
  • -
Kaleka's Photo Kaleka 20.11.2011

To jest bug z 256hp, jeżeli ktoś ma tyle ustawia mu 0hp i możliwość zabicia jego na 1 hit

Wypróbuj tego:
#include <amxmodx>
#include <fun>


#define PLUGIN "Cod naprawa bugu"
#define VERSION "1.0"
#define AUTHOR "Zielony Smerf"


public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)

register_logevent("Poczatek_Rundy", 2, "1=Round_Start")

register_event("Health", "Health", "be")

set_task(0.01, "hp_bug")
}

public Poczatek_Rundy(id)
{

set_task(0.01, "hp_bug")
}

public Health(id)
{

if(get_user_health(id) == 256)
{
set_user_health(id,get_user_health(id)+5)
}
return PLUGIN_CONTINUE
}

public hp_bug(id)
{
if(get_user_health(id) == 256)
{
set_user_health(id,get_user_health(id)+5)
}
return PLUGIN_CONTINUE
}

Quote