Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class test_Class: SCR_BaseTriggerEntity
- {
- // This just filters for players
- override bool ScriptedEntityFilterForQuery(IEntity ent) {
- SCR_ChimeraCharacter cc = SCR_ChimeraCharacter.Cast(ent);
- if (!cc) return false;
- if (!IsAlive(cc)) return false;
- return true;
- }
- // This fires when a player enters the trigger
- override void OnActivate(IEntity ent)
- {
- if (!Replication.IsServer()) return;
- GetGame().GetCallqueue().CallLater(SendHintRpc, 200, false, "Global", "Hint", 10);
- }
- // This *should* send an Rpc to every client
- void SendHintRpc(string a, string b, int c)
- {
- Rpc(GlobalHint, a, b, c);
- }
- // This locally shows a custom hint
- [RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
- void GlobalHint(string msg, string hl, int dur)
- {
- SCR_HintManagerComponent.ShowCustomHint(msg, hl, dur);
- }
- };
Add Comment
Please, Sign In to add comment