player2_dz

Untitled

Jan 18th, 2016
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 4.15 KB | None | 0 0
  1. /*---------------------------------------------------------------------------
  2.  
  3.     Player2's Lottery System for Life
  4.  
  5.     Install Instructions & Important Notes
  6.  
  7.  
  8.     Installation
  9.  
  10.  
  11.     1. Database Setup
  12.  
  13.         1a) Creating the Database
  14.             Simply create a new database named 'lottery'.
  15.             Then run the SQL provided 'p2lottery.sql' on that database to create the tables.
  16.             You should have two tables in the lottery database, system & tickets.
  17.         1b) Adding the database to ExtDB Config file
  18.             In your servers extdb folder there should be a file called 'extdb-conf.ini'
  19.             You will need to open that and add this to it, modify where needed:
  20.                 [p2lottery]
  21.                 Type         = MySQL
  22.                 Name         = lottery
  23.                 Username     = <__YOUR DATABASE USERNAME__>
  24.                 Password     = <__YOUR DATABASE PASSWORD__>
  25.                 IP           = <__YOUR DATABASE IP__>
  26.                 Port         = <__YOUR DATABASE PORT__>
  27.                 minSessions  = 2
  28.                 ;maxSessions = 4
  29.                 idleTime     = 60
  30.  
  31.  
  32.     2. File Structure
  33.         As given the server portion is inside the mission PBO.
  34.         This is not ideal as others can steal the scripts easily.
  35.         Decide where you would like to place the server portion of the code.
  36.         Now create a new folder in your chosen server directory and call it 'p2lottery'.
  37.         Now CUT and paste the 'server' folder included to that location.
  38.         Now copy and paste the entire 'p2lottery' folder into your mission file.
  39.         The server folder should not be inside the mission file.
  40.         Now open the 'config.sqf' for the lottery and modify the path used for 'p2l_serverFolder'
  41.         to your newly selected path that you just copied the 'server' folder to.
  42.  
  43.     3. Configuration
  44.         Included is a config.sqf
  45.         You should have just opened it to modify the 'p2l_serverFolder' path in there
  46.         If you would like to modify the path of the p2lottery in the mission, there is an option
  47.         Debugging mode is enabled by default as I assume this will be on a test server before a live one
  48.         This is so you can check to see if any errors are happening while you test
  49.         It also modifies timers a bit to make testing quicker and easier
  50.         There are also options to configure nearly every part of the lottery system
  51.         The default values are NOT optimal for a live server, you MUST change them to your liking.
  52.         There are also advertisement messages included, you can have as many as you like.
  53.         It will not display the same adverts twice, adverts are displayed in chat.
  54.         You will need to place your vendor, I used a random map position.
  55.  
  56.     4. SQF Setup
  57.  
  58.         4a. Init of the database
  59.             You will need to add our new database to your extDB startup section in your server pbo
  60.             just after you initialize extDB.
  61.  
  62.             To find where this is, look for this:
  63.                 _result = EXTDB format["9:DATABASE:%1",DATABASE_SELECTION];
  64.  
  65.             Now add these 2 lines below that one:
  66.                 "extDB" callExtension "9:DATABASE:p2lottery";
  67.                 "extDB" callExtension format["9:ADD:%1:%2","DB_RAW_V2",FETCH_CONST(life_sql_id)];
  68.  
  69.             Making it look like this:
  70.                 _result = EXTDB format["9:DATABASE:%1",DATABASE_SELECTION];
  71.                 "extDB" callExtension "9:DATABASE:p2lottery";
  72.                 "extDB" callExtension format["9:ADD:%1:%2","DB_RAW_V2",FETCH_CONST(life_sql_id)];
  73.  
  74.         4b. Adding the startup line
  75.             Copy and paste this line into your mission files init.sqf at the top of the file
  76.                 [] execVM "p2lottery\init.sqf";
  77.  
  78.         4c. Replace life cash value
  79.             Find and replace "p2l_cashValue" with your global var for cash
  80.  
  81.  
  82.     5. Notes and Considerations
  83.  
  84.         You will need to figure out a good balance between ticket price and how often people win
  85.         I'm not sure what kind of payout you are wanting players to get so the prizes can also
  86.         be tweaked to your liking. Having high ticket prices and a longer running lottery with lower
  87.         prize values might see the jackpot soar to the millions provided enough players play.
  88.  
  89.         In the database the default minimum jackpot is also set to 50,000.
  90.         You might want to change it there aswell as in the config.
  91.  
  92.     6. Likely Errors with Installation
  93.         ExtDB ID (life sql id) not set up properly
  94.         Database not set up properly
  95.  
  96.  
  97. ---------------------------------------------------------------------------*/
Advertisement
Add Comment
Please, Sign In to add comment