|
楼主 |
发表于 2015-1-7 12:57:10
|
显示全部楼层
来自 中国–广东–湛江
求救大婶们加,刀杀效果,雷杀效果,每局都从1kill开始
本帖最后由 郑林轩 于 2015-1-9 03:22 编辑
[mw_shl_code=pawn,true]/*
--------------------------------------------------------------------------------
Web URL: http://t.qq.com/k1nader
E-M@IL: mailto: jon.ray@qq.com
--------------------------------------------------------------------------------
*/
#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[9], g_iKillCount[33], Float:g_fKillTime[33];
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[128];
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[id] = 0;
g_fKillTime[id] = 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[killer]) > 5.0)
g_iKillCount[killer] = 0;
g_fKillTime[killer] = get_gametime();
g_iKillCount[killer]++;
g_iKillCount[victim] = 0;
if (g_iKillCount[killer] > 9)
g_iKillCount[killer] = 1;
if (9 > (g_iKillCount[killer] - 1) >= 0)
{
ShowSprView(killer, g_iSprindex[g_iKillCount[killer] - 1]);
if (headshot)
client_cmd(killer, "spk ^"vox/headshot.wav^"");
else
{
new szWord[32];
num_to_word(g_iKillCount[killer], szWord, charsmax(szWord));
client_cmd(killer, "spk ^"vox/%s kill^"", szWord);
}
}
}
}
stock ShowSprView(killer, sprent)
{
new Float:fOrigin[3], Float:vDes[3];
pev(killer, pev_origin, fOrigin);
velocity_by_aim(killer, 130, vDes);
vDes[0] = vDes[0] + fOrigin[0];
vDes[1] = vDes[1] + fOrigin[1];
vDes[2] = vDes[2] + fOrigin[2] + 50.0;
engfunc(EngFunc_MessageBegin, MSG_ONE, SVC_TEMPENTITY, vDes, killer);
{
write_byte(TE_GLOWSPRITE);
engfunc(EngFunc_WriteCoord, vDes[0]);
engfunc(EngFunc_WriteCoord, vDes[1]);
engfunc(EngFunc_WriteCoord, vDes[2]);
write_short(sprent);
write_byte(10);
write_byte(2);
write_byte(255);
}
message_end();
}[/mw_shl_code] |
|