AutoBH dla klasy
radim
18.10.2011
1) Dodajemy include:
2) Dodajemy pod includami:
3) Na koniec sma dodajemy:
#include <engine>
2) Dodajemy pod includami:
#define FL_WATERJUMP (1<<11) // popping out of the water #define FL_ONGROUND (1<<9) // not moving on the ground
3) Na koniec sma dodajemy:
public client_PreThink(id) { if(!ma_klase[id]) return PLUGIN_CONTINUE if (entity_get_int(id, EV_INT_button) & 2) { new flags = entity_get_int(id, EV_INT_flags) if (flags & FL_WATERJUMP) return PLUGIN_CONTINUE if ( entity_get_int(id, EV_INT_waterlevel) >= 2 ) return PLUGIN_CONTINUE if ( !(flags & FL_ONGROUND) ) return PLUGIN_CONTINUE new Float:velocity[3] entity_get_vector(id, EV_VEC_velocity, velocity) velocity[2] += 250.0 entity_set_vector(id, EV_VEC_velocity, velocity) entity_set_int(id, EV_INT_gaitsequence, 6) } return PLUGIN_CONTINUE }
A może sma?
21.10.2011
#define FL_WATERJUMP (1<<11) // popping out of the water
#define FL_ONGROUND (1<<9) // not moving on the ground
Po co...?
public client_PreThink(id)
{
if(!ma_klase[id])
return PLUGIN_CONTINUE
if(entity_get_int(id, EV_INT_button) & 2)
{
new flags = entity_get_int(id, EV_INT_flags)
if (flags & (1<<11))
return PLUGIN_CONTINUE
if (entity_get_int(id, EV_INT_waterlevel) >= 2)
return PLUGIN_CONTINUE
if (!(flags & (1<<9)))
return PLUGIN_CONTINUE
new Float:velocity[3]
entity_get_vector(id, EV_VEC_velocity, velocity)
velocity[2] += 250.0
entity_set_vector(id, EV_VEC_velocity, velocity)
entity_set_int(id, EV_INT_gaitsequence, 6)
}
return PLUGIN_CONTINUE
}
R3X
22.10.2011
definicje #define istnieją tylko na etapie kompilacji, więc w praktyce oba kody działają tak samo szybko; z racji tego, że pierwszy jest bardziej czytelny jest lepszy
DarkGL
22.10.2011
obecnie jest to autobh bez spowolnienia co pozwala osiągnąć bardzo duże prędkości