Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- CHANGELOG:
- Fixed Missing equals character after HINTSNPGTIPZarray [ ... should have been HINTSNPGTIPZarray = [
- */
- /*
- Details: A script to display random hints and tips on my sons server.
- Script Type: Epoch Events Module
- Put this in the Servers Modules folder, name it tipz.sqf for example.
- In the Mission folder init.sqf file edit the Events and addd the file name, without the .sqf, like:
- EpochEvents = [
- ["any","any","any","any",5,"tipz"], // < ---- like this
- ["any","any","any","any",5,"crash_spawner"],
- ["any","any","any","any",25,"crash_spawner"],
- ["any","any","any","any",45,"crash_spawner"]
- ];
- In case you're wondering what the ANY options are -
- "year","month","day","hour","minutes past the hour","script name" .. For numbers you don't need the ""
- A note on Variables: Global variables will be persistent and once set can be used with any other script.
- Private variables will only be available to the script they were set in, once the script ends, the variable is lost.
- Private variables always start with an underscore and are declared locally in the PRIVATE variables array.
- Global variables always always start with a letter (no underscores etc). They are not declared but you might
- want to put checks in place to avoid errors i.e: if(!isNil GLOBALVARIABLENAME) then { GLOBALVARIABLENAME = "something";};
- if(!isNil GLOBALVARIABLE NAME) is simply checking to see if the Global Variable is empty (hasn't been used yet).
- */
- Private ["_selection"]; // You must declare local variables here, or you get error spam in the logs. This line goes before all other code!
- if(!isNil RunONCETIPZarray) then { // We only want to run this code once, so lets check if this is the first time
- RunONCETIPZarray = true; // Setting this Global variable to true means this code will be skipped until server restart now
- HINTSNPGTIPZarray = [ // Hints , Tips and Information..... add as many as you like..
- "[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!
- "[TIP]: Shoot zombies in the legs to slow them down!",
- "[TIP]: Wearing a Bandit skin is a sure way to get yourself killed on sight!",
- "[INFO]: Bandit Lvl1(-5k) Lvl2(-10k) Lvl3(-15k) . Hero Lvl1(+5k) Lvl2(+10k) Lvl3(+15k).",
- "[INFO]: TeamSpeak Address: unit487.teamspeak3.com , Join the DayZ Epoch Origins Channel.",
- "[INFO]: Our Server Address is: 212.129.63.140 , Port: 2302",
- "[INFO]: Server restarts are at 12midnight, 4am, 8am, 12noon, 4pm and 8pm GMT(London).",
- "[HINT]: Access your Origins building options by right clicking your Toolbox!",
- "" // No comma after this one ;)
- ];
- }; // End of hintntipz array creation
- _selection = HINTSNPGTIPZarray call BIS_fnc_selectRandom; // Select a random message from the Array
- // You must have remoteMessages script installed for this to work...
- RemoteMessage = ["global", _selection]; // Global will display this to all players
- publicVariable "RemoteMessage";
- 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