Witam, klasa Freezing Ice masakrycznie sypie mi w logach ... jak temu zapobiec?
L 04/11/2013 - 20:02:44: [FUN] Player out of range (0)
L 04/11/2013 - 20:02:44: [AMXX] Displaying debug trace (plugin "codclass_FreezingIce.amxx")
L 04/11/2013 - 20:02:44: [AMXX] Run time error 10: native error (native "get_user_gravity")
L 04/11/2013 - 20:02:44: [AMXX] [0] codclass_FreezingIce.sma::TakeDamage (line 44)
#include <amxmodx>
#include <codmod>
#include <hamsandwich>
#include <fun>
#include <engine>
#define AUTHOR "Mentos"
new const nazwa[] = "Freezing Ice";
new const opis[] = "dostajesz lodowe pociski i 1/3 szansy na zamrozenie przeciwnika (Zamrozenie trwa 5 sec).";
new const bronie = 1<<CSW_HEGRENADE | 1<<CSW_MP5NAVY | 1<<CSW_DEAGLE;
new const zdrowie = 0;
new const kondycja = 0;
new const inteligencja = 0;
new const wytrzymalosc = 0;
new bool:ma_klase[33]
new bool:zamrozenie[32]
public plugin_init()
{
register_plugin(nazwa, "1.0", "Mentos");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
RegisterHam(Ham_TakeDamage, "player", "TakeDamage", 1)
}
public cod_class_enabled(id)
{
ma_klase[id] = true;
}
public cod_class_disabled(id)
{
ma_klase[id] = false;
}
public TakeDamage(id, this, idattacker, Float:damage)
{
new liczba = random(3)
new Float:stara_grawitacja = get_user_gravity(this)
new Float:stara_predkosc = get_user_maxspeed(this)
new czas_zamrozenia[32] = 5
if(!is_user_connected(idattacker))
return HAM_IGNORED;
if(!ma_klase[idattacker])
return HAM_IGNORED;
if(ma_klase[idattacker] == true && damage>0 && zamrozenie[this]==false && liczba==3){
set_rendering(this, kRenderFxGlowShell, 0,0,255, kRenderFxNone, 10)
set_user_gravity(this, 0.1)
set_user_maxspeed(this, 0.1)
czas_zamrozenia[this] --;
zamrozenie[this] = true
if(czas_zamrozenia[this] == 0)
{
set_user_gravity(this, stara_grawitacja)
set_user_maxspeed(this, stara_predkosc)
set_rendering(this, kRenderFxGlowShell, 255,255,255, kRenderFxNone, 0)
zamrozenie[this] = false
}
}
if(zamrozenie[id] == true)
return HAM_SUPERCEDE
return HAM_IGNORED
}