Jump to content

Scerius

Member
  • Content Count

    6
  • Joined

  • Last visited

  • Medals

Community Reputation

10 Good

About Scerius

  • Rank
    Rookie
  1. Been a few days, guessing you either don't care anymore (not likely), have it figured out (hopefully), or are still trying to figure it out (likely). Just in case, here is a more detailed procedure (in it's simplest form, I believe). -------------- Add to file "init.sqf" in MPMissions/YourMissionName.Map folder: //initialize database system if(isServer) then { call compile preProcessFileLineNumbers "\iniDB\init.sqf"; }; Create a new script, call it "runDatabase.sqf" for this example. It's purpose will be to run the database save loop. You can add whatever fields you want to save, but for this example we will just save the name of the player and their score. //runDatabase.sqf // //Author: Scerius //Description: Performs the database save loop. //Usage: [] spawn "runDatabase.sqf" while{true} do { //only run script every 30 seconds sleep 30; //save player data { _playerUID = getPlayerUID _x; ["myDatabaseFile", _playerUID, "Name", name _x] call iniDB_write; ["myDatabaseFile", _playerUID, "Score", score _x] call iniDB_write; } forEach playableUnits; }; *Note that this file has nothing to do with the client, and does NOT need to be on their machine. In fact, none of any of the code in this post should ever be executed on the client. You don't even need to include it in the mission pbo either since the client will never use it. Once that file has been created, you need to call it somewhere. Probably the best place would be the same mission init.sqf file as mentioned above, after the server has been fully intialized. You need to use the spawn command to execute it becuase it contains a sleep command. Again, make sure only the server will execute this script. //run database save loop if(isServer) then { [] spawn runDatabase.sqf; }; Also, I believe the code needs to be compiled with the compile keyword before it can be spawned. I will show that here. You will want to place this line where all the other server functions are compiled (it is just the same as when we compiled the /iniDB/init.sqf file, except we also called it at the same time as compiling it in that case). //compile functions compile preProcessFileLineNumbers "runDatabase.sqf"; Hope this makes sense, good luck.
  2. Just initialize iniDB in the init.sqf file. Then, add a function on the server that accepts the player as an argument and extract his score there. Once you have his score, just use the iniDB_write function to save it to the database. You can do this many different ways. First, you can just use a while loop and monitor everything from time to time, using the sleep command to slow the processing down a bit. Or you could use something like a publicVariableEventHandler and whenever the client score changes it will automatically be sent to the server and have your save script executed that way. There's many different ways to implement it, the choice is yours. Just break up the problem into smaller pieces and go from there. I would start just by making sure iniDB is initialized. Then make a test script to see if it can save anything properly for you. Once you get that working, then you can work on sending the client info to the server, any info, just make a test case if needed. All that is needed now is to save that to the database and you are done.
  3. Thanks a bunch for making these guides. They are awesome!
  4. No I am not posting them, sorry. I was just wondering if this was more or less common practice to see something like this included, I am not experienced with running a server myself (in Arma atleast, I guess I had fun some in the past for other games). You pretty much has gave me the answer I was lookign for though Iceman, thanks, and I hope that is why they are there.
  5. Yes it is just hidden scripts inside the automatically downloaded pbo mission file.
  6. I played a mod the other day, and enjoyed it a bit. For whatever reason I decided to un-pbo the downloaded mission file, and was really quite surprised at what I found. Hacks were being included in the pbo file. Some of them could be considered 'admin tools', sure. But some of them, such as ESP, I doubt have any reason for being there. So, what steps does one take from there? Is there anything in particular I should be doing, or more important, anyone who should be notified that hacks are being distributed in these mission files?
×