//缓速设定
#include <amxmodx>
#include <fakemeta>
g_speed[33] // 定义变数设定
public plugin_init()//控制台
{
register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")//人物思考
}
public fw_PlayerPreThink(id)
{
if(!is_user_alive(id))
return
if (g_speed[id])
{
fm_set_user_maxspeed(id, 130.0) // 只能用浮点设定
}
return
}
public XXX //这边设定道具 使用长度|呼叫用
{
g_speed[ivictim] = 1 // 开启缓速
set_task( 5.0 , "SHARED_ResetMaxSpeed", iVictim+1234 );//5秒后关闭缓速
}
public SHARED_ResetMaxSpeed(taskid)
{
new ivictim = taskid - 1234
remove_task(1234) // 删除多余的值
g_speed[ivictim] = 0 //关闭缓速
}
stock fm_set_user_maxspeed(index, Float:speed = -1.0) //速度设定
{
engfunc(EngFunc_SetClientMaxspeed, index, speed);
set_pev(index, pev_maxspeed, speed);
return 1;
}
我只帮你做出缓速效果,后来还是要靠你自己啰....