郑林轩 发表于 2015-1-9 03:24:52

求救大婶们加,刀杀效果,雷杀效果,每局都从1kill开始



#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN"SHOWKILL"
#define VERSION "1.0"
#define AUTHOR"k1nader"
#define LOADING "^n^t%s v%s, Copyright (C) 2011 by %s^n"

new const g_Sounds[][] =
{
    "vox/zero.wav",
    "vox/one.wav",
    "vox/two.wav",
    "vox/three.wav",
    "vox/four.wav",
    "vox/five.wav",
    "vox/six.wav",
    "vox/seven.wav",
    "vox/eight.wav",
    "vox/nine.wav",
    "vox/ten.wav"
}

new g_iSprindex, g_iKillCount, Float:g_fKillTime;

public plugin_precache()
{
    new i;
    for (i = 0; i < sizeof g_Sounds; i++)
      engfunc(EngFunc_PrecacheSound, g_Sounds);

    engfunc(EngFunc_PrecacheSound, "vox/headshot.wav");

    new precachestr;
    for (i = 0; i < 9; i++)
    {
      formatex(precachestr, charsmax(precachestr), "sprites/kill_%d.spr", i + 1);
      g_iSprindex = engfunc(EngFunc_PrecacheModel, precachestr);
    }
}

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR);
    server_print(LOADING, PLUGIN, VERSION, AUTHOR);
    register_event("DeathMsg", "EventDeathMsg", "a")
}

public client_connect(id)
{
    g_iKillCount = 0;
    g_fKillTime = 0.0;
}

public EventDeathMsg()
{
    new killer = read_data(1);
    new victim = read_data(2);
    new headshot = read_data(3);

    if (is_user_connected(killer))
    {
      if ((get_gametime() - g_fKillTime) > 5.0)
            g_iKillCount = 0;

      g_fKillTime = get_gametime();

      g_iKillCount++;
      g_iKillCount = 0;

      if (g_iKillCount > 9)
            g_iKillCount = 1;

      if (9 > (g_iKillCount - 1) >= 0)
      {
            ShowSprView(killer, g_iSprindex - 1]);
            if (headshot)
                client_cmd(killer, "spk ^"vox/headshot.wav^"");
            else
            {
                new szWord;
                num_to_word(g_iKillCount, szWord, charsmax(szWord));
                client_cmd(killer, "spk ^"vox/%s kill^"", szWord);
            }
      }
    }
}

stock ShowSprView(killer, sprent)
{
    new Float:fOrigin, Float:vDes;

    pev(killer, pev_origin, fOrigin);
    velocity_by_aim(killer, 130, vDes);

    vDes = vDes + fOrigin;
    vDes = vDes + fOrigin;
    vDes = vDes + fOrigin + 50.0;

    engfunc(EngFunc_MessageBegin, MSG_ONE, SVC_TEMPENTITY, vDes, killer);
    {
      write_byte(TE_GLOWSPRITE);
      engfunc(EngFunc_WriteCoord, vDes);
      engfunc(EngFunc_WriteCoord, vDes);
      engfunc(EngFunc_WriteCoord, vDes);
      write_short(sprent);
      write_byte(10);
      write_byte(2);
      write_byte(255);
    }
    message_end();
}

love009 发表于 2015-1-23 03:01:06

什么意思,我不懂

mxgcs 发表于 2015-2-11 04:55:35

他应该是说没有显示刀杀,跟雷杀的spr

sing19 发表于 2015-2-11 08:11:23

把插件需要用的文件发上我看看

zzx767545521 发表于 2015-4-12 20:35:15

看不懂= =

dw312382354 发表于 2020-7-14 01:25:10

加一个开局事件就OK了。
页: [1]
查看完整版本: 求救大婶们加,刀杀效果,雷杀效果,每局都从1kill开始