Код
#include <amxmodx>
#include <cstrike>
#include <csx>
#define PLUGIN "CS: Postal2-fun stats(T)"
#define VERSION "T 1.1"
#define AUTHOR "Brute"
#define MAX_PLAYERS 32+1
#define TEAM1 1 //Ter. team
#define TEAM2 2 //Ct. team
#define SPECU 3 //Spec
#define ALLUS 4 //All
#define SOUNDDIR "postal2" //def. sounds dir
#define HC 100 //start hud channel
#define MAX_MSG_LEN 20 //Max. messages len
#define MSG_ROUND 0
#define MSG_NUM_01 1
#define MSG_NUM_02 2
#define MSG_NUM_03 3
#define MSG_NUM_04 4
#define MSG_NUM_05 5
#define MSG_NUM_06 6
#define MSG_NUM_07 7
#define MSG_NUM_08 8
#define MSG_NUM_09 9
#define MSG_NUM_10 10
#define MSG_THE_END 11
#define MSG_HEADSHOT 12
#define MSG_KNIFEKILL 13
#define MSG_TK 14
#define MSG_SUICIDE 15
#define MSG_DOUBLEKILL 16
#define MSG_MULTIKILL 17
#define MSG_ULTRAKILL 18
#define MSG_KILLINGSPREE 19
#define MSG_RAMPAGE 20
#define MSG_UNSTOPPABLE 21
#define MSG_MONSTERKILL 22
#define MSG_GODLIKE 23
#define MSG_WON 24
#define MSG_LOST 25
#define MSG_PLANTEDBOMB 26
#define MSG_DROPPEDBOMB 27
#define MSG_PICKEDBOMB 28
#define MSG_PLANTINGBOMB 29
#define MSG_DEFUSINGBOMB 30
#define MSG_DEFUSEDBOMB 31
#define MSG_FAILEDDEFUSE 32
#define MSG_EXPLODE 33
#define MAX_MESS_LOST 5
#define MAX_MESS_WON 5
#define MAX_MESS_SCORE_T 5
#define MAX_MESS_SCORE_CT 5
#define MAX_MESS_EVENTS 21
#define MAX_MESS_HEADSHOT 11
#define MAX_MESS_KNIFE_KILL 7
#define MAX_MESS_TK 5
#define MAX_MESS_KILLER_SCORE 10
new SoundListLost[MAX_MESS_LOST][] =
{
"AnnouncerYouLost",
"AnnouncerYouLost2",
"AnnouncerYourTeamLost",
"AnnouncerYourTeamLost2",
"AnnouncerYourTeamLost3"
}
new SoundListWon[MAX_MESS_WON][] =
{
"AnnouncerYouWon",
"AnnouncerYouWon2",
"AnnouncerYourTeamWon",
"AnnouncerYourTeamWon2",
"AnnouncerYourTeamWon3"
}
new SoundListScoreT[MAX_MESS_SCORE_T][] =
{
"AnnouncerTeamBandScore",
"AnnouncerTeamDudeScore",
"AnnouncerTeamFanaticsScore",
"AnnouncerTeamGimpScore",
"AnnouncerTeamZealotsScore"
}
new SoundListScoreCT[MAX_MESS_SCORE_CT][] =
{
"AnnouncerTeamCopsScore",
"AnnouncerTeamHoodScore",
"AnnouncerTeamMilitaryScore",
"AnnouncerTeamRWSScore",
"AnnouncerTeamSWATScore"
}
new SoundListEvents[MAX_MESS_EVENTS][] =
{
"AnnouncerGrudgeMatch",
"Announcer1",
"Announcer2",
"Announcer3",
"Announcer4",
"Announcer5",
"Announcer6",
"Announcer7",
"Announcer8",
"Announcer9",
"Announcer10",
"Announcer30sec",
"Announcer1min",
"Announcer3min",
"Announcer5min",
"AnnouncerTheirFlagDropped",
"AnnouncerTheirFlagReturned",
"AnnouncerTheirFlagTaken",
"AnnouncerYourFlagDropped",
"AnnouncerYourFlagReturned",
"AnnouncerYourFlagTaken"
}
new SoundListHeadShot[MAX_MESS_HEADSHOT][] =
{
"dude_hehhehheh",
"dude_onebecauseican",
"dude_onebecauseihave",
"dude_onecauseugly",
"dude_oneforbebo",
"dude_oneforjohnny",
"dude_oneforthepope",
"dude_oneforyourmother",
"dude_thatstheone",
"dude_viagraworks",
"dude_yesss"
}
new SoundListKnifeKill[MAX_MESS_KNIFE_KILL][] =
{
"Dude_Machete_Daddy",
"Dude_Machete_Fingers",
"Dude_Machete_ImGood",
"Dude_Machete_ThereItIs",
"Dude_UseBlade_1",
"Dude_UseBlade_2",
"Dude_UseBlade_3"
}
new SoundListSelfKill[][] =
{
"dude_iregretnothing"
}
new SoundListTK[MAX_MESS_TK][] =
{
"dude_fuckyou",
"dude_icanrelatebro",
"dude_imsoryapparently",
"dude_onlymyweapon",
"dude_someonestolemy"
}
new SoundListKillerScore[MAX_MESS_KILLER_SCORE][] =
{
"dude_andonetogrowon",
"dude_buttsauce",
"dude_dontcrowdtheres",
"dude_getdownifyoudont",
"dude_getthefuckdown",
"dude_haveaniceday",
"dude_heresyertaxrelief",
"dude_ifyousayso",
"dude_movealong",
"dude_yougogirl"
}
new KillerScore[MAX_PLAYERS]
new HeadShot[MAX_PLAYERS]
new TeamScore[3]
new bool:BlockEvents = false
new TimerC4
new RoundTime
new RoundNumber
new DoubleKiller
new Float:DoubleKillTime
new Bomb_Planter
//-----MAIN PART-----------------------------------------------------------
public KillerScoreMsg
public KillerScoreSound
public DoubleKillMsg
public DoubleKillSound
public KnifeKillMsg
public KnifeKillSound
public TeamKillMsg
public TeamKillSound
public HeadShotMsg
public HeadShotSound
public SuicideMsg
public SuicideSound
public TeamWinMsg
public TeamWinSound
public TeamScoreSound
public BombPickUpMsg
public BombPickUpSound
public BombDropMsg
public BombDropSound
public BombPlantingMsg
public BombDefusingMsg
public BombDefusedMsg
public BombExplodeMsg
public BombPlantedMsg
public C4TimerMsg
public C4TimerSound
public RoundNumberMsg
public RoundNumberSound
public RoundTimeMsg
public RoundTimeSound
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("postal2_enabled", "1")
register_cvar("postal2_ffa", "0")
register_cvar("postal2_mb", "1")
register_event("TextMsg", "eventRestartRound", "a", "2&#Game_C", "2&#Game_w")
register_event("SendAudio", "eventTeamWinT", "a", "2&%!MRAD_terwin")
register_event("SendAudio", "eventTeamWinCT", "a", "2&%!MRAD_ctwin")
register_event("StatusIcon", "StatusC4", "be", "1=1", "1=2", "2=c4")
register_logevent("eventNewRound", 2, "1=Round_Start")
register_logevent("eventBombPickUp", 3, "2=Got_The_Bomb")
register_logevent("eventBombDrop", 3, "2=Dropped_The_Bomb")
register_dictionary("postal2.txt")
register_message(get_user_msgid("SendAudio"), "blockSendAudio")
register_message(get_user_msgid("TextMsg"), "blockTextMsg")
}
public plugin_cfg()
{
new p2_addStast[] = "amx_statscfg add ^"%s^" %s"
server_cmd(p2_addStast, "P2 KILLER SCORE MSG", "KillerScoreMsg")
server_cmd(p2_addStast, "P2 KILLER SCORE SOUND", "KillerScoreSound")
server_cmd(p2_addStast, "P2 DOUBLE KILL MSG", "DoubleKillMsg")
server_cmd(p2_addStast, "P2 DOUBLE KILL SOUND", "DoubleKillSound")
server_cmd(p2_addStast, "P2 KNIFE KILL MSG", "KnifeKillMsg")
server_cmd(p2_addStast, "P2 KNIFE KILL SOUND", "KnifeKillSound")
server_cmd(p2_addStast, "P2 TEAM KILL MSG", "TeamKillMsg")
server_cmd(p2_addStast, "P2 TEAM KILL SOUND", "TeamKillSound")
server_cmd(p2_addStast, "P2 HEADSHOT MSG", "HeadShotMsg")
server_cmd(p2_addStast, "P2 HEADSHOT SOUND", "HeadShotSound")
server_cmd(p2_addStast, "P2 SUICIDE MSG", "SuicideMsg")
server_cmd(p2_addStast, "P2 SUICIDE SOUND", "SuicideSound")
server_cmd(p2_addStast, "P2 TEAM WIN MSG", "TeamWinMsg")
server_cmd(p2_addStast, "P2 TEAM WIN SOUND", "TeamWinSound")
server_cmd(p2_addStast, "P2 TEAM SCORE SOUND", "TeamScoreSound")
server_cmd(p2_addStast, "P2 BOMB PICKUP MSG", "BombPickUpMsg")
server_cmd(p2_addStast, "P2 BOMB PICKUP SOUND", "BombPickUpSound")
server_cmd(p2_addStast, "P2 BOMB DROP MSG", "BombDropMsg")
server_cmd(p2_addStast, "P2 BOMB DROP SOUND", "BombDropSound")
server_cmd(p2_addStast, "P2 BOMB PLANTING MSG", "BombPlantingMsg")
server_cmd(p2_addStast, "P2 BOMB DEFUSING MSG", "BombDefusingMsg")
server_cmd(p2_addStast, "P2 BOMB DEFUSED MSG", "BombDefusedMsg")
server_cmd(p2_addStast, "P2 BOMB EXPLODE MSG", "BombExplodeMsg")
server_cmd(p2_addStast, "P2 BOMB PLANTED MSG", "BombPlantedMsg")
server_cmd(p2_addStast, "P2 C4 TIMER MSG", "C4TimerMsg")
server_cmd(p2_addStast, "P2 C4 TIMER SOUND", "C4TimerSound")
server_cmd(p2_addStast, "P2 ROUND NUMBER MSG", "RoundNumberMsg")
server_cmd(p2_addStast, "P2 ROUND NUMBER SOUND", "RoundNumberSound")
server_cmd(p2_addStast, "P2 ROUND TIME MSG", "RoundTimeMsg")
server_cmd(p2_addStast, "P2 ROUND TIME SOUND", "RoundTimeSound")
}
public eventRestartRound()
{
if(info_enabled())
{
remove_task(777)
remove_task(555)
RoundNumber = 0
TeamScore[TEAM1] = 0
TeamScore[TEAM2] = 0
for(new i=0; i<MAX_PLAYERS; i++)
{
KillerScore[i] = 0
HeadShot[i] = 0
}
TimerC4 = get_cvar_num("mp_c4timer")
}
}
public eventNewRound()
{
if(info_enabled())
{
BlockEvents = false
remove_task(777)
remove_task(555)
RoundNumber++
if(RoundNumberSound)
p2sound("AnnouncerGrudgeMatch", ALLUS, 0)
if(RoundNumberMsg)
p2Message(0, 0, MSG_ROUND, ALLUS, RoundNumber, 0)
RoundTime = floatround(get_cvar_float("mp_roundtime") * 60.0, floatround_floor)
set_task(1.0, "TimerRoundTime", 555, "", 0, "b")
}
}
public TimerRoundTime()
{
RoundTime--
switch(RoundTime)
{
case 300:
{
if(RoundTimeSound && !BlockEvents)
p2sound("Announcer5min", ALLUS, 0)
if(RoundTimeMsg && !BlockEvents)
p2Message(0, 0, MSG_THE_END, ALLUS, RoundTime, 0)
}
case 180:
{
if(RoundTimeSound && !BlockEvents)
p2sound("Announcer3min", ALLUS, 0)
if(RoundTimeMsg && !BlockEvents)
p2Message(0, 0, MSG_THE_END, ALLUS, RoundTime, 0)
}
case 60:
{
if(RoundTimeSound && !BlockEvents)
p2sound("Announcer1min", ALLUS, 0)
if(RoundTimeMsg && !BlockEvents)
p2Message(0, 0, MSG_THE_END, ALLUS, RoundTime, 0)
}
case 30:
{
if(RoundTimeSound && !BlockEvents)
p2sound("Announcer30sec", ALLUS, 0)
if(RoundTimeMsg && !BlockEvents)
p2Message(0, 0, MSG_THE_END, ALLUS, RoundTime, 0)
}
}
if(0 < RoundTime < 11 && !BlockEvents)
{
if(RoundTimeSound)
p2sound(SoundListEvents[RoundTime], ALLUS, 0)
if(RoundTimeMsg)
p2Message(0, 0, MSG_THE_END, ALLUS, RoundTime, 0)
}
}
//-----KILL EVENT----------------------------------------------------------
public client_death(killer, victim, wpnindex, hitplace, TK)
{
if(info_enabled())
{
KillerScore[victim] = 0
HeadShot[victim] = 0
if(!TK && killer != victim)
{
KillerScore[killer]++
if(wpnindex == CSW_KNIFE)
eventKnifeKill(killer, victim)
if(hitplace == HIT_HEAD)
{
eventHeadShot(killer, victim)
HeadShot[killer]++
}
eventKillerScore(killer, KillerScore[killer], HeadShot[killer])
eventDoubleKill(killer)
}
else if(TK && killer != victim && !info_ffa())
{
KillerScore[killer] = 0
HeadShot[killer] = 0
eventTK(killer, victim)
eventDoubleKill(killer)
}
else if(TK && killer != victim && info_ffa())
{
KillerScore[killer]++
if(wpnindex == CSW_KNIFE)
eventKnifeKill(killer, victim)
if(hitplace == HIT_HEAD)
{
eventHeadShot(killer, victim)
HeadShot[killer]++
}
eventKillerScore(killer, KillerScore[killer], HeadShot[killer])
eventDoubleKill(killer)
}
else if(killer == victim)
{
eventSelfKill(victim)
}
}
}
public eventKillerScore(killer, kills, headshots)
{
if(!BlockEvents)
{
switch(kills)
{
case 3:
{
if(KillerScoreSound)
p2sound(SoundListKillerScore[info_random(MAX_MESS_KILLER_SCORE)], ALLUS, killer)
if(KillerScoreMsg)
p2Message(killer, 0, MSG_MULTIKILL, ALLUS, kills, headshots)
}
case 5:
{
if(KillerScoreSound)
p2sound(SoundListKillerScore[info_random(MAX_MESS_KILLER_SCORE)], ALLUS, killer)
if(KillerScoreMsg)
p2Message(killer, 0, MSG_ULTRAKILL, ALLUS, kills, headshots)
}
case 6:
{
if(KillerScoreSound)
p2sound(SoundListKillerScore[info_random(MAX_MESS_KILLER_SCORE)], ALLUS, killer)
if(KillerScoreMsg)
p2Message(killer, 0, MSG_KILLINGSPREE, ALLUS, kills, headshots)
}
case 8:
{
if(KillerScoreSound)
p2sound(SoundListKillerScore[info_random(MAX_MESS_KILLER_SCORE)], ALLUS, killer)
if(KillerScoreMsg)
p2Message(killer, 0, MSG_RAMPAGE, ALLUS, kills, headshots)
}
case 9:
{
if(KillerScoreSound)
p2sound(SoundListKillerScore[info_random(MAX_MESS_KILLER_SCORE)], ALLUS, killer)
if(KillerScoreMsg)
p2Message(killer, 0, MSG_UNSTOPPABLE, ALLUS, kills, headshots)
}
case 11:
{
if(KillerScoreSound)
p2sound(SoundListKillerScore[info_random(MAX_MESS_KILLER_SCORE)], ALLUS, killer)
if(KillerScoreMsg)
p2Message(killer, 0, MSG_MONSTERKILL, ALLUS, kills, headshots)
}
case 12:
{
if(KillerScoreSound)
p2sound(SoundListKillerScore[info_random(MAX_MESS_KILLER_SCORE)], ALLUS, killer)
if(KillerScoreMsg)
p2Message(killer, 0, MSG_GODLIKE, ALLUS, kills, headshots)
}
}
}
}
public eventDoubleKill(killer)
{
if(!BlockEvents)
{
new Float:CurTime = get_gametime()
if(DoubleKiller == killer && DoubleKillTime == CurTime)
{
if(DoubleKillSound)
p2sound(SoundListHeadShot[info_random(MAX_MESS_HEADSHOT)], ALLUS, killer)
if(DoubleKillMsg)
p2Message(killer, 0, MSG_DOUBLEKILL, ALLUS, 0, 0)
}
DoubleKiller = killer
DoubleKillTime = CurTime
}
}
public eventKnifeKill(killer, victim)
{
if(!BlockEvents)
{
if(KnifeKillSound)
p2sound(SoundListKnifeKill[info_random(MAX_MESS_KNIFE_KILL)], ALLUS, killer)
if(KnifeKillMsg)
p2Message(killer, victim, MSG_KNIFEKILL, ALLUS, 0, 0)
}
}
public eventHeadShot(killer, victim)
{
if(!BlockEvents)
{
if(HeadShotSound)
p2sound(SoundListHeadShot[info_random(MAX_MESS_HEADSHOT)], ALLUS, killer)
if(HeadShotMsg)
p2Message(killer, victim, MSG_HEADSHOT, ALLUS, 0, 0)
}
}
public eventTK(killer, victim)
{
if(!BlockEvents)
{
if(TeamKillSound)
p2sound(SoundListTK[info_random(MAX_MESS_TK)], ALLUS, killer)
if(TeamKillMsg)
p2Message(killer, victim, MSG_TK, ALLUS, 0, 0)
}
}
public eventSelfKill(victim)
{
if(!BlockEvents)
{
if(SuicideSound)
p2sound(SoundListSelfKill[info_random(1)], ALLUS, victim)
if(SuicideMsg)
p2Message(victim, 0, MSG_SUICIDE, ALLUS, 0, 0)
}
}
//-----TEAM WIN EVENT----------------------------------------------------------
public eventTeamWinCT()
{
if(!BlockEvents)
{
BlockEvents = true
TimerC4 = get_cvar_num("mp_c4timer")
TeamScore[TEAM2]++
remove_task(777)
remove_task(555)
if(TeamWinSound)
p2sound(SoundListWon[info_random(MAX_MESS_WON)], TEAM2, 0)
if(TeamWinSound)
p2sound(SoundListLost[info_random(MAX_MESS_LOST)], TEAM1, 0)
if(TeamWinMsg)
{
p2Message(0, 0, MSG_WON, TEAM2, RoundNumber, 0)
p2Message(0, 0, MSG_LOST, TEAM1, RoundNumber, 0)
}
set_task(2.0, "eventScoreCT")
}
}
public eventTeamWinT()
{
if(!BlockEvents)
{
BlockEvents = true
TimerC4 = get_cvar_num("mp_c4timer")
TeamScore[TEAM1]++
remove_task(777)
remove_task(555)
if(TeamWinSound)
p2sound(SoundListWon[info_random(MAX_MESS_WON)], TEAM1, 0)
if(TeamWinSound)
p2sound(SoundListLost[info_random(MAX_MESS_LOST)], TEAM2, 0)
if(TeamWinMsg)
{
p2Message(0, 0, MSG_WON, TEAM1, RoundNumber, 0)
p2Message(0, 0, MSG_LOST, TEAM2, RoundNumber, 0)
}
set_task(2.0, "eventScoreT")
}
}
//-----TEAM SCORE EVENT----------------------------------------------------
public eventScoreCT()
{
if(TeamScoreSound)
p2sound(SoundListScoreCT[info_random(MAX_MESS_SCORE_CT)], ALLUS, 0)
}
public eventScoreT()
{
if(TeamScoreSound)
p2sound(SoundListScoreT[info_random(MAX_MESS_SCORE_T)], ALLUS, 0)
}
//-----BOMB EVENT----------------------------------------------------------
public StatusC4(id)
{
if(info_enabled())
{
Bomb_Planter = id
}
}
public eventBombPickUp()
{
if(info_enabled() && !BlockEvents)
{
set_task(0.5, "BombPickUp")
}
}
public BombPickUp()
{
new CsTeams:Team = cs_get_user_team(Bomb_Planter)
switch(CsTeams:Team)
{
case CS_TEAM_T:
{
if(BombPickUpSound)
{
p2sound("AnnouncerYourFlagReturned", TEAM1, 0)
p2sound("AnnouncerTheirFlagReturned", TEAM2, 0)
}
if(BombPickUpMsg)
p2Message(Bomb_Planter, 0, MSG_PICKEDBOMB, ALLUS, 0, 0)
}
case CS_TEAM_CT:
{
if(BombPickUpSound)
{
p2sound("AnnouncerYourFlagTaken", TEAM1, 0)
p2sound("AnnouncerTheirFlagTaken", TEAM2, 0)
}
if(BombPickUpMsg)
p2Message(Bomb_Planter, 0, MSG_PICKEDBOMB, ALLUS, 0, 0)
}
}
}
public eventBombDrop()
{
if(info_enabled() && !BlockEvents)
{
if(BombDropSound)
{
p2sound("AnnouncerYourFlagDropped", TEAM1, 0)
p2sound("AnnouncerTheirFlagDropped", TEAM2, 0)
}
if(BombDropMsg)
p2Message(Bomb_Planter, 0, MSG_DROPPEDBOMB, ALLUS, 0, 0)
}
}
public bomb_planting(planter)
{
if(info_enabled() && BombPlantingMsg && !BlockEvents)
{
p2Message(planter, 0, MSG_PLANTINGBOMB, ALLUS, 0, 0)
}
}
public bomb_defusing(defuser)
{
if(info_enabled() && BombDefusingMsg && !BlockEvents)
{
p2Message(defuser, 0, MSG_DEFUSINGBOMB, ALLUS, 0, 0)
}
}
public bomb_defused(defuser)
{
if(info_enabled() && BombDefusedMsg)
{
p2Message(defuser, 0, MSG_DEFUSEDBOMB, ALLUS, 0, 0)
}
}
public bomb_explode(planter, defuser)
{
if(info_enabled() && BombExplodeMsg)
{
if(defuser)
p2Message(defuser, 0, MSG_FAILEDDEFUSE, ALLUS, 0, 0)
else if(planter)
p2Message(planter, 0, MSG_EXPLODE, ALLUS, 0, 0)
}
}
public bomb_planted(planter)
{
if(info_enabled() && !BlockEvents)
{
remove_task(555)
set_task(1.0, "eventTimerC4", 777, "", 0, "b")
if(BombPlantedMsg)
p2Message(planter, 0, MSG_PLANTEDBOMB, ALLUS, 0, 0)
}
}
public eventTimerC4()
{
TimerC4--
if(TimerC4 == 30 && !BlockEvents)
{
if(C4TimerSound)
p2sound("Announcer30sec", ALLUS, 0)
}
else if(TimerC4 == 60 && !BlockEvents)
{
if(C4TimerSound)
p2sound("Announcer1min", ALLUS, 0)
}
else if(0 < TimerC4 < 11 && !BlockEvents)
{
if(C4TimerSound)
p2sound(SoundListEvents[TimerC4], ALLUS, 0)
if(C4TimerMsg)
p2Message(0, 0, TimerC4, ALLUS, 0, 0)
}
}
//-----SOUND---------------------------------------------------------------
public plugin_precache()
{
if(info_enabled())
{
new sound[128] = 0
for(new i=0;i<MAX_MESS_LOST; i++)
{
format(sound, 127, "%s/%s.wav", SOUNDDIR, SoundListLost[i])
precache_sound(sound)
}
for(new i=0;i<MAX_MESS_WON; i++)
{
format(sound, 127, "%s/%s.wav", SOUNDDIR, SoundListWon[i])
precache_sound(sound)
}
for(new i=0;i<MAX_MESS_SCORE_T; i++)
{
format(sound, 127, "%s/%s.wav", SOUNDDIR, SoundListScoreT[i])
precache_sound(sound)
}
for(new i=0;i<MAX_MESS_SCORE_CT; i++)
{
format(sound, 127, "%s/%s.wav", SOUNDDIR, SoundListScoreCT[i])
precache_sound(sound)
}
for(new i=0;i<MAX_MESS_EVENTS; i++)
{
format(sound, 127, "%s/%s.wav", SOUNDDIR, SoundListEvents[i])
precache_sound(sound)
}
for(new i=0;i<MAX_MESS_HEADSHOT; i++)
{
format(sound, 127, "%s/%s.wav", SOUNDDIR, SoundListHeadShot[i])
precache_sound(sound)
}
for(new i=0;i<MAX_MESS_KNIFE_KILL; i++)
{
format(sound, 127, "%s/%s.wav", SOUNDDIR, SoundListKnifeKill[i])
precache_sound(sound)
}
for(new i=0;i<0; i++)
{
format(sound, 127, "%s/%s.wav", SOUNDDIR, SoundListSelfKill[i])
precache_sound(sound)
}
for(new i=0;i<MAX_MESS_TK; i++)
{
format(sound, 127, "%s/%s.wav", SOUNDDIR, SoundListTK[i])
precache_sound(sound)
}
for(new i=0;i<MAX_MESS_KILLER_SCORE; i++)
{
format(sound, 127, "%s/%s.wav", SOUNDDIR, SoundListKillerScore[i])
precache_sound(sound)
}
}
}
public p2sound(soundname[], ToWhom, id)
{
new players[32], pnum
switch(ToWhom)
{
case TEAM1: get_players(players, pnum, "ceh", "TERRORIST")
case TEAM2: get_players(players, pnum, "ceh", "CT")
case SPECU: get_players(players, pnum, "ceh", "SPECTATOR")
case ALLUS: get_players(players, pnum, "ch")
}
if(id != 0 && is_user_alive(id) && !task_exists(id+600))
{
message_begin(MSG_ALL, 135)
write_byte(1)
write_byte(id)
message_end()
set_task(2.5, "clear_message", id+600)
for(new i=0; i<pnum; i++)
{
client_cmd(players[i], "spk sound/%s/%s.wav", SOUNDDIR, soundname)
}
}
else if(id == 0)
{
for(new i=0; i<pnum; i++)
{
client_cmd(players[i], "spk sound/%s/%s.wav", SOUNDDIR, soundname)
}
}
}
//-----MESSAGES------------------------------------------------------------
public p2Message(id, id2, MSG_ID, ToWhom, param, param2)
{
new players[32], pnum
switch(ToWhom)
{
case TEAM1: get_players(players, pnum, "ceh", "TERRORIST")
case TEAM2: get_players(players, pnum, "ceh", "CT")
case SPECU: get_players(players, pnum, "ceh", "SPECTATOR")
case ALLUS: get_players(players, pnum, "ch")
}
new name[32], name2[32]
if(id != 0)
get_user_name(id, name, 31)
if(id2 != 0)
get_user_name(id2, name2, 31)
for(new i=0; i<pnum; i++)
{
switch(MSG_ID)
{
case MSG_EXPLODE:
{
set_hudmessage(128, 128, 128, -1.0, 0.3, 2, 0.5, 3.0, 0.1, 0.2, -1)
show_hudmessage(players[i], "%L", players[i], "P2_MSG_EXPLODE", name)
}
case MSG_FAILEDDEFUSE:
{
set_hudmessage(128, 128, 128, -1.0, 0.3, 2, 0.5, 3.0, 0.1, 0.2, -1)
show_hudmessage(players[i], "%L", players[i], "P2_MSG_FAILEDDEFUSE", name)
}
case MSG_DEFUSEDBOMB:
{
set_hudmessage(128, 128, 128, -1.0, 0.3, 2, 0.5, 3.0, 0.1, 0.2, -1)
show_hudmessage(players[i], "%L", players[i], "P2_MSG_DEFUSEDBOMB", name)
}
case MSG_DEFUSINGBOMB:
{
set_hudmessage(128, 128, 128, -1.0, 0.3, 2, 0.5, 3.0, 0.1, 0.2, MSG_ID+HC-4)
show_hudmessage(players[i], "%L", players[i], "P2_MSG_DEFUSINGBOMB", name)
}
case MSG_PLANTINGBOMB:
{
set_hudmessage(128, 128, 128, -1.0, 0.3, 2, 0.5, 3.0, 0.1, 0.2, MSG_ID+HC-3)
show_hudmessage(players[i], "%L", players[i], "P2_MSG_PLANTINGBOMB", name)
}
case MSG_PICKEDBOMB:
{
set_hudmessage(128, 128, 128, -1.0, 0.3, 2, 0.5, 3.0, 0.1, 0.2, MSG_ID+HC-2)
show_hudmessage(players[i], "%L", players[i], "P2_MSG_PICKEDBOMB", name)
}
case MSG_DROPPEDBOMB:
{
set_hudmessage(128, 128, 128, -1.0, 0.3, 2, 0.5, 3.0, 0.1, 0.2, MSG_ID+HC-1)
show_hudmessage(players[i], "%L", players[i], "P2_MSG_DROPPEDBOMB", name)
}
case MSG_PLANTEDBOMB:
{
set_hudmessage(128, 128, 128, -1.0, 0.3, 2, 0.5, 3.0, 0.1, 0.2, MSG_ID+HC)
show_hudmessage(players[i], "%L", players[i], "P2_MSG_PLANTEDBOMB", name)
}
case MSG_LOST:
{
set_hudmessage(0, 255, 0, -1.0, 0.45, 2, 0.5, 3.0, 0.1, 0.2, -1)
show_hudmessage(players[i], "%L", players[i], "P2_MSG_LOST", param, TeamScore[TEAM1], TeamScore[TEAM2])
}
case MSG_WON:
{
set_hudmessage(0, 255, 0, -1.0, 0.45, 2, 0.5, 3.0, 0.1, 0.2, -1)
show_hudmessage(players[i], "%L", players[i], "P2_MSG_WON", param, TeamScore[TEAM1], TeamScore[TEAM2])
}
case MSG_GODLIKE:
{
set_hudmessage(35, 0, 245, 0.05, 0.25, 2, 0.1, 5.0, 0.1, 0.2, MSG_ID+HC)
show_hudmessage(players[i], "%L", players[i], "P2_MSG_GODLIKE", name, param, param2)
}
case MSG_MONSTERKILL:
{
set_hudmessage(70, 0, 210, 0.05, 0.32, 2, 0.1, 5.0, 0.1, 0.2, MSG_ID+HC)
show_hudmessage(players[i], "%L", players[i], "P2_MSG_MONSTERKILL", name, param, param2)
}
case MSG_UNSTOPPABLE:
{
set_hudmessage(105, 0, 175, 0.05, 0.40, 2, 0.1, 5.0, 0.1, 0.2, MSG_ID+HC)
show_hudmessage(players[i], "%L", players[i], "P2_MSG_UNSTOPPABLE", name, param, param2)
}
case MSG_RAMPAGE:
{
set_hudmessage(140, 0, 140, 0.05, 0.47, 2, 0.1, 5.0, 0.1, 0.2, MSG_ID+HC)
show_hudmessage(players[i], "%L", players[i], "P2_MSG_RAMPAGE", name, param, param2)
}
case MSG_KILLINGSPREE:
{
set_hudmessage(175, 0, 105, 0.05, 0.55, 2, 0.1, 5.0, 0.1, 0.2, MSG_ID+HC)
show_hudmessage(players[i], "%L", players[i], "P2_MSG_KILLINGSPREE", name, param, param2)
}
case MSG_ULTRAKILL:
{
set_hudmessage(210, 0, 70, 0.05, 0.62, 2, 0.1, 5.0, 0.1, 0.2, MSG_ID+HC)
show_hudmessage(players[i], "%L", players[i], "P2_MSG_ULTRAKILL", name, param, param2)
}
case MSG_MULTIKILL:
{
set_hudmessage(245, 0, 35, 0.05, 0.70, 2, 0.1, 5.0, 0.1, 0.2, MSG_ID+HC)
show_hudmessage(players[i], "%L", players[i], "P2_MSG_MULTIKILL", name, param, param2)
}
case MSG_DOUBLEKILL:
{
set_hudmessage(255, 0, 0, -1.0, 0.85, 2, 0.1, 5.0, 0.1, 0.2, MSG_ID+HC)
show_hudmessage(players[i], "%L", players[i], "P2_MSG_DOUBLEKILL", name)
}
case MSG_SUICIDE:
{
set_hudmessage(255, 0, 0, -1.0, 0.77, 2, 0.1, 5.0, 0.1, 0.2, MSG_ID+HC)
show_hudmessage(players[i], "%L", players[i], "P2_MSG_SUICIDE", name)
}
case MSG_TK:
{
set_hudmessage(255, 0, 0, -1.0, 0.70, 2, 0.1, 5.0, 0.1, 0.2, MSG_ID+HC)
show_hudmessage(players[i], "%L", players[i], "P2_MSG_TK", name, name2)
}
case MSG_KNIFEKILL:
{
set_hudmessage(255, 0, 0, -1.0, 0.62, 2, 0.1, 5.0, 0.1, 0.2, MSG_ID+HC)
show_hudmessage(players[i], "%L", players[i], "P2_MSG_KNIFEKILL", name, name2)
}
case MSG_HEADSHOT:
{
set_hudmessage(255, 0, 0, -1.0, 0.55, 2, 0.1, 5.0, 0.1, 0.2, MSG_ID+HC)
show_hudmessage(players[i], "%L", players[i], "P2_MSG_HEADSHOT", name, name2)
}
case MSG_THE_END:
{
set_hudmessage(0, 255, 0, 0.0, 0.0, 1, 1.0, 5.0, 0.1, 0.2, MSG_ID+HC)
show_hudmessage(players[i], "%L", players[i], "P2_THE_END", param)
}
case MSG_NUM_10:
{
set_hudmessage(0, 255, 0, -1.0, 0.0, 1, 0.3, 0.9, 0.1, 0.2, MSG_ID+HC-10)
show_hudmessage(players[i], " * *** ^n* * * *^n * * *^n * * *^n***** *** ")
}
case MSG_NUM_09:
{
set_hudmessage(0, 255, 0, -1.0, 0.1, 1, 0.3, 0.9, 0.1, 0.2, MSG_ID+HC-9)
show_hudmessage(players[i], " *** ^n* *^n ****^n *^n *** ")
}
case MSG_NUM_08:
{
set_hudmessage(0, 255, 0, -1.0, 0.2, 1, 0.3, 0.9, 0.1, 0.2, MSG_ID+HC-8)
show_hudmessage(players[i], " *** ^n* *^n *** ^n* *^n *** ")
}
case MSG_NUM_07:
{
set_hudmessage(0, 255, 0, -1.0, 0.3, 1, 0.3, 0.9, 0.1, 0.2, MSG_ID+HC-7)
show_hudmessage(players[i], "*****^n *^n * ^n * ^n * ")
}
case MSG_NUM_06:
{
set_hudmessage(0, 255, 0, -1.0, 0.4, 1, 0.3, 0.9, 0.1, 0.2, MSG_ID+HC-6)
show_hudmessage(players[i], " *** ^n* ^n**** ^n* *^n *** ")
}
case MSG_NUM_05:
{
set_hudmessage(0, 255, 0, -1.0, 0.5, 1, 0.3, 0.9, 0.1, 0.2, MSG_ID+HC-5)
show_hudmessage(players[i], "*****^n* ^n**** ^n *^n**** ")
}
case MSG_NUM_04:
{
set_hudmessage(0, 255, 0, -1.0, 0.6, 1, 0.3, 0.9, 0.1, 0.2, MSG_ID+HC-4)
show_hudmessage(players[i], "* *^n* *^n**** ^n *^n *")
}
case MSG_NUM_03:
{
set_hudmessage(0, 255, 0, -1.0, 0.7, 1, 0.3, 0.9, 0.1, 0.2, MSG_ID+HC-3)
show_hudmessage(players[i], "**** ^n *^n *** ^n *^n**** ")
}
case MSG_NUM_02:
{
set_hudmessage(0, 255, 0, -1.0, 0.8, 1, 0.3, 0.9, 0.1, 0.2, MSG_ID+HC-2)
show_hudmessage(players[i], "**** ^n *^n *** ^n* ^n*****")
}
case MSG_NUM_01:
{
set_hudmessage(0, 255, 0, -1.0, 0.9, 1, 0.3, 0.9, 0.1, 0.2, MSG_ID+HC-1)
show_hudmessage(players[i], " * ^n* * ^n * ^n * ^n*****")
}
case MSG_ROUND:
{
set_hudmessage(255, 0, 0, -1.0, 0.25, 2, 0.1, 5.0, 0.1, 0.2, MSG_ID+HC)
show_hudmessage(players[i], "%L", players[i], "P2_MSG_ROUND", param)
}
}
}
}
//-----TOOLS---------------------------------------------------------------
public clear_message(id)
{
message_begin(MSG_ALL, 135)
write_byte(0)
write_byte(id-600)
message_end()
}
stock bool:info_enabled()
{
if(get_cvar_num("postal2_enabled") == 1)
{
return true
}
return false
}
stock bool:info_ffa()
{
if(get_cvar_num("postal2_ffa") == 1)
{
return true
}
return false
}
stock bool:info_mb()
{
if(get_cvar_num("postal2_mb") == 1)
{
return true
}
return false
}
stock info_random(num)
{
return random_num(0, num-1)
}
public client_putinserver(id)
{
if(info_enabled() && info_enabled())
{
KillerScore[id] = 0
HeadShot[id] = 0
}
}
public blockSendAudio()
{
if(info_mb() && info_enabled())
{
new arg[MAX_MSG_LEN+1]
get_msg_arg_string(2, arg, MAX_MSG_LEN)
if((equal(arg, "%!MRAD_terwin") || equal(arg, "%!MRAD_ctwin")) && TeamWinSound)
{
return PLUGIN_HANDLED
}
if((equal(arg, "%!MRAD_LETSGO") || equal(arg, "%!MRAD_MOVEOUT")) && RoundNumberSound)
{
return PLUGIN_HANDLED
}
}
return PLUGIN_CONTINUE
}
public blockTextMsg()
{
if(info_mb() && info_enabled())
{
new arg[MAX_MSG_LEN+1]
get_msg_arg_string(2, arg, MAX_MSG_LEN)
if((equal(arg, "#Terrorists_Win") || equal(arg, "#CTs_Win")) && TeamWinMsg)
{
return PLUGIN_HANDLED
}
if(equal(arg, "#Bomb_Planted") && BombPlantedMsg)
{
return PLUGIN_HANDLED
}
if(equal(arg, "#Game_bomb_drop") && BombDropMsg)
{
return PLUGIN_HANDLED
}
if(equal(arg, "#Got_bomb") && BombPickUpMsg)
{
return PLUGIN_HANDLED
}
if(equal(arg, "#Target_Bombed") && BombExplodeMsg)
{
return PLUGIN_HANDLED
}
if(equal(arg, "#Bomb_Defused") && BombDefusedMsg)
{
return PLUGIN_HANDLED
}
if(equal(arg, "#Killed_Teammate") && TeamKillMsg)
{
return PLUGIN_HANDLED
}
}
return PLUGIN_CONTINUE
}
public plugin_precache()
{
precache_sound("postal2/Announcer1.wav")
precache_sound("postal2/Announcer1min.wav")
precache_sound("postal2/Announcer2.wav")
precache_sound("postal2/Announcer3.wav")
precache_sound("postal2/Announcer4.wav")
precache_sound("postal2/Announcer5.wav")
precache_sound("postal2/Announcer5min.wav")
precache_sound("postal2/Announcer6.wav")
precache_sound("postal2/Announcer7.wav")
precache_sound("postal2/Announcer8.wav")
precache_sound("postal2/Announcer9.wav")
precache_sound("postal2/Announcer10.wav")
precache_sound("postal2/Announcer30sec.wav")
precache_sound("postal2/AnnouncerGrudgeMatch.wav")
precache_sound("postal2/AnnouncerTeamBandScore.wav")
precache_sound("postal2/AnnouncerTeamCopsScore.wav")
precache_sound("postal2/AnnouncerTeamDudeScore.wav")
precache_sound("postal2/AnnouncerTeamFanaticsScore.wav")
precache_sound("postal2/AnnouncerTeamGimpScore.wav")
precache_sound("postal2/AnnouncerTeamHoodScore.wav")
precache_sound("postal2/AnnouncerTeamMilitaryScore.wav")
precache_sound("postal2/AnnouncerTeamRWSScore.wav")
precache_sound("postal2/AnnouncerTeamSWATScore.wav")
precache_sound("postal2/AnnouncerTeamZealotsScore.wav")
precache_sound("postal2/AnnouncerTheirFlagDropped.wav")
precache_sound("postal2/AnnouncerTheirFlagReturned.wav")
precache_sound("postal2/AnnouncerTheirFlagTaken.wav")
precache_sound("postal2/AnnouncerYouLost2.wav")
precache_sound("postal2/AnnouncerYouLost.wav")
precache_sound("postal2/AnnouncerYourFlagDropped.wav")
precache_sound("postal2/AnnouncerYourFlagReturned.wav")
precache_sound("postal2/AnnouncerYourFlagTaken.wav")
precache_sound("postal2/AnnouncerYourTeamLost2.wav")
precache_sound("postal2/AnnouncerYourTeamLost3.wav")
precache_sound("postal2/AnnouncerYourTeamLost.wav")
precache_sound("postal2/AnnouncerYourTeamWon2.wav")
precache_sound("postal2/AnnouncerYourTeamWon3.wav")
precache_sound("postal2/AnnouncerYourTeamWon.wav")
precache_sound("postal2/AnnouncerYouWon2.wav")
precache_sound("postal2/AnnouncerYouWon.wav")
precache_sound("postal2/dude_andonetogrowon.wav")
precache_sound("postal2/dude_buttsauce.wav")
precache_sound("postal2/dude_dontcrowdtheres.wav")
precache_sound("postal2/dude_fuckyou.wav")
precache_sound("postal2/dude_getdownifyoudont.wav")
precache_sound("postal2/dude_getthefuckdown.wav")
precache_sound("postal2/dude_haveaniceday.wav")
precache_sound("postal2/dude_hehhehheh.wav")
precache_sound("postal2/dude_heresyertaxrelief.wav")
precache_sound("postal2/dude_icanrelatebro.wav")
precache_sound("postal2/dude_ifyousayso.wav")
precache_sound("postal2/dude_imsoryapparently.wav")
precache_sound("postal2/dude_iregretnothing.wav")
precache_sound("postal2/Dude_Machete_Daddy.wav")
precache_sound("postal2/Dude_Machete_Fingers.wav")
precache_sound("postal2/Dude_Machete_ImGood.wav")
precache_sound("postal2/Dude_Machete_ThereItIs.wav")
precache_sound("postal2/dude_movealong.wav")
precache_sound("postal2/dude_onebecauseican.wav")
precache_sound("postal2/dude_onebecauseihave.wav")
precache_sound("postal2/dude_onecauseugly.wav")
precache_sound("postal2/dude_oneforbebo.wav")
precache_sound("postal2/dude_oneforjohnny.wav")
precache_sound("postal2/dude_oneforthepope.wav")
precache_sound("postal2/dude_oneforyourmother.wav")
precache_sound("postal2/dude_onlymyweapon.wav")
precache_sound("postal2/dude_someonestolemy.wav")
precache_sound("postal2/dude_thatstheone.wav")
precache_sound("postal2/Dude_UseBlade_1.wav")
precache_sound("postal2/Dude_UseBlade_2.wav")
precache_sound("postal2/Dude_UseBlade_3.wav")
precache_sound("postal2/dude_viagraworks.wav")
precache_sound("postal2/dude_yesss.wav")
precache_sound("postal2/dude_yougogirl.wav")
return PLUGIN_CONTINUE
}