Jump to content

gokitty1199

Member
  • Content Count

    311
  • Joined

  • Last visited

  • Medals

Everything posted by gokitty1199

  1. im not sure if anyone will find this of much use here but i made a few tutorials starting from how to install inidbi2 and how to check/create a database file and then how to retrieve from the file and write to the file(saving). its not the greatest but it may be enough to get someone going since there is not much in relation to how to use it.
  2. this will run locally on the client by setting the last parameter to false so we can filter out who we dont want the doors to be locked/unlocked for. we do a if/else statement, if the side of the player is west(im assuming your cop side) then doors will be unlocked, if the side is anything other than west then the doors will stay locked. do this for however many doors there are in that building, right now its only for 3 doors, you should be able to see how many doors there are in the editor by double clicking on the building and seeing where you can set the doors by default for locked/unlocked/open. if ((side player) == WEST) then { buildingName setVariable["bis_disabled_Door_1",0,false]; buildingName setVariable["bis_disabled_Door_2",0,false]; buildingName setVariable["bis_disabled_Door_3",0,false]; } else { buildingName setVariable["bis_disabled_Door_1",1,false]; buildingName setVariable["bis_disabled_Door_2",1,false]; buildingName setVariable["bis_disabled_Door_3",1,false]; };
  3. gokitty1199

    Sniper

    only thing i can think of is place the rifle on the ground, set its damage to 1 and disable its simulation so it should stay how you placed it, as for the bipod you may be able to call an animation to deploy it but im not sure. then double click the weapon and in the init of it, make an addaction saying something like use weapon and when its clicked have it execute a .sqf file this addAction ["use weapon", { usingWepH = [_this select 0, _this select 1] execVM "useWeapon.sqf"; }]; and inside useWeapon.sqf you need to run a loop to continually check for the players stance and force the stance back to prone if the player tries to change it kind of like this. this isnt tested but just a off the head idea so may not work as intended _weapon = (_this select 0); _unit = (_this select 1); _unit addWeapon "class name of weapon to use"; _weapon addAction ["get off weapon", { terminate usingWepH; (_this select 1) addWeapon "class name of old weapon"; }]; _unit playActionNow "PlayerProne"; while {alive _unit} do { _stance = stance _unit; if (_stance != "PRONE") then { _unit playActionNow "PlayerProne"; }; sleep 0.1; };
  4. in your description.ext you have the path set to "\music\track1.ogg" when it should be "\music\track01.ogg" look at your file name in the music folder. you also do not need .ogg at the end of the file so just leave the file called track01 so class CfgMusic { tracks[]={}; class music1 { name = "music1"; sound[] = {"\music\track01.ogg", db+10, 1.0}; }; };
  5. gokitty1199

    limit game area in a map

    in the initPlayerLocal, define a variable called playableInZone and set it to false(this is only if you have it so the players are required to enter the playable area first and going in/out of it upon death, if not then just remove this variable and remove the first if statement in the outOfZone.sqf and remove playableInZone = true in the activation box of the trigger. make a trigger with the name playableArea), set for any player present with this in the condition and make it cover the area you want to be the playable area. make sure the trigger is repeatable this && player in thisList in the activation do playableInZone = true; in the deactivation do null = [] execVm "zone\outOfZone.sqf"; inside outOfZone.sqf do _timer = 10;//set for how long it takes that the unit can be outside of the zone before being killed if (playableInZone) then { while {_timer > 0} do { hint format ["You Have %1 Seconds To ReEnter The Playable Area", _timer]; _timer = _timer - 1; _backInZone = [playableArea, player] call BIS_fnc_inTrigger;//checks if player re entered the zone if (_backInZone) exitWith {hint "Back In Zone"; _keepAlive = true;};//if the player did re enter the zone then exit the loop/script sleep 1; }; player setDammage 1;//if the timer runs out/hits 0 then it will kill the player };
  6. gokitty1199

    CZ75 Breaching Doors Script

    i forgot to unpack the pbo, sorry it was 11pm when i posted and ive made 10 tutorials in the past 6 hours so im braindead currently
  7. gokitty1199

    CZ75 Breaching Doors Script

    i opened the .pbo in notepad++ and got 570 lines, downloaded from the middle link
  8. i have a global variable called award created in the initPlayerLocal and the player earns awards for a certain task(think of it as money). when the player is killed i want it to drop money on the dead players location and give that money an addAction for others players to take. when another player clicks the addAction i want the player that clicked it to gain the award money that the dead player dropped. pretty much like in life servers how the money on a player drops when he is killed and others can take it. it throws a unknown variable error(which i know why but cant figure out how to get around it). ive never used set/getVariable before so im unsure if that would be of use? i need to learn it, heres my onPlayerKilled.sqf _unit = (_this select 0); _amount = award; _money = "Land_Money_F"; _pos = getPos _unit; removeAllWeapons _unit; removeAllItems _unit; removeBackpack _unit; _handle = _money createVehicle [0, 0, 0]; _handle setPos _pos; [_handle, ["Take Award", {award = award + _amount; hint format["You have found %1 dollars", _amount]; deleteVehicle (_this select 0)}, [], 6, false, true, "(side player == RESISTANCE", "_this distance _target < 2.5"]] remoteExec ["addAction", 0, true]; [_handle, ["Take Money To Evidence", {deleteVehicle (_this select 0)}, [], 6, false, true, "(side player == WEST", "_this distance _target < 2.5"]] remoteExec ["addAction", 0, true];
  9. yea _handle was just used since its such a small script, so in arma it acts like a pointer in c++. get/setVariable go way beyond what i thought they did when i first looked at them a year ago, will be giving them a closer look for sure. thank you
  10. thank you, right after posted i looked up get/set variable and came up with this _unit = (_this select 0); _money = "Land_Money_F"; _pos = getPos _unit; removeAllWeapons _unit; removeAllItems _unit; removeBackpack _unit; _handle = _money createVehicle [0, 0, 0]; _handle setPos _pos; _handle setVariable ["amount", award]; [_handle, ["Take Award", {_amount = (_this select 0) getVariable "amount"; award = award + _amount; hint format["You have found %1 dollars", _amount]; deleteVehicle (_this select 0)}, [], 6, false, true, "(side player == RESISTANCE", "_this distance _target < 2.5"]] remoteExec ["addAction", 0, true]; [_handle, ["Take Money To Evidence", {deleteVehicle (_this select 0)}, [], 6, false, true, "(side player == WEST", "_this distance _target < 2.5"]] remoteExec ["addAction", 0, true]; it works, seems very useful as you said. please tell me if i am understanding this right. it sets a variable that is local to _handle/the money object's namespace, then when someone presses the addAction it gets the variable from the _handle/money object's namespace and stores it in a local variable that can be accessed by the player to use in the rest of the script inside of the addAction?
  11. create a .sqf file called onPlayerRespawn and put this in it _unit = (_this select 0); removeAllWeapons _unit; removeAllItems _unit; removeAllAssignedItems _unit; removeUniform _unit; removeVest _unit; removeBackpack _unit; removeHeadgear _unit; removeGoggles _unit; comment "Add containers"; _unit forceAddUniform "rhs_uniform_acu_ucp"; _unit addItemToUniform "ACE_EarPlugs"; for "_i" from 1 to 7 do {_unit addItemToUniform "rhsusf_mag_7x45acp_MHP";}; _unit addHeadgear "rhsusf_patrolcap_ucp"; comment "Add weapons"; _unit addWeapon "rhsusf_weap_m1911a1"; comment "Add items"; _unit linkItem "ItemMap"; _unit linkItem "ItemCompass"; _unit linkItem "tf_microdagr"; _unit linkItem "tf_anprc152_5"; _unit linkItem "ItemGPS"; comment "Set identity"; _unit setFace "WhiteHead_20"; _unit setSpeaker "ace_novoice"; open or create a Description.ext file and put this in it respawnOnStart = -1; that should run whats in the onPlayerRespawn.sqf file without actually killing the player.
  12. gokitty1199

    CZ75 Breaching Doors Script

    just go through it and change the name of the addaction and change the object that is placed to the class name of the demo charge
  13. just a random note i updated it a tad after you replied about how to regularly save it
  14. you could try using the method i have setup and posted above. on the server create 2 publicVariableEventHandlers, one to check and one to save(make sure to execVM the .sqf file that these are in when the mission loads before any client will connect for added safety. on the client(for example lets use initPlayerLocal) get some information from the player such as their UID, name, and clientID as we will be passing them to the servers check handler with publicVariableServer _id = getPlayerUID player;//players UID _name = name player;//name of player duh _cId = clientOwner;//client id playerCheckInfo = [_id, _name, _cId];//array to pass that info to the eventhandler publicVariableServer "playerCheckInfo";//call event handler with the array being passed this will run the publicVariableEventHandlers on the server that is called "playerCheckInfo". inside of that eventHandler setup something like this that will use the "new" command and then the "exist" command to check if the player already has a file with their UID. do so like this "playerCheckInfo" addPublicVariableEventHandler//the eventhandler that should of already been ran when the mission starts { private ["_data"]; _data = _this select 1;//define _data using private and set it equal to _this select 1 which is the information that was passed to this event handler. //if you did _this select 0 then it just selects the name of the eventHandler _id = _data select 0;//sets _id to the players UID/first part of information passed _name = _data select 1;//sets _name to the players name/second part of information passed _cId = _data select 2;//sets _cId to the players clientID/third part of information passed _inidbi = ["new", _id] call OO_INIDBI;//create a new class object with the name _inidbi _dataExist = "exists" call _inidbi;//check if a file exists with the file name of the players UID if (_dataExist) then//if it exists then run a .sqf file that will be used to get the information and store it onto the player { null = [_id, _cId] execVM "loadData.sqf";//pass in the players id for the check, and their clientID so we can run publicVariableClient on their //client } else//if it doesnt exist then run a .sqf file to create the file with the wanted information { null = [_id, _name] execVM "createNewDatabase.sqf";//pass in stuff you want such as the id(needed) and players name }; }; inside of createNewDatabase do this //players name and UID were passed into this file so _id = _this select 0;//store players UID _name = _this select 1;//store players name _inidbi = ["new", _id] call OO_INIDBI;//create a new class //this is what creates the actual file for us to see ["write", ["PlayerInfo", "Name", _name]] call _inidbi;//create a section for the players info with their name and other details that you want to store ["write", ["PlayerStats", "Kills", 0]] call _inidbi;//section for their stats such as kills and set it to 0(since first time joining) //do the same for the rest of what you want ok now that its setup so it creates a database if its the players first time joining, we can work on loadData.sqf so when he reconnects it just loads the data from the file like this //players UID and clientID were passed into this file so _id = _this select 0; _cId = _this select 1; _inidbi = ["new", _id] call OO_INIDBI;//create a new class _kills = ["read", ["PlayerStats", "Kills", []]] call _inidbi;//reads from PlayerStats section and the Kills portion and stores in _kills loadData = [_kills];//when you have more stuff just put it in here but create array loadData _cId publicVariableClient "loadData";//pass loadData to the player whos clientID matches the one that is stored in _cId so this will execute the eventhandler called loadData that is on the client so we will just need to store the info passed into whatever variable we want(using just a global variable for this example) //literally does the same thing as the servers event handler so not gonna bother commenting through "loadData" addPublicVariableEventHandler { private ["_data"]; _data = _this select 1; _kills = _data select 0; kills = _kills;//since _kills was passed into this eventHandler, set your kills variable to equal it. so kills should now be equal to what was in the file }; as for how to save the data, it depends on how you want it done. im assuming your variables are being updated constantly on the client so you could make an eventhandler that runs when the player dies or reconnects and have it call a file that does the same thing as the first part of the post but instead of calling playerCheckInfo call it playerSave pass in the stuff such as kills/shots fired or whatever and inside the new playerSave event handler just have it write to the file in the exact same way as playerCheckInfo did.
  15. yep that was why. it was already creating the file from somewhere somehow for the client before that function was called, thanks man.
  16. ill look into that and see if it creates a file before it calls the check which would make sense if thats the case. thank you! from what ive experience just calling "new" doesnt create the file, it creates once you write to it so its like this. someone correct me if im wrong please _inidbi = ["new", "myNewFile"] call OO_INIDBI; _exist = "exist" call _inidbi; if (_exist) then { hint "file exists"; } else { hint "no file exists";//should hint this }; ["write", ["testS", "testK", "randomStr"]] call _inidbi; _exist = "exist" call _inidbi; if (_exist) then { hint "file exists";//should hint this } else { hint "no file exists"; };
  17. whats your question? are you trying to broadcast it?
  18. thats strange why its different on the clients(never used moduleSector before), one way to broadcast a variable to all machines is by using publicVariable, so on the server/host do publicVariable "variableName"; and it will broadcast variableName to everyone/everything. keep in mind you can only broadcast global variables so trying to do publicVariable "_variableName"; wont work
  19. thats is weird. ive tried restarting arma and same with my pc as this has been a 20+ hour project so far over the past week with no luck. ill try copying it over and using it in another mission and see if that changes the result if it bugged the mission somehow or not.
  20. thats what i initially did and had gotten everything working as it should, it still saves the data i need properly later on in the mission and when there is data for the player already created inside the db folder it loads the data it needs properly, its just that _inidbi = ["new", _id] call OO_INIDBI; _dataExist = "exists" call _inidbi; always returns true no matter what situation i try. i didnt use a log file i globally executed a hint right after _dataExist = "exists" call _inidbi; so i could see what it was returning. it returned true when it was suppose to be false and returned true when it was suppose to return true lol. when i made another little test mission previously to get familiar with inidbi2 i had a similar setup and it would return true/false without any issue, it just has my brain in a twist
  21. have you thought about having a series of waitUntil commands and run them in order? such as waitUntil{sleep 1; !alive campOfficer}; execVM "task3.sqf"; and then doing the same thing in task3.sqf but to wait until the damage of the tower is set to 1 and then execute the next waitUntil for task 4 and so on and so on to keep the mission moving and the scripts simple.
  22. gokitty1199

    floor random from Nested Array

    have you thought about having a global function inside the same script and having it return the value that _moneyAmount holds? that way you should just be able to call the function and use its return value whenever you need it
  23. gokitty1199

    floor random from Nested Array

    howabow dis? _moneyAmount = floor random [_moneyShipment select 1, _moneyShipment select 2, _moneyShipment select 3];
  24. Question, im currently having a strange issue that I was not having before. when the player loads into the mission i have it execute a script called clientStart.sqf which calls a function to get all the needed information about the player and send it to the server using publicVariableServer clientStart.sqf. when the player first joins the server it runs whats inside the else statement. _isRespawn = _this select 0; player enableFatigue false; if (_isRespawn) then { if ((side player) == WEST) then { execVM "cop\sayings.sqf"; player allowDamage false; }; } else { execVM "database\client\eventHandlers.sqf"; if ((side player) == INDEPENDENT) then { execVM "tools\setTools.sqf"; execVM "shop\shopInit.sqf"; } else { execVM "cop\sayings.sqf"; player allowDamage false; }; _checkClientFnc = { hint "IN CHECK CLIENT FNC"; _id = getPlayerUID player; _name = name player; _cId = clientOwner; pid = [_id, _name, pGear, _cId]; publicVariableServer "pid"; }; call _checkClientFnc; }; the pid publicVariableEventHandler is ran from the server as soon as the mission starts in the file clientCheck.sqf "pid" addPublicVariableEventHandler { "IN PID EVENT HANDLER" remoteExec ["hint"]; private ["_data"]; _data = _this select 1; _id = _data select 0; _name = _data select 1; _gear = _data select 2; _cId = _data select 3; _inidbi = ["new", _id] call OO_INIDBI; _dataExist = "exists" call _inidbi; if (_dataExist) then { "IN IF STATEMENT OF PID EVENT HANDLER" remoteExec ["hint"]; null = [_id, _cId] execVM "database\getData.sqf"; } else { "IN ELSE STATEMENT OF PID EVENT HANDLER" remoteExec ["hint"]; null = [_id, _name, _gear] execVM "database\createDatabase.sqf"; }; }; and thats where im running into issues. i have a variable _dataExist to check if the file is already existing for the players UID, if no file exists it is suppose to run createDatabase.sqf, and if it does exist it is suppose to run getData.sqf. however no matter what, for some reason it always runs getData.sqf because _dataExist always returns true for some reason even when i clear out the db folder entirely. also when it does run getData.sqf it somehow manages to create a database as well and store the information somehow using "read" and i am just at a complete loss here as to whats going wrong. this is my first time really using inidbi2 btw, so far its been great but somehow something goofed. this is being tested on a dedicated server(off my machine) and the mod is running on the server, the mod is not running on the test client. heres getData and createDatabase _id = _this select 0; _cId = _this select 1; _inidbi = ["new", _id] call OO_INIDBI; _cash = ["read", ["PlayerInfo", "Cash", []]] call _inidbi; _gear = ["read", ["PlayerInfo", "Gear", []]] call _inidbi; _maxWeight = ["read", ["PlayerTools", "LockPick", []]] call _inidbi; _lockPick = ["read", ["PlayerTools", "LockPick", []]] call _inidbi; loadData = [_cash, _gear, _lockPick, _maxWeight]; _cId publicVariableClient "loadData"; //"IN CREATE DATABASE FILE" remoteExec ["hint"]; _id = _this select 0; _name = _this select 1; _gear = _this select 2; _inidbi = ["new", _id] call OO_INIDBI; ["write", ["PlayerInfo", "Name", _name]] call _inidbi; ["write", ["PlayerInfo", "Gear", _gear]] call _inidbi; ["write", ["PlayerInfo", "Cash", 0]] call _inidbi; ["write", ["PlayerInfo", "MaxWeight", 100]] call _inidbi; ["write", ["PlayerTools", "LockPick", false]] call _inidbi; and heres the mission. the files that are in question are server\clientCheck, server\createDatabase, server\getData https://www.dropbox.com/s/wul8c0wmaabrnid/robTheHood.Malden.rar?dl=0
×