Advertisement
Guest User

Epoch Events Script for displaying random hints

a guest
Dec 1st, 2015
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.09 KB | None | 0 0
  1. /*
  2. CHANGELOG:
  3. Fixed Missing equals character after HINTSNPGTIPZarray [ ... should have been HINTSNPGTIPZarray = [
  4. */
  5.  
  6. /*
  7. Details: A script to display random hints and tips on my sons server.
  8. Script Type: Epoch Events Module
  9. Put this in the Servers Modules folder, name it tipz.sqf for example.
  10. In the Mission folder init.sqf file edit the Events and addd the file name, without the .sqf, like:
  11.  
  12.  
  13. EpochEvents = [
  14. ["any","any","any","any",5,"tipz"], // < ---- like this
  15. ["any","any","any","any",5,"crash_spawner"],
  16. ["any","any","any","any",25,"crash_spawner"],
  17. ["any","any","any","any",45,"crash_spawner"]
  18. ];
  19.  
  20. In case you're wondering what the ANY options are -
  21. "year","month","day","hour","minutes past the hour","script name" .. For numbers you don't need the ""
  22.  
  23. A note on Variables: Global variables will be persistent and once set can be used with any other script.
  24. Private variables will only be available to the script they were set in, once the script ends, the variable is lost.
  25. Private variables always start with an underscore and are declared locally in the PRIVATE variables array.
  26. Global variables always always start with a letter (no underscores etc). They are not declared but you might
  27. want to put checks in place to avoid errors i.e: if(!isNil GLOBALVARIABLENAME) then { GLOBALVARIABLENAME = "something";};
  28. if(!isNil GLOBALVARIABLE NAME) is simply checking to see if the Global Variable is empty (hasn't been used yet).
  29. */
  30.  
  31. Private ["_selection"]; // You must declare local variables here, or you get error spam in the logs. This line goes before all other code!
  32.  
  33. if(!isNil RunONCETIPZarray) then { // We only want to run this code once, so lets check if this is the first time
  34.  
  35. RunONCETIPZarray = true; // Setting this Global variable to true means this code will be skipped until server restart now
  36.  
  37. HINTSNPGTIPZarray = [ // Hints , Tips and Information..... add as many as you like..
  38.  
  39. "[HINT]: NPC pilots will often broadcast a Mayday message during an emergency landing!", // Anything inside the "" is treated as text, not code. So [] and : are ok!
  40. "[TIP]: Shoot zombies in the legs to slow them down!",
  41. "[TIP]: Wearing a Bandit skin is a sure way to get yourself killed on sight!",
  42. "[INFO]: Bandit Lvl1(-5k) Lvl2(-10k) Lvl3(-15k) . Hero Lvl1(+5k) Lvl2(+10k) Lvl3(+15k).",
  43. "[INFO]: TeamSpeak Address: unit487.teamspeak3.com , Join the DayZ Epoch Origins Channel.",
  44. "[INFO]: Our Server Address is: 212.129.63.140 , Port: 2302",
  45. "[INFO]: Server restarts are at 12midnight, 4am, 8am, 12noon, 4pm and 8pm GMT(London).",
  46. "[HINT]: Access your Origins building options by right clicking your Toolbox!",
  47. ""  // No comma after this one ;)
  48.  
  49. ];
  50.  
  51.     }; // End of hintntipz array creation
  52.    
  53. _selection = HINTSNPGTIPZarray call BIS_fnc_selectRandom; // Select a random message from the Array
  54.  
  55. // You must have remoteMessages script installed for this to work...
  56. RemoteMessage = ["global", _selection]; // Global will display this to all players
  57. publicVariable "RemoteMessage";
  58.  
  59. HINTSNPGTIPZarray = HINTSNPGTIPZarray - ["_selection"]; // Remove the message from the array so it doesn't show again!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement