You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// ...publicvoidRegisterEvents(){Exiled.Events.Handlers.Player.Joined+=OnPlayerJoined;}publicvoidUnregisterEvents(){Exiled.Events.Handlers.Player.Joined-=OnPlayerJoined;}publicvoidOnPlayerJoined(JoinedEventArgsev){// Using an extension methodev.Player.AddBroadcast(10,"Welcome to the server!",0);// ... or MultiBroadcast.AddPlayerBroadcast(ev.Player, 10, "Welcome to the server!", 0);}// ...
Editing and removing broadcasts:
// ...publicvoidOnPlayerJoined(JoinedEventArgsev){// Adding and storing the broadcastvarbroadcast=ev.Player.AddBroadcast(10,"Welcome to the server!",0);// Editing the broadcastbroadcast.Edit("Welcome to the server! You are a VIP!");// Removing the broadcastbroadcast.Remove();// Clearing all broadcasts of the playerev.Player.ClearPlayerBroadcasts();// Clearing all broadcastsMultiBroadcast.ClearAllBroadcasts();}// ...
Using a priority system:
// ...publicvoidOnPlayerJoined(JoinedEventArgsev){// Second broadcast will be shown upwards (top to bottom, can be changed in the config)// Using this assembly as dependency will fix priority to descendingev.Player.AddBroadcast(10,"Welcome to the server!",0);ev.Player.AddBroadcast(10,"You are a VIP!",1);ev.Player.ClearPlayerBroadcasts();// If two broadcasts have the same priority, the one that was added last will be shown firstev.Player.AddBroadcast(10,"This is first broadcast.",1);ev.Player.AddBroadcast(10,"This is second broadcast.",1);// will result:// This is second broadcast.// This is first broadcast.ev.Player.ClearPlayerBroadcasts();// Also you can change priority of a broadcastvarbroadcast=ev.Player.AddBroadcast(10,"Welcome to the server!",0);broadcast.SetPriority(1);}// ...