搜索
查看: 2002|回复: 0

麻烦Rulzy进来帮帮忙

[复制链接]
发表于 2008-7-24 21:36:47 | 显示全部楼层 |阅读模式 来自 中国–海南–海口
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
/*Description:
1) Adds a gravity command which gives an individual player a specific amount of gravity
which remains until player's death, in which case it is set back to normal (800).
2) Allows the players to buy their own gravities.
Credits:
v3x for some coding help which I figured out worked 3 months later. :)
     Changelog
      1.0 - Original Coding
      1.1 - Added Description/Credits/Changelog
      1.2 - Coding fixing.
      1.3 - Coding fixing.
      1.4 - Coding fixing.
      1.5 - Coding fixing - hopefully release version.*/
new arg1[32]
new arg2[10]
new Float:g_fGravity[33];

public plugin_init()
{
register_plugin("Personal Gravity", "1.5", "SatanWoJ")
register_concmd("amx_pgrav", "gravity", ADMIN_KICK, "<nick> <gravity>")
register_clcmd("say buy", "bgrav", 1)
register_event("ResetHUD", "player_spawn", "b");  
register_event("DeathMsg", "hook_death", "a")
}
//-----------------------------------------------------------------------------
public gravity(id, level, cid)
{
if(!cmd_access(id, level, cid, 2))
{
  return PLUGIN_HANDLED;
}
read_argv(1, arg1, 31)
read_argv(2, arg2, 9)
new target = cmd_target(id, arg1, 15)
new Float:amount = str_to_float(arg2)/800
set_user_gravity(target, amount)
g_fGravity[id] = amount
return PLUGIN_CONTINUE
}
//-----------------------------------------------------------------------------
public bgrav(id)
{
if(!is_user_alive(id))
{
  return PLUGIN_HANDLED;
}  
        new money = cs_get_user_money(id)
new Float:grav = get_user_gravity(id)
if(money <= 3499)
{
  client_print(id, print_chat, "")
  return PLUGIN_HANDLED
}
  else if(grav == 0.35)
   {
    client_print(id, print_chat, "")
    return PLUGIN_HANDLED
   }
   else
   {
     cs_set_user_money(id, money-15000)
     set_user_gravity(id, 0.35)
     return PLUGIN_HANDLED
   }
return PLUGIN_HANDLED
}
//-----------------------------------------------------------------------------
public hook_death()
{
new Victim = read_data(2)
g_fGravity[Victim] = 1.0
return PLUGIN_CONTINUE
}  
//-----------------------------------------------------------------------------
public client_connect(id)
{
g_fGravity[id] = 1.0
}
//-----------------------------------------------------------------------------
public player_spawn(id)
{
set_user_gravity(id, g_fGravity[id])
return PLUGIN_CONTINUE
}  




我想加一个时间限制,多少秒钟后才能开始购买,然后就是购买后这种效果的能够维持多少时间...谢了
游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表