Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×

Beldum

Member
  • Content Count

    53
  • Joined

  • Last visited

  • Medals

Everything posted by Beldum

  1. I'm after a modder that can make a standalone door object that I can place at the entrances of buildings that don't have doors. I'm currently working on a mission and a lot of the buildings in the map don't have doors, so I'd like just a door object that opens and closes like normal and possibly lockable? Should be a relatively easy mod, but I've got no idea when it comes to object addons and stuff like that. I only script. Cheers
  2. Or he could try this _trees = nearestObjects [player,["Trees"],15]; { _class = typeof _x; _pos = getpos _x; _dir = getdir _x; hideObject _x; _fakeTree = "Land_HelipadEmpty_F" createVehicle _pos; _fakeTree setVariable ["appletogetit",_RealAvailable,true]; }forEach _trees;
  3. If you can't use setVariable on map objects, could he do this _trees = nearestObjects [player,["Trees"],15]; { _class = typeof _x; _pos = getpos _x; _dir = getdir _x; hideObject _x; _newTree = _class createVehicle _pos; _newTree setdir _dir; _newTree setVariable ["appletogetit",_RealAvailable,true]; }forEach _trees
  4. Hi I recently started running a Wasteland server and have been working to make it a bit different to other wasteland servers (Vehicles, Weapons, Shops, etc) and have been trying to work on a script that saves players Position, Direction, Weapons, Items (Like food and drink), etc I would one day like to make one that Perminantly saves player gear but for now, i am only looking for one that saves until server restart. I currently have a semi working version The problem with my version is that whenever a player logs out, it wipes their stats so when they log back in, they have to start from scratch. Here are my scripts ----------------------------------------------------------------------------------- StatSave.sqf //Client Save while (true) do { waitUntil{alive player}; waitUntil{!respawnDialogActive}; playerteam = side player; //Wasteland Items playermoney = player getVariable "cmoney"; playerfood = player getVariable "canfood"; playermedkit = player getVariable "medkits"; playerwater = player getVariable "water"; playerfuel = player getVariable "fuel"; playerrepair = player getVariable "repairkits"; playerFjerry = player getVariable "fuelFull"; playerEjerry = player getVariable "fuelEmpty"; playerbomb = player getVariable "bombs"; playerspawn = player getVariable "spawnBeacon"; playercamo = player getVariable "camonet"; //Thirst and Hunger playerhunger = hungerLevel; playerthirst = thirstLevel; //Player Location playerlocation = getPos player; playerdirection = getDir player; //Player Weapons playerweapons = weapons player; playermags = magazines player; //Player Damage playerdamage = getDammage player; //Resets stats if player dead if(!alive player) then { playermoney = []; playerfood = []; playermedkit = []; playerwater = []; playerfuel = []; playerrepair = []; playerFjerry = []; playerEjerry = []; playerbomb = []; playerspawn = []; playercamo = []; playerhunger = []; playerthirst = []; playerdamage = 1 }; }; //end ----------------------------------------------------------------------------------- StatLoad.sqf //Client Load clientstatsloaded = 0; execVM "VRG_Scripts\Stat_Saving\LoadCheck.sqf"; if (side player == playerteam) then { _weapons = playerweapons; _magazines = playermags; //Sets Wasteland Items player setVariable["cmoney", playermoney, false]; player setVariable["canfood", playerfood, false]; player setVariable["medkits", playermedkit, false]; player setVariable["water", playerwater, false]; player setVariable["fuel", playerfuel, false]; player setVariable["repairkits", playerrepair, false]; player setVariable["fuelFull", playerFjerry, false]; player setVariable["fuelEmpty", playerEjerry, false]; player setVariable["bombs", playerbomb, false]; player setVariable["spawnBeacon", playerspawn, false]; player setVariable["camonet", playercamo, false]; player setVariable["canDrop",true,false]; //Sets Thirst and Hunger thirstLevel = playerthirst; hungerLevel = playerhunger; //Sets Location player setpos playerlocation; player setdir playerdirection; //Sets Weapons removeallweapons player; sleep 1; {player addMagazine _x} foreach _magazines; {player addWeapon _x} foreach _weapons; _primaryweapon = primaryWeapon player; player selectWeapon _primaryweapon; clientstatsloaded = 1; }; ----------------------------------------------------------------------------------- LoadCheck.sqf (Only used for Stat loading confirmation) if (clientstatsloaded != 1) then { hintSilent "Awaiting stat loading (If this stays on screen for more than 30 Seconds, contact an Admin)"; execVM "NPE_Scripts\Stat_Saving\LoadCheck.sqf"; } else { titleText ["Your stats have been loaded", "PLAIN"]; hint format["Your stats for %1 have been loaded",side player]; }; ----------------------------------------------------------------------------------- Any help would be good :) Thanks
  5. Hey guys So basically, I'm an 18 year old Australian and have been playing ArmA since i was around 13 - 14 and have been learning scripting for around 3 years now and me and a few mates have been playing DayZ Overpoch for a fair while now, so I have decided to try and bring up my own Overpoch Server and attempt to build a community out of it. I do not have a server active yet due to technical reasons but they will be resolved within a couple of days. Basically I plan to bring up a Server with a self modified version of DayZ Overpoch, featuring a lot of custom scripts, custom vehicles, custom traders, etc and already have a small list of features that I have already coded ready for the server! For the first week of the server being active, all new players will spawn with 10oz Gold, 1 Safe and a Plot Pole to say thank you for choosing VRG! I would really like too see you guys on the server as I will be putting a lot of my spare time and work into making it the best experience for the players as I possible can! The servers IP will be - 119.252.189.136:2602 or you can just filter VRG. Also, I want to ask you guys, what Map should I have it on? Hope too see you guys soon, thanks. ~Nick The small list (Note: This is an EXTREMELY small list compared to what I will add in the future): - Building supply Missions - Other extra side missions like wrecked vehicles, gold caches, etc - Added vehicles with custom functions (List below) - Spawn Select script - Spawning in a Mozzie Helicopter with a Toolbox, Scrap Metal, Engine parts and Main Rotor - Some Tanks (Pretty expensive with with disabled cannons) - Much more to come in the future! Custom Vehicles list: (Subject to change after testing on server) - MI-24V Cannon only (no missiles or rockets) - MI-24P Cannon only (no rockets or bombs) - KA-52 Cannon only (no rockets or missiles) - AH-6J - T-72 (No cannon) - T-55 (No cannon) - T-34 (No cannon) - M1A1 (No cannon) - M2A2 (No TOW Missiles) - BMP2 (No AT-5 Missiles) - Armored SUV with retractable M134 Minigun - All Humvee variants (Except TOW variant) - All Offroad variants (Except SPG-9 variant) - BMP-2 - BMP-2 HQ - BRDM-2 - BRDM-2 HQ - BTR-40 - BTR-90 - BTR-90 HQ - M113 - KA-60 - MH-60 - UH-60 - MI-17 - AW-159 Lynx - UH-1y (No rockets)
  6. Beldum

    Arma2MySQL

    Any idea why I'm getting this? 06/14/2014 00:32:24 function: Arma2NETMySQLCommand ['nickp_1', 'INSERT INTO test_lplayers (uid, name, Bank, vkeys, licences, insurance, gear, weapons, inventory, settings, blacklist) VALUES('76561198085735088CIV', 'Nick', '[10000,1e+006,0]', '[]', '[]', '[false,false,false]', '['U_C_Poor_shorts_1',['FirstAidKit']]', '[]', '[]', '[true]', '[0,1,0]')'] 06/14/2014 00:32:24 maxResultSize: 10239 It will send to the server fine if I don't save the "Gear" or "Weapons" section. Thanks. Edit: I spent hours trying to figure this out last night but I literally figured it out 5 minutes after posting this.... Sometimes I have ArmA scripting haha Thanks
  7. Beldum

    Arma2MySQL

    Hey Firefly, would you be able to help me with this? I am trying to link ArmA 3 on my Computer to a remove SQL Server so I can test DB functions before actually uploading the Mission file to the Server but whenever I execute an SQL Command, my game instantly crashes. Command I am sending: _query = format["INSERT INTO lplayers (name, playerid, side) VALUES('%1', '%2', '%3')",(name player),(getPlayerUID player),(Side player)]; _sql = "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQLCommand ['%2', '%1']", _query,'nickp_1']; My Database.txt #SQL Server mysql,nickp_1,*IP*,3306,nickp,*Password* ArmA 2 NET log 06/13/2014 00:24:50 Arma2Net.Unmanaged loaded successfully 06/13/2014 00:24:50 Fatal unhandled exception of type System.IO.FileNotFoundException 06/13/2014 00:24:50 System.IO.FileNotFoundException: Could not load file or assembly 'Arma2Net.Managed, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e' or one of its dependencies. The system cannot find the file specified. File name: 'Arma2Net.Managed, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e' at Arma2Net.Unmanaged.InvokeFunctionImpl(SByte* output, Int32 outputSize, SByte* function) at Arma2Net.Unmanaged.InvokeFunction(SByte* output, Int32 outputSize, SByte* function) WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. I have also tried to use your Example Mission but I get the same error. Any Ideas? Thanks Edit: Never mind, after a bit of a search, I found out that my Computer had blocked the .dll files. I unblocked them and it's working now!
  8. Hi all, just thought I'd post here to let you all know about the Mission file I have been working on for the past few months. So, basically I'm 17 and have been playing ArmA since i was around 13 - 14 and have been learning scripting for around 2 years now. I used to have a server that ran a version of Altis Life Revolution that I modified slightly. Now I'm bringing up an Altis Life server that is 100% my own. It is NOT just a modified version of TAW Tonics Altis Life. The server will be hosted in Sydney Australia and will be up within a few weeks (We are currently in a closed testing phase). So, here's a basic rundown of the features that are currently in game as well as a few things that are planned for the near future. Details will be pretty rough here, for more info, check out the Facebook page where I post updates Daily - www.facebook.com/VRG.ArmA Cops, Civilians and Opfor factions Initially there will only be Cops and Civilians but once they are finished, I will be adding Opfor as a faction. Side missions There will be a large variety of side missions, some faction specific and some for everyone to have a go at. There will be things like military convoys to rob, enemy/rough squads to eliminate, diving missions, etc PMC Civilians will have the ability to become their own Private Military Company and accept contracts from other players and buy weapons. Day/Night cycles Server changes from Day to Night (and visa versa) every 30 minutes with 10 seconds warning. Dynamic weather cycles Weather changes every 30 minutes (when the time cycle changes) For more info on this, look at this post - www.facebook.com/VRG.ArmA/posts/697678226929785 Dynamic vehicle repair You can buy spare tires, engine parts, etc to fix your vehicle in a similar manner to the DayZ Mod You can also get Tank Tracks, Main Rotors, etc Video demonstration - Anti-hacking scripts These scripts will help prevent God mod, spawning vehicles, teleporting and all the other things we hate about script kiddies. Base Building You can buy almost any object in ArmA 3 and use it to build a base either solo or with a group of friends. I will be adding doors that will only open when a pin number is entered so you can lock your base. You can also buy weapon safes so you can lock all your items safely when you log off. Stat Save MySQL will be used as a Stat save to save Objects, Vehicles and most importantly, Players. Also, here's a video of my Boat loading/unloading script - It has been modified slightly since then. There is many more features and planned features but you'll have to check the FaceBook page for that - www.facebook.com/VRG.ArmA We hope you like our mission file and hope to see you on our server! VRG Nick
  9. Beldum

    Arma2MySQL

    Aah yes, I didn't notice that before. Thanks a lot, I managed to fix it by adding this code into it. if (_Headgear == "") then {_Headgear = "nil"}; if (_Goggles == "") then {_Goggles = "nil"}; if (_Uniform == "") then {_Uniform = "nil"}; if (_Vest == "") then {_Vest = "nil"}; if (_Backpack == "") then {_Backpack = "nil"};
  10. Beldum

    Arma2MySQL

    Hey Firefly, I was wondering if you could help me with this. I've been trying to make a script that saves players Weapons to MySQL, but I keep getting the [["Error"]] error. I have it saving everything else fine (Money, Position, etc) but I just can't seem to get the Inventory of a player to save. This is the Scripts and the error from the log: Client Side [player] call DBSaveWeapons Server Side DBSaveWeapons = { _Player = _this select 0; disableSerialization; _Player setVariable ["CanSave",false,true]; _display = uiNamespace getVariable "VRG_HUD_VAR"; _ctrlStats = _display displayCtrl 52458; _ctrlStats ctrlSetText "Status: Saving DBSaveWeapons"; [[["DBSaveWeapons",_Player],"ServerStats\VariableSave.sqf"],"BIS_fnc_execVM",false,false] spawn BIS_fnc_MP; while {isNil "ReturnedDatabase"} do {}; _return = ReturnedDatabase; ReturnedDatabase = nil; hint format["%1", _return]; _Player setVariable ["CanSave",true,true]; _ctrlStats ctrlSetText "Status: Safe DBSaveWeapons"; }; missionNamespace setVariable ["DBSaveWeapons",DBSaveWeapons]; publicVariable "DBSaveWeapons"; ServerStats\VariableSave.sqf (Server side) if (_case == "DBSaveWeapons") then { _Player = _this select 1; _owner = owner _Player; _PlayerID = getPlayerUID _Player; _Side = side _Player; _Magazines = primaryWeaponMagazine _Player + handgunMagazine _Player + secondaryWeaponMagazine _Player; _Weapons = weapons _Player; _WeaponItems = primaryWeaponItems _Player + secondaryWeaponItems _Player + handgunItems _Player; _AssignedItems = assignedItems _Player; _Headgear = headgear _Player; _Goggles = goggles _Player; _Uniform = uniform _Player; _Vest = vest _Player; _Backpack = backpack _Player; _AllItems = uniformItems _Player + vestItems _Player + backpackItems _Player; _WeaponItems = _WeaponItems call VRG_fnc_formatArray; _Magazines = _Magazines call VRG_fnc_formatArray; _Weapons = _Weapons call VRG_fnc_formatArray; _AssignedItems = _AssignedItems call VRG_fnc_formatArray; _AllItems = _AllItems call VRG_fnc_formatArray; if (_WeaponItems == "") then {_WeaponItems = []}; if (_Magazines == "") then {_Magazines = []}; if (_Weapons == "") then {_Weapons = []}; if (_AssignedItems == "") then {_AssignedItems = []}; if (_AllItems == "") then {_AllItems = []}; //hint format ["Var = %1", _WeaponItems]; _puid = format["%1%2", _PlayerID, _Side]; _query = format["UPDATE playerdata SET Magazines = '%1', Weapons = '%2', WeaponItems = '%3', AssignedItems = '%4', Headgear = '%5', Goggles = '%6', Uniform = '%7', Vest = '%8', Backpack = '%9', AllItems = '%10' WHERE uid = '%11'", _Magazines, _Weapons, _WeaponItems, _AssignedItems, _Headgear, _Goggles, _Uniform, _Vest, _Backpack, _AllItems, _puid]; while{!isNil("serverRunningQuery") && serverRunningQuery} do {}; serverRunningQuery = true; missionNamespace setVariable ["serverRunningQuery",serverRunningQuery]; publicVariable "serverRunningQuery"; _return = nil; while {isNil("_return")} do { _return = "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQLCommandAsync ['altislife', '%1']", _query]; //hint format["_return = %1", _return]; if (_return == "") then { _return = nil; }; sleep 0.5; }; serverRunningQuery = false; missionNamespace setVariable ["serverRunningQuery",serverRunningQuery]; publicVariable "serverRunningQuery"; ReturnedDatabase = _return; _owner publicVariableClient "ReturnedDatabase"; }; Error from the log Info: 19:39:39 - Received - Database: altislife SQL Query: UPDATE playerdata SET Health = '0', Position = '3697.78`12215.2`0.00143814', Direction = '18.8887', Account = '1e+006', Wallet = '100000', Thirst = '100', Hunger = '100', Licences = 'Licence_Rifle`Licence_Pistol`Licence_Donator`Licence_Admin', PayCheck = '20', Vehicles = '[]', Items = '[]' WHERE uid = '76561198085735088WEST' Info: 19:39:42 - Received - Database: altislife SQL Query: UPDATE playerdata SET Magazines = '30Rnd_65x39_caseless_mag`9Rnd_45ACP_Mag', Weapons = 'arifle_MX_F`hgun_ACPC2_F', WeaponItems = 'nil`nil`nil`nil`nil`nil', AssignedItems = 'ItemMap`ItemCompass`ItemWatch`ItemRadio', Headgear = ', Goggles = ', Uniform = 'U_B_CombatUniform_mcam_tshirt', Vest = 'V_HarnessO_brn', Backpack = ', AllItems = 'FirstAidKit`30Rnd_65x39_caseless_mag`30Rnd_65x39_caseless_mag`9Rnd_45ACP_Mag`9Rnd_45ACP_Mag`FirstAidKit' WHERE uid = '76561198085735088WEST' Warning: 19:39:42 - MySQL error. MySql.Data.MySqlClient.MySqlException (0x80004005): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FirstAidKit`30Rnd_65x39_caseless_mag`30Rnd_65x39_caseless_mag`9Rnd_45ACP_Mag`9Rn' at line 1 at MySql.Data.MySqlClient.MySqlStream.ReadPacket() at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId) at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int64& insertedId) at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force) at MySql.Data.MySqlClient.MySqlDataReader.NextResult() at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader() at Arma2NETMySQLPlugin.MySQL.RunOnDatabase(MySqlCommand command, Int32 maxResultSize)
  11. Thanks mate, I appreciate it! Yeah, pretty Dialog Menus aren't really my strong point but I've just been talking to Iceman77 and he's given me a lot of useful info on how to modify them to look nice, so i'll be working on making the Menus look nicer.
  12. Ok sweet, what's your Steam ID? edit: Don't worry. Found it on your profile. Adding you now.
  13. Hey Iceman, would I be able to inbox you to ask you something?
  14. Beldum

    Arma2MySQL

    Sorry, accidental re-post.
  15. Beldum

    Arma2MySQL

    Ok, i'll have a quick look aver it later on. I don't think anything is returning nil 'cause i use hint format["%1", _variable]; to tell me what is being returned ingame.
  16. Beldum

    Arma2MySQL

    Yes, it loops until I exit the mission.
  17. Beldum

    Arma2MySQL

    Nope, still no success. I can confirm that it is only sending one thing at a time 'cause of the log file. Here are the upgraded scripts. DBSaveArray DBSaveArray = { _Var = _this select 0; _Player = _this select 1; disableSerialization; _Player setVariable ["CanSave",false,true]; _display = uiNamespace getVariable "VRG_HUD_VAR"; _ctrlStats = _display displayCtrl 52458; _ctrlStats ctrlSetText "Status: Saving"; { _VarNameDB = _x select 0; _VarSet = _x select 1; [[["DBSave",_VarNameDB,_VarSet,_Player],"ServerStats\VariableSave.sqf"],"BIS_fnc_execVM",false,false] spawn BIS_fnc_MP; while {isNil "ReturnedDatabase"} do {}; _return = ReturnedDatabase; ReturnedDatabase = nil; hint format["%1\n\n%2 = %3", _return, _VarNameDB, _VarSet]; }forEach _Var; sleep 1; _Player setVariable ["CanSave",true,true]; _ctrlStats ctrlSetText "Status: Safe"; }; VariableSave.sqf #include "\x\cba\addons\main\script_macros.hpp" disableSerialization; serverRunningQuery = false; VRG_fnc_formatArray = compile preprocessFileLineNumbers "ServerStats\ToString.sqf"; _case = _this select 0; if (_case == "DBSave") then { _VarNameDB = _this select 1; _VarSet = _this select 2; _Player = _this select 3; _owner = owner _Player; _PlayerID = getPlayerUID _player; _query = format["UPDATE playerstats SET %1 = '%2' WHERE uid = '%3'", _VarNameDB, _VarSet, _PlayerID]; while{!isNil("serverRunningQuery") && serverRunningQuery} do {}; serverRunningQuery = true; _return = nil; while {isNil("_return")} do { _return = "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQLCommandAsync ['altislife', '%1']", _query]; hint format["_return = %1", _return]; if (_return == "") then { _return = nil; }; sleep 0.5; }; serverRunningQuery = false; ReturnedDatabase = _return; _owner publicVariableClient "ReturnedDatabase"; }; Error from log file (Same thing over and over again) 11/28/2013 14:43:25 function: Arma2NETMySQLCommandAsync ['altislife', 'UPDATE playerstats SET Wallet = '0' WHERE uid = '76561198085735088''] 11/28/2013 14:43:25 maxResultSize: 10239 11/28/2013 14:43:25 Result size: 0 11/28/2013 14:43:25 Result: <null>
  18. Beldum

    Arma2MySQL

    Ok thanks, I'll try this method when i get access to my Laptop. Yeah it's only for local testing. When it gets ran on the actual server, it is connected to a remote DB.
  19. Beldum

    Arma2MySQL

    I was wondering if you'd be able to help me with this. I have a few things set up to save to the DB but it always returns null. Here are the scripts. Withdraw money [[["Wallet",_Wallet],["Account",_Account]],_Player] call DBSaveArray; DBSaveArray DBSaveArray = { _Var = _this select 0;//Returns [["Wallet",_Wallet],["Account",_Account]] _Player = _this select 1;//Returns the player i am trying to update in the DB _PlayerID = getPlayerUID (_this select 1); disableSerialization; _Player setVariable ["CanSave",false,true]; _display = uiNamespace getVariable "VRG_HUD_VAR"; _ctrlStats = _display displayCtrl 52458; _ctrlStats ctrlSetText "Status: Saving"; { _VarNameDB = _x select 0; _VarSet = _x select 1; [[["DBSave",_VarNameDB,_VarSet,_PlayerID],"ServerStats\VariableSave.sqf"],"BIS_fnc_execVM",false,false] spawn BIS_fnc_MP; }forEach _Var; sleep 1; _Player setVariable ["CanSave",true,true]; _ctrlStats ctrlSetText "Status: Safe"; }; VariableSave.sqf #include "\x\cba\addons\main\script_macros.hpp" disableSerialization; serverRunningQuery = false; VRG_fnc_formatArray = compile preprocessFileLineNumbers "ServerStats\ToString.sqf"; _case = _this select 0;//Returns "DBSave" if (_case == "DBSave") then { _VarNameDB = _this select 1;//Returns "Wallet" or "Account" depending on what it's saving _VarSet = _this select 2;//Returns 0 or 500 depending on what it's saving _PlayerID = _this select 3;//Returns the players UID (76561198085735088) _query = format["UPDATE playerstats SET %1 = '%2' WHERE uid = '%3'", _VarNameDB, _VarSet, _PlayerID]; while{!isNil("serverRunningQuery") && serverRunningQuery} do {}; serverRunningQuery = true; _return = nil; while {isNil("_return")} do { _return = "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQLCommandAsync ['altislife', '%1']", _query]; hintSilent format["_return = %1", _return]; if (_return == "") then { _return = nil; }; sleep 0.5; }; serverRunningQuery = false; }; ArmA2Net log 11/27/2013 18:40:20 function: Arma2NETMySQLCommandAsync ['altislife', 'UPDATE playerstats SET Wallet = '0' WHERE uid = '76561198085735088''] 11/27/2013 18:40:20 maxResultSize: 10239 11/27/2013 18:40:20 Result size: 0 11/27/2013 18:40:20 Result: <null> 11/27/2013 18:40:21 function: Arma2NETMySQLCommandAsync ['altislife', 'UPDATE playerstats SET Account = '500' WHERE uid = '76561198085735088''] 11/27/2013 18:40:21 maxResultSize: 10239 11/27/2013 18:40:21 Result size: 0 11/27/2013 18:40:21 Result: <null> Databases.txt # This is a comment # Any line starting with a "#" is considered a comment # Make sure each of your database connections doesn't have a "#" in front! # Put each database connection you want on a separate line # The databasename MUST be unique! # For an example, see the following #databasetype,databasename,ipaddress,port,username,password # #mysql,arma,IpAdress,Port,armausername,secret #sqlite,weaponslite #SQL Server #mysql,altislife,119.252.190.185,5000,ArmA3,password #Local SQL mysql,altislife,127.0.0.1,2306,root,password #sqlite,weapons DB Setup www.dropbox.com/s/1znrdt99das66hk/Capture.JPG Hopefully that's enough info haha Thanks :)
  20. Beldum

    Arma2MySQL

    Yes i was thinking of doing something like that. I'll try this later on and see if i can get it working properly. Thanks
  21. Beldum

    Arma2MySQL

    Hey again. I was wondering if you could suggest a reliable way for checking if a Row in MySQL exists. I am currently doing this: _uid = getplayerUID player; SELECT ammo, weapons, etc FROM playerstats WHERE uid = '%1'", _uid The above returns a variable i called _return and i check if _return is nil or not. If _return is Nil it creates a new profile for the player and creates a new row in MySQL. If _return is not nil, it loads the players profile. The problem i have is sometimes it returns nil when there is already a profile for the player. Any suggestions? Actual scripts. Get account (Server side) ["VRG_GetPlayerAccount", { _puid = _this select 0; _unit = _this select 1; _side = _this select 2; _puid = format["%1%2", _puid, _side]; _owner = owner _unit; _query = format ["SELECT ammo, weapons, items, assignitems, headgear, goggles, vest, vestitems, uniform, uniformitems, backpack, packitems, handgunitems, primarywep, secondarywep, Direction, Position, Damage, Account, Wallet, Licence_car, Licence_truck, Licence_armor, Licence_Pilot, Licence_UAV, Licence_swat, Licence_spec, Licence_arty, Licence_engi, Licence_pmc, Licence_rifle, Licence_pistol, Licence_sniper, Licence_launcher, LockPicks, item_medkit, item_repairkit, item_fuelkit, OilCollected, ProcessedOil, PrimaryMag, SecondaryMag, HandGunMag FROM playerstats WHERE uid = '%1'", _puid]; while{!isNil("serverRunningQuery") && serverRunningQuery} do { //busy wait }; serverRunningQuery = true; _get = nil; while {isNil("_get")} do { _get = "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQLCommandAsync ['altislife', '%1']", _query]; //hint format["_get = %1", _get]; if (_get == "") then { _get = nil; }; sleep 0.5; //sleep for a half-second so we don't thrash the server with callExtension calls }; serverRunningQuery = false; ReturnedDatabaseLoadOuts = _get; _owner publicVariableClient "ReturnedDatabaseLoadOuts"; //Technically, this variable is kind of like a mutex for the client side } ] call CBA_fnc_addEventHandler; Checks if is nil or not (Player side)-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [[[player],"ServerStats\PlayerLoad.sqf"],"BIS_fnc_execVM",false,false] spawn BIS_fnc_MP; while {isNil("ReturnedDatabaseLoadOuts")} do { }; _get = ReturnedDatabaseLoadOuts; ReturnedDatabaseLoadOuts = nil; _get = call compile _get; _get = _get select 0; _get = _get select 0; if (!isNil "_get") then { hint "Profile found.\nLoading."; [[[player, _get],"ServerStats\PlayerLoad2.sqf"],"BIS_fnc_execVM",false,false] spawn BIS_fnc_MP; } else { hint "No profile found.\nCreating new."; _h = execVM "NewClient.sqf"; waitUntil {scriptDone _h}; execVM "ClientStats\ManualSave.sqf"; };
  22. Beldum

    Arma2MySQL

    Can you suggest a way for me to Load everything from a DB into the Server on Server start? I'm trying to make it save Vehicles and Objects (Like H-Barriers, Sand Bags, etc) Edit- I figured out a way :)
  23. Put this in Vehicle init - this addaction["Tow Vehicle","TowScript.sqf"]; Create a script called TowScript.sqf to execute Put the below script in it I haven't tested it but it should work. Let me know if it doesn't
  24. Beldum

    Arma2MySQL

    Yep, i got one working. It checks if there's an existing profile and if it returns nil, it creates a new one.
×