Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version "4.0"
- class MyHandler : EventHandler
- {
- int rocketHits [MAXPLAYERS];
- int railgunHits [MAXPLAYERS];
- override void WorldThingDied(WorldEvent e) {
- if (!victim)
- return;
- let victim = e.Thing;
- let killer = e.Thing.Target;
- if (!killer) {
- if (victim.player)
- Console.Printf("\ck%s\c- was killed by something in the world.", victim.player.GetUserName());
- else
- Console.Printf("\ck%s\c- was killed by something in the world.", victim.GetClassName());
- return;
- }
- if (victim.player && killer.player)
- Console.Printf("\ck%s\c- was killed by %s using \ck%s\c-", victim.player.GetUserName(), killer.player.GetUserName(), killer.player.ReadyWeapon.GetClassName());
- else if (victim.player)
- Console.Printf("\ck%s\c- was killed by \ck%s\c-", victim.player.GetUserName(), killer.GetClassName());
- name killerWeap = '';
- int killerNum = 0;
- if (killer.player) {
- killerWeap = killer.player.ReadyWeapon.GetClassName ();
- killerNum = killer.PlayerNumber ();
- }
- if (killerWeap == "QCRocketLauncher") {
- Console.Printf("\ck%s\c- killed a(n) \ck%s\c-", killer.player.GetUserName(), victim.GetClassName());
- if (rocketHits [killerNum] < 5)
- rocketHits [killerNum]++;
- else if (rocketHits [killerNum] >= 5) {
- killer.A_PlaySound ("player/excellent", CHAN_AUTO, 0.5, false, ATTN_NONE);
- rocketHits [killerNum] = 0;
- }
- } else if (killerWeap == "QCRailGun") {
- Console.Printf ("\ck%s\c- killed a(n) \ck%s\c-", killer.player.GetUserName(), victim.GetClassName());
- if (railgunHits [killerNum] == 0)
- railgunHits [killerNum]++;
- else if (railgunHits [killerNum] >= 1) {
- killer.A_PlaySound("player/impressive", CHAN_AUTO, 0.5, false, ATTN_NONE);
- railgunHits [killerNum] = 0;
- }
- } else if (killer.player)
- Console.Printf("\ck%s\c- killed a(n) \ck%s\c-", killer.player.GetUserName(), victim.GetClassName());
- else
- Console.Printf("\ck%s\c- killed a(n) \ck%s\c-", killer.GetClassName(), victim.GetClassName());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement