Quote:
Originally Posted by ConnorMcLeod
PHP Code:
new const Sounds[14][] = { "next-version/double_kill.wav", "next-version/triple_kill.wav", "next-version/mega_kill.wav",
PHP Code:
else if(Streak[Attacker] >= 2) client_cmd(0,"spk %s",Sounds[Streak[Attacker]])
How strange is it !!!!!!
|
Sorry
,I am Stupid :p...by the way,you said How strange is it!,I am not like u making plugins,but,I try to do the best what I can,if you have a suggestion to how to made my code more efficient,please,tell me.
Code..
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#pragma semicolon 1
/* Definition */
#define IsPlayer(%1) (1 <= %1 <= MaxPlayers)
/* Sounds */
new const FirstBlood[] = "next-version/firstblood.wav";
new const HeadShot[] = "next-version/headshot.wav";
new const Sounds[14][] =
{
"next-version/double_kill.wav",
"next-version/triple_kill.wav",
"next-version/mega_kill.wav",
"next-version/ultra_kill.wav",
"next-version/monster_kill.wav",
"next-version/rampage.wav",
"next-version/ownage.wav",
"next-version/killing_spree.wav",
"next-version/dominating.wav",
"next-version/whicked_sick.wav",
"next-version/unstoppable.wav",
"next-version/holyshit.wav",
"next-version/godlike.wav",
"next-version/combowhore.wav"
};
/* Array */
new Streak[33];
/* Players */
new MaxPlayers;
/* Boolean */
new bool:IsFirstBlood;
public plugin_precache()
{
precache_sound(FirstBlood);
precache_sound(HeadShot);
for(new i = 0;i < sizeof Sounds;i++)
precache_sound(Sounds[i]);
IsFirstBlood = true;
}
public plugin_init()
{
/* Plugin Registration */
register_plugin("[NV] Ultimate Sounds","0.0.1","#8 SickneSS");
/* Players */
MaxPlayers = get_maxplayers();
/* Event */
register_event("DeathMsg","EventDeathMsg","a");
register_event("TextMsg","EventGameWill","a","2&#Game_w");
}
public client_putinserver(id)
Streak[id] = 0;
public client_disconnect(id)
Streak[id] = 0;
public EventDeathMsg()
{
new Attacker = read_data(1);
new Victim = read_data(2);
new IsHeadShot = read_data(3);
if(Attacker != Victim && IsPlayer(Attacker))
{
Streak[Attacker]++;
Streak[Victim] = 0;
if(IsFirstBlood)
{
client_cmd(0,"spk %s",FirstBlood);
if(IsHeadShot)
set_task(0.30,"cmdHeadShot");
IsFirstBlood = false;
}
if(IsHeadShot && Streak[Attacker] <= 1)
client_cmd(0,"spk %s",HeadShot);
if(Streak[Attacker] >= 2)
{
client_cmd(0,"spk %s",Sounds[Streak[Attacker]-2]);
if(IsHeadShot)
set_task(0.30,"cmdHeadShot");
}
}
return PLUGIN_CONTINUE;
}
public cmdHeadShot()
client_cmd(0,"spk %s",HeadShot);
public EventGameWill()
{
for(new i = 1;i <= MaxPlayers;i++)
Streak[i] = 0;
IsFirstBlood = true;
}