#include<amxmisc>
#include<engine>
#include<hamsandwich>
#include<fakemeta>
#include<cstrike>
#include<colorChat>
new jumpnum[33]
new bool:dojump[33]
new allowMj[33]
new gCost = 800,//浠锋牸
gAcce = ADMIN_KICK // 鏉冮檺c
public plugin_init(){
register_plugin("[XY] Multi Jump","0.1","xy")
RegisterHam(Ham_Spawn, "player", "fwPlayerSpawn", 1)
register_cvar("amx_maxjumps","1")//鍙湪绌轰腑璺冲灏戞
register_clcmd("say /mj","cmdBuyMj")
}
public fwPlayerSpawn(id) allowMj[id] = 0
public cmdBuyMj(id){
if(!access(id,gAcce)){
client_print(id,print_center,"姝や负浼氬憳閬撳叿,闇€鎺堟潈")
return 1
}
new um = cs_get_user_money(id) - gCost
if(um < 0){
client_print(id,print_center,"閲戝竵涓嶈冻")
return 1
}
if(allowMj[id]){
client_print(id,print_center,"浣犲凡缁忚喘涔颁簡楂樿烦鍗?)
return 1
}
allowMj[id] = 1
cs_set_user_money(id,um)
new name[32]
get_user_name(id,name,31)
ColorChat(id, GREEN, "^x04鈥荤偣鐑熸彁绀衡€籢x03 %s ^x04璐拱浜嗕竴寮燸x03銆愰珮璺冲崱銆?^x01浠栧彲鑳藉湪鏌愬闃翠汉,澶у灏忓績!",name)
return 1
}
public client_putinserver(id){
allowMj[id] = jumpnum[id] = 0
dojump[id] = false
}
public client_disconnect(id)
{
jumpnum[id] = 0
dojump[id] = false
}
public client_PreThink(id){
if(!allowMj[id]) return
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
}
}
if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
jumpnum[id] = 0
}
public client_PostThink(id)
{
if(dojump[id])
{
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
}
}
|