|
本帖最后由 蓝染_惣右介 于 2012-7-27 18:51 编辑
哈哈,不好意思各位大神又麻烦你们啦。
不知道能否能帮我这个源码加个【C权限】
源码如下,这是个连跳的源码,希望可以成功
最好可以加个重力减轻,就是说如果上一个地方失败了,掉下来了不会摔伤。{:soso_e100:}- #include <amxmodx>
- #include <amxmisc>
- #include <engine>
- #include <float>
- new jumpnum[33] = 0
- new bool:dojump[33] = false
- public plugin_init()
- {
- register_plugin("MultiJump","1.0","twistedeuphoria")
- register_cvar("amx_maxjumps","1")
- }
- public client_putinserver(id)
- {
- jumpnum[id] = 0
- dojump[id] = false
- }
- public client_disconnect(id)
- {
- jumpnum[id] = 0
- dojump[id] = false
- }
- public client_PreThink(id)
- {
- new nbut = get_user_button(id)
- new obut = get_user_oldbutton(id)
- if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
- {
- if(jumpnum[id] < get_cvar_num("amx_maxjumps"))
- {
- dojump[id] = true
- jumpnum[id]++
- return PLUGIN_CONTINUE
- }
- }
- if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
- {
- jumpnum[id] = 0
- return PLUGIN_CONTINUE
- }
- return PLUGIN_CONTINUE
- }
- public client_PostThink(id)
- {
- if(dojump[id] == true)
- {
- 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)
- dojump[id] = false
- return PLUGIN_CONTINUE
- }
- return PLUGIN_CONTINUE
- }
复制代码 |
|