Jak napisać to
Lelek
20.10.2008
#include <amxmodx> public plugin_init() { register_plugin("PLUGIN","VERSION","AUTHOR") register_clcmd("say /bh", "bh") } public bh(id) {
makel9
22.10.2008
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <fakemeta> #include <engine> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "MaKeL" new skok[33] = 0 public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_forward(FM_PlayerPreThink , "Forward_FM_PlayerPreThink") } public client_PreThink ( id ) { if(!is_user_alive(id)) return PLUGIN_HANDLED if((get_user_button(id) & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(get_user_oldbutton(id) & IN_JUMP)) { if(skok[id] == 0 ) { new Float:velocity[3] entity_get_vector(id,EV_VEC_velocity,velocity) velocity[2] = random_float(265.0,285.0) entity_set_vector(id,EV_VEC_velocity,velocity) skok[id] = 1 } } if(get_entity_flags(id) & FL_ONGROUND) { skok[id] = 0 } return PLUGIN_CONTINUE }
Miczu
22.10.2008
new Float:velocity[3] entity_get_vector(id,EV_VEC_velocity,velocity) velocity[2]+=268.3 entity_set_vector(id,EV_VEC_velocity,velocity)
makel9, twoj kod pozwalal skonczyc w przepasc na mapie kz i uratowac sie przez podskok nad sama ziemia. Ten kodzik po prostu zwieksza o tyle predkosc wznoszenia, ile ma sie faktycznie sil w nogach ;-)
Lelek
22.10.2008
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <fakemeta> #include <engine> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "MaKeL" new skok[33] = 0 public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_forward(FM_PlayerPreThink , "Forward_FM_PlayerPreThink") } public client_PreThink ( id ) { if(!is_user_alive(id)) return PLUGIN_HANDLED if((get_user_button(id) & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(get_user_oldbutton(id) & IN_JUMP)) { if(skok[id] == 0 ) { new Float:velocity[3] entity_get_vector(id,EV_VEC_velocity,velocity) velocity[2]+=268.3 entity_set_vector(id,EV_VEC_velocity,velocity) skok[id] = 1 } } if(get_entity_flags(id) & FL_ONGROUND) { skok[id] = 0 } return PLUGIN_CONTINUE }
Edit:
A tak zadziała może wiesz?
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <fakemeta> #include <engine> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "MaKeL" new skok[33] = 0 public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("say /bh", "bh") } public bh( id ) { if(!is_user_alive(id)) return PLUGIN_HANDLED if((get_user_button(id) & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(get_user_oldbutton(id) & IN_JUMP)) { if(skok[id] == 0 ) { new Float:velocity[3] entity_get_vector(id,EV_VEC_velocity,velocity) velocity[2]+=268.3 entity_set_vector(id,EV_VEC_velocity,velocity) skok[id] = 1 } } if(get_entity_flags(id) & FL_ONGROUND) { skok[id] = 0 } return PLUGIN_CONTINUE }
Miczu
22.10.2008
PS. new skok[33] = 0 // nie potrzebne =0 bo przy deklaracji wartosci sa i tak zerowane...
Lelek
22.10.2008
Miczu
22.10.2008
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <fakemeta> #include <engine> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "MaKeL" new skok[33] public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_forward(FM_PlayerPreThink , "Forward_FM_PlayerPreThink") } public client_PreThink ( id ) { if(!is_user_alive(id)) return PLUGIN_HANDLED if((get_user_button(id) & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(get_user_oldbutton(id) & IN_JUMP)) { if(skok[id] == 0 ) { new Float:velocity[3] entity_get_vector(id,EV_VEC_velocity,velocity) velocity[2]+=268.3 entity_set_vector(id,EV_VEC_velocity,velocity) skok[id] = 1 } } if(get_entity_flags(id) & FL_ONGROUND) { skok[id] = 0 } return PLUGIN_CONTINUE }
Lelek
22.10.2008
Miczu
22.10.2008
#include <amxmodx> #include <fakemeta> #include <engine> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "MaKeL" new skok[33] new jumps[33] public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_forward(FM_PlayerPreThink , "Forward_FM_PlayerPreThink") register_cvar("amx_max_jumps","1") } public client_PreThink ( id ) { if(!is_user_alive(id)) return PLUGIN_HANDLED if((get_user_button(id) & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(get_user_oldbutton(id) & IN_JUMP)) { if(skok[id] == 0 && jumps[id]<get_cvar_num("amx_max_jumps") { new Float:velocity[3] entity_get_vector(id,EV_VEC_velocity,velocity) velocity[2]+=268.3 entity_set_vector(id,EV_VEC_velocity,velocity) skok[id] = 1 jumps[id]++ } } if(get_entity_flags(id) & FL_ONGROUND) { skok[id] = 0 jumps[id] = 0 } return PLUGIN_CONTINUE }Zmienasz cvarem...
yetj
22.10.2008
#include <amxmodx>
#include <fakemeta>
#include <engine>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "MaKeL"
new skok[33]
new jumps[33]
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_forward(FM_PlayerPreThink , "Forward_FM_PlayerPreThink")
register_cvar("amx_max_jumps","1")
}
public client_PreThink ( id )
{
if(!is_user_alive(id))
return PLUGIN_HANDLED
if((get_user_button(id) & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(get_user_oldbutton(id) & IN_JUMP))
{
if(skok[id] == 0 && jumps[id])
{
new Float:velocity[3]
entity_get_vector(id,EV_VEC_velocity,velocity)
velocity[2]+=268.3
entity_set_vector(id,EV_VEC_velocity,velocity)
skok[id] = 1
jumps[id]++
}
}
if(get_entity_flags(id) & FL_ONGROUND)
{
skok[id] = 0
jumps[id] = 0
}
return PLUGIN_CONTINUE
}
Teraz powinno działać poprawnie
Lelek
22.10.2008
yetj
22.10.2008
Lelek
22.10.2008
P.S mafia też dostanie za ten trud
Miczu
22.10.2008
[ Dodano: 22-10-2008, 23:01 ]
#include <amxmodx> #include <fakemeta> #include <engine> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "MaKeL" new skok[33] public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_forward(FM_PlayerPreThink , "Forward_FM_PlayerPreThink") register_cvar("amx_max_jumps","1") } public client_PreThink ( id ) { if(!is_user_alive(id)) return PLUGIN_HANDLED if((get_user_button(id) & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(get_user_oldbutton(id) & IN_JUMP)) { if(skok[id] < get_cvar_num("amx_max_jumps")) { new Float:velocity[3] entity_get_vector(id,EV_VEC_velocity,velocity) velocity[2]+=268.3 entity_set_vector(id,EV_VEC_velocity,velocity) skok[id]++ } } else if(get_entity_flags(id) & FL_ONGROUND) skok[id] = 0 return PLUGIN_CONTINUE }
Lelek
22.10.2008
P.S Miczu wiesz jak zrobić coś takiego że unsera będzie podpalało i zabierało 5 hp w ciągu 1 sekundy aż będzie dead
MafiaDL
22.10.2008
P.S Miczu wiesz jak zrobić coś takiego że unsera będzie podpalało i zabierało 5 hp w ciągu 1 sekundy aż będzie dead
to masz w amx_super
burn