←  Problemy

AMXX.pl: Support AMX Mod X i SourceMod

»

Mały problem z przeniesieniem mocy item...

Legendarny :) ? - zdjęcie Legendarny :) ? 11.03.2012

Mam o to mały problem z przeniesieniem mocy z item'u na moc do klasy! Problem tkwi w tym że gdy wpisze item pokazuje mi opis danej mocy choć nie mam żadnego itemu ! Bug ten występuje w tym player_b_blink .

Zrobiłem to tak :

1. Nowa Zmienna czyli :
c_blink

2. To zamieniłem
if (player_b_blink[id] > 0) Prethink_Blink(id)

Na to.
if (player_b_blink[id] > 0 || c_blink[id] > 0) Prethink_Blink(id) 


3. Zamieniłem to

public Prethink_Blink(id)
{
if( get_user_button(id) & IN_ATTACK2 && !(get_user_oldbutton(id) & IN_ATTACK2) && is_user_alive(id))
{
if (on_knife[id])
{
if (halflife_time()-player_b_blink[id] <= 3) return PLUGIN_HANDLED
player_b_blink[id] = floatround(halflife_time())
UTIL_Teleport(id,300+15*player_intelligence[id])
}
}
return PLUGIN_CONTINUE
}


Na To

public Prethink_Blink(id)
{
if( get_user_button(id) & IN_ATTACK2 && !(get_user_oldbutton(id) & IN_ATTACK2) && is_user_alive(id))
{
if (on_knife[id])
{
if (halflife_time()-player_b_blink[id] <= 3) return PLUGIN_HANDLED
player_b_blink[id] = floatround(halflife_time())
UTIL_Teleport(id,300+5*player_intelligence[id])
}
}
if( get_user_button(id) & IN_ATTACK2 && !(get_user_oldbutton(id) & IN_ATTACK2) && is_user_alive(id))
{
if (on_knife[id])
{
if (halflife_time()-c_blink[id] <= 3) return PLUGIN_HANDLED
c_blink[id] = floatround(halflife_time())
UTIL_Teleport(id,300+5*player_intelligence[id])
}
}
return PLUGIN_CONTINUE
}


4.Do public_select_class pod
g_haskit[id] = 0


Dodałem:

c_blink[id]= 0


5. I do wybranej klasy

c_blink[id] = floatround(halflife_time()) 


.


Proszę o pomoc i powiedzenie w czym jest błąd ?
Odpowiedz

  • +
  • -
Zabkija' - zdjęcie Zabkija' 17.03.2012

5. I do wybranej klasy


pokaz gdzie to dokladnie dodales.

zamiast podwojnego warunku zrob tak:

if ( (halflife_time()-player_b_blink[id] <= 3) || (halflife_time()-c_blink[id] <= 3) ) return PLUGIN_HANDLED


optymalniej bedzie ;]
Odpowiedz