Advertisement
Guest User

MinipunchCallOut

a guest
Apr 5th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.79 KB | None | 0 0
  1. using DemoProject.Callouts;
  2. using LSPD_First_Response.Mod.API;
  3. using Rage;
  4.  
  5. [assembly: Rage.Attributes.Plugin("TESTCALLOUT2", Author = "MINIPUNCH", Description = "BY MINIPUNCH"]
  6.  
  7. namespace DemoProject
  8. {
  9.     /// <summary>
  10.     /// Do not rename! Attributes or inheritance based plugins will follow when the API is more in depth.
  11.     /// </summary>
  12.     internal class Main : Plugin
  13.     {
  14.         /// <summary>
  15.         /// Constructor for the main class, same as the class, do not rename.
  16.         /// </summary>
  17.         public Main()
  18.         {
  19.            
  20.         }
  21.  
  22.         /// <summary>
  23.         /// Called when the plugin ends or is terminated to cleanup
  24.         /// </summary>
  25.         public override void Finally()
  26.         {
  27.  
  28.         }
  29.  
  30.         /// <summary>
  31.         /// Called when the plugin is first loaded by LSPDFR
  32.         /// </summary>
  33.         public override void Initialize()
  34.         {
  35.             //Event handler for detecting if the player goes on duty
  36.             Functions.OnOnDutyStateChanged += Functions_OnOnDutyStateChanged;
  37.             Game.LogTrivial("TestCallout2 by minipunch loaded!");
  38.             Game.DisplayNotification("TestCallout2 by minipunch loaded!");
  39.         }
  40.  
  41.         /// <summary>
  42.         /// The event handler mentioned above,
  43.         /// </summary>
  44.         static void Functions_OnOnDutyStateChanged(bool onDuty)
  45.         {
  46.             if (onDuty)
  47.             {
  48.                 //If the player goes on duty we need to register our custom callouts
  49.                 //Here we register our ExampleCallout class which is inside our Callouts folder (APIExample.Callouts namespace)
  50.                 Functions.RegisterCallout(typeof(ChaseCallout));
  51.                 Game.LogTrivial("TestCallout2 HAS BEEN LOADED");
  52.             }
  53.         }
  54.     }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement