I have skaarj set up so that when you kill it, it triggers a special event that broadcasts a message
Is there a way for me to have the message include the players name?
Something like: "*Player* killed the Skaarj!"
For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com
Trying to include a player's name in a broadcast message
- Buffalo Baggins
- OldUnreal Member
- Posts: 21
- Joined: Mon Dec 12, 2016 2:08 am
Trying to include a player's name in a broadcast message
America is a tune. It must be sung together.
- Masterkent
- OldUnreal Member
- Posts: 1469
- Joined: Fri Apr 05, 2013 12:41 pm
Re: Trying to include a player's name in a broadcast message
The standard SpecialEvent doesn't provide such an option. You can define your own subclass of it and implement function Trigger like this:
Code: Select all
static function string GetNameOf(Pawn P)
{
if (P == none)
return "Someone";
if (P.PlayerReplicationInfo != none)
return P.PlayerReplicationInfo.PlayerName;
if (Len(P.MenuName) == 0)
P.MenuName = string(P.Class.Name);
return P.NameArticle $ P.MenuName;
}
function Trigger(Actor A, Pawn EventInstigator)
{
BroadcastMessage(GetNameOf(EventInstigator) @ Message, true, 'CriticalEvent');
}
Last edited by Masterkent on Sat Aug 18, 2018 9:16 am, edited 1 time in total.