Visada bhop
Posted: 2012 Apr 27 21:47
Reikia plugino, kuris padarytų, kad visi serve esantys žaidėjai visalaika bhopintų t.y. niekada nestovėtų ant žemės.
Code: Select all
#include <amxmodx>#include <amxmisc>#include <engine> #define FL_WATERJUMP (1<<11)#define FL_ONGROUND (1<<9) new bhop[33] public plugin_init() { register_concmd("amx_bhop", "cmdBhop", ADMIN_SLAY, "<name or #userid> to enable/disable bhop")} public cmdBhop(id, level, cid) { if (!cmd_access(id, level, cid, 2)) return PLUGIN_HANDLED new arg[32] read_argv(1, arg, charsmax(arg)) new player = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF) if (!player) return PLUGIN_HANDLED new name[33] get_user_name(player, name, charsmax(name)) if(bhop[player]) { bhop[player] = false console_print(id, "[AMXX] Bunny hop disabled on %s", name) // Kokie nors chat messages } else { bhop[player] = true console_print(id, "[AMXX] Bunny hop enabled on %s", name) // Ir cia } return PLUGIN_HANDLED} public client_disconnect(id) { bhop[id] = false} public client_PreThink(id) { if (!bhop[id] || !is_user_alive(id)) return PLUGIN_CONTINUE entity_set_float(id, EV_FL_fuser2, 0.0) 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}