Jump to content

Persian MO

Member
  • Content Count

    274
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by Persian MO

  1. how to get this work? i want to save player score and load it again but i lost. private ["_name","_Profile","_name_UID"]; _name = name player; _Profile = format["%1", getPlayerUID player]; _name_UID = _name + "_" + _Profile; _exist = _name_UID call iniDB_exists; systemChat "Checking if you got an account..."; if (_exist) then { _addscore = [_name_UID, _Profile, "PlayerScore", "SCALAR"] call inidb_read; player addScore _addscore; }; ////////// private ["_name","_Profile","_name_UID"]; _name = name player; _Profile = format["%1", getPlayerUID player]; _name_UID = _name + "_" + _Profile; _score = [_name_UID,_Profile, "PlayerScore", score player] call iniDB_write; Persian MO_7656xxxxxxxxxxxxxxxx.ini [7656xxxxxxxxxxxx] PlayerScore="4"
  2. This is a sample code i'm using for addaction when it run on server. init.sqf fnc_addaction_rescue_hostage = { _target = (_this select 0); _target addaction ["<t color='#E61616'>Secure Hostage</t>", "Human_resourceF\rescue_hostage\mps_unit_join.sqf",[0],1,false,true,"","((_target distance _this)<5)"] }; and call it with this [[_hostage],"fnc_addaction_rescue_hostage", true,true] call BIS_fnc_MP;
  3. Persian MO

    Task Force Arrowhead Radio

    Is it possible to have a radio on table in HQ office and hear all coms between friendly units on speaker of that radio?
  4. I used indpi mod to save cargo. call compile preProcessFile "\inidbi\init.sqf"; _ret = ["testlock", "GLOBAL", "Locker2", L_Item_Storage] call iniDB_write; testlock.ini [GLOBAL] Locker2="[["Chemlight_green","addMagazine"],["30Rnd_65x39_caseless_mag","addMagazine"],["11Rnd_45ACP_Mag","addMagazine"],["11Rnd_45ACP_Mag","addMagazine"],["SmokeShell","addMagazine"],["SmokeShellGreen","addMagazine"],["Chemlight_green","addMagazine"],["arifle_MXC_ACO_F","addWeapon"],["hgun_Pistol_heavy_01_MRD_F","addWeapon"],["FirstAidKit","addItem"],["30Rnd_65x39_caseless_mag","addMagazine"],["30Rnd_65x39_caseless_mag","addMagazine"]]" How to refill cargo when game restart!? _items = ["testlock", "GLOBAL", "Locker2", "ARRAY"] call iniDB_read; ???
  5. I have box and save box cargo . call compile preProcessFile "\inidbi\init.sqf"; _array = [ (getWeaponCargo Storage_1), (getMagazineCargo Storage_1), (getItemCargo Storage_1), (getBackpackCargo Storage_1) ]; _ret = ["locker", "GLOBAL", "Locker1", _array] call iniDB_write; locker.ini [GLOBAL] Locker1="[[["arifle_MXC_ACO_F","hgun_Pistol_heavy_01_MRD_F"],[1,1]],[[],[]],[["FirstAidKit","V_BandollierB_rgr","U_B_CombatUniform_mcam","tf_anprc152_1","ItemGPS","ItemMap"],[1,1,1,1,1,1]],[[],[]]]" How i can read this and refill box in game restart!?
  6. Hi. Im trying to make a locker for players and player can save his weapons/items in there and save it for next time he join to server. Can you give me a example how i can to do that? I'm new about saving things and trying to save things via inidpi mod.
  7. Persian MO

    CoalaOs

    Can we have laptop screen on a billboard or tv screen too? for example , we can see all units movement on big screen as blufor tracker?
  8. Persian MO

    Task Force Arrowhead Radio

    will work this code on dedicated server? init.sqf if (isNil "tf_receivingDistanceMultiplicator") then { if (side player == West) then { player setVariable ["tf_receivingDistanceMultiplicator", 1,true]; if (!isDedicated) then { [] spawn { player addEventhandler ["respawn", {player setVariable ["tf_receivingDistanceMultiplicator", 1,true];}]; }; }; }; }; if (isNil "tf_sendingDistanceMultiplicator") then { if (side player == West) then { player setVariable ["tf_sendingDistanceMultiplicator", 1,true]; if (!isDedicated) then { [] spawn { player addEventhandler ["respawn", {player setVariable ["tf_sendingDistanceMultiplicator", 1,true];}]; }; }; }; }; Then later in mission, when player deploy a radio tower, radio send/receive range increase radio.sqf if (!isServer) exitWith {}; // Server only { if (side _x == West) then { _x setVariable ["tf_receivingDistanceMultiplicator", 1.5,true]; _x setVariable ["tf_sendingDistanceMultiplicator", 1.5,true]; if (!isDedicated) then { [] spawn { _x addEventhandler ["respawn", {_x setVariable ["tf_receivingDistanceMultiplicator", 1.5,true];}]; _x addEventhandler ["respawn", {_x setVariable ["tf_sendingDistanceMultiplicator", 1.5,true];}]; }; }; }; } foreach (playableUnits + switchableUnits);
  9. Thanks for respond. I tried this but i got error. RPT: 7:10:32 Error in expression <};}; case ((_access >= 0) && {(_member == "constructor")} && {((_argType == toU> 7:10:32 Error position: <== "constructor")} && {((_argType == toU> 7:10:32 Error ==: Type Array, expected Number,String,Not a Number,Object,Side,Group,Text,Config entry,Display (dialog),Control,Network Object,Team member,Task,Location 7:10:32 File C:\Users\Persian MO\Documents\Arma 3\missions\oo_pdw.Altis\oo_pdw.sqf, line 9 This is the code. initserver.sqf call compilefinal preprocessFileLineNumbers "oo_pdw.sqf"; sleep 2; _pdw = ["new", "inidbi"] call OO_PDW; ["setFileName", "mydp"] call _pdw; sleep 10; ["saveObject", ["myCustomBox",myBoxVar]] call OO_PDW; hint "Save all objects"; I tried some other names but same result.
  10. Anyone can help me?
  11. How to use this code? Function: = ["saveObject", [_name, _object]] call OO_PDW; save object, and all its cargo Parameters: _name : string _object : object I have a ammo box, name: Ammo2 I'm trying to save ammo box and its cargo but i can't figure out how to do it. _name and _object , How i should fill this parameters? Some RPT errors i got: 7:10:32 Error in expression <};}; case ((_access >= 0) && {(_member == "constructor")} && {((_argType == toU> 7:10:32 Error position: <== "constructor")} && {((_argType == toU> 7:10:32 Error ==: Type Array, expected Number,String,Not a Number,Object,Side,Group,Text,Config entry,Display (dialog),Control,Network Object,Team member,Task,Location 7:10:32 File C:\Users\Persian MO\Documents\Arma 3\missions\oo_pdw.Altis\oo_pdw.sqf, line 9
  12. After respawn all gears gone.Return back to normal gears for roles. is there any way to fix it or i am doing something wrong? Also, sometimes if you disable AI in lobby multiplayer, some obejcts like vehicles may be hide or you will see some strange loadout for units on dedicated server. I am using mods, Im not sure it happen because i have mods like rhs, hlc, cup or not. btw, your script is awesome.It make things easy.Thanks. Edit: I used addeventhandler to solve my porblem about respawn.Here is unit init: player2 AddEventHandler ["Respawn", {ek = ["rifleman",player2] execVM "ek\loadout.sqf";}]; I had to give a name to each units and add respawnonstart = 1 in description.ext.This is best way i got until now. There is a problem with JIP if i use this code in int or no name for each units.if someone join in middle of mission, all backpacks will gone. ek = ["rifleman",player2] execVM "ek\loadout.sqf"; player2 AddEventHandler ["Respawn", {ek = ["rifleman",player2] execVM "ek\loadout.sqf";}];
  13. http://forums.bistudio.com/showthread.php?192290-Restricting-Virtaul-Arsenal-Items-to-Soldier-Type/page2
  14. Is possible to change script to have 3 unit in each groups ? I removed car part in script to change it to some kind ambient enemy random patrols in around of players at a dedicated server but i can't figure out how to change it to have 3 or a random number units in groups.
  15. Persian MO

    Authentic Gameplay Modification

    Can i change those values and put code in description.ext in my mission for change jam chance? is there any way for this?
  16. Persian MO

    BLUFOR detected by OPFOR

    _knowsAbout = east knowsAbout player; How use this in a dedicated server? If a target spot west side units then alarm ?
  17. if (!isServer) exitWith {}; if ((target knowsabout player) > 2.0) then { ... This script working on dedicated server?
  18. Persian MO

    Authentic Gameplay Modification

    how to disable AGM SwitchUnits for a specific AI?
  19. Persian MO

    [RELEASE] Recurring Cleanup Script

    Nice script.Can you add a parameter for removing Abandoned vehicles?
  20. Persian MO

    Random tasks\objectives

    Here is my way to create a mission like this.Not the best but at-least working. - In game editor, put Gamelogic location anywhere you want to have AO area and name them: city1, city2, ... perhaps over on towns now,you need some scripts. - SHK_pos for find random position - SHK_Taskmaster for task hint - Shock's Building Garrison Function for fill houses at AO ***Example for 5 side missions*** init.sqf if ((!isServer) && (player != player)) then {waitUntil {player == player};}; // Player sync // disable radio and saving enablesaving [false, false]; enableSentences false; // use this code to control side missions call, later remove called mission from missions list if (isNil "side1") then { side1 = true;}; if (isNil "side2") then { side2 = true;}; if (isNil "side3") then { side3 = true;}; if (isNil "side4") then { side4 = true;}; if (isNil "side5") then { side5 = true;}; // call taskmaster and find position functions call compile preprocessfilelinenumbers "shk_pos\shk_pos_init.sqf"; call compile preprocessfile "shk_taskmaster.sqf"; // call side finer to select a mission and execute it if (isserver) then { null=[]execVM "side_finder.sqf"; }; Description.ext onLoadIntroTime=false; onLoadMissionTime=false; disabledAI=1; debriefing=1; RESPAWN = 3; respawnDelay = 30; respawnTemplates[] = {"Counter"}; joinUnassigned = 0; enableDebugConsole = 0; allowFunctionsLog = 0; showGPS = 1; showCompass = 1; showMap = 1; showPad = 1; showWatch = 1; class CfgFunctions { #include "SBGF\cfgfunctions.hpp" }; class Header { gameType = coop; minPlayers = 1; maxPlayers = 30; }; side_finer.sqf if (!isServer) exitWith {}; // Server only // create missions list array _allMissions = []; // check if the mission hasn't executed yet, so add it to missions list array... if ((side1)) then { _allMissions pushBack 1; }; if ((side2)) then { _allMissions pushBack 2; }; if ((side3)) then { _allMissions pushBack 3; }; if ((side4)) then { _allMissions pushBack 4; }; if ((side5)) then { _allMissions pushBack 5; }; // find random a mission from missions list array _mission = (_allMissions call BIS_fnc_selectRandom); // execute the selected mission... if (_mission == 1) then { [] execVM "sidemissions\side1.sqf"; }; if (_mission == 2) then { [] execVM "sidemissions\side2.sqf"; }; if (_mission == 3) then { [] execVM "sidemissions\side3.sqf"; }; if (_mission == 4) then { [] execVM "sidemissions\side4.sqf"; }; if (_mission == 5) then { [] execVM "sidemissions\side5.sqf"; }; - Create a folder and name it: sidemissions create side missions inside this folder and name it like: side1, side2, side3, side 4, side5, ... Example a side mission: side1.sqf //if (!isServer) exitWith {}; // Server only // set false the side1 so side finder will not execute this mission again side1 = false; sleep 200; // find center of AO...looking for gamelogic location which created before in editor _sidepos = [city1, city2, city3, city4, city5, city6, city7, city8, city9, city10] call BIS_fnc_selectRandom; // add marker on AO/target _marker = createMarker ["side_area", _sidepos]; _marker setMarkerType "hd_destroy"; _marker setMarkerColor "ColorRed"; _marker setMarkerText " Destroy jet"; _marker setMarkerSize [1,1]; // spawn target jet = createVehicle ["RHS_A10", _sidepos, [], 0, "CAN_COLLIDE"]; jet lock true; jet setdir 140; // Add task //Task ID-Task name-Task description and some other options ["Task1","Destroy jet","Seek and destroy NATO <marker name='side_area'>Jet</marker> at the airbase.",true,["Destroy jet",getmarkerpos "side_area"]] call SHK_Taskmaster_add ; // spawn enemy // find position to spawn infantry NATO //_pos = [<marker>,<radios>,<direct>,<if false, no water> _pos = [getmarkerpos "side_area", random 50, random 360, false, [0,0]] call SHK_pos; // create random units in a group and spawn it ... [3,0.2] means 100% 3 first classname will spawn and 20% possibility for rest classnames _grp1 = [(_pos), West,[ "B_Soldier_SL_F","B_soldier_AT_F","B_soldier_AR_F","B_Soldier_A_F","B_medic_F","B_RangeMaster_F", "B_Competitor_F","B_engineer_F","B_soldier_exp_F","B_Soldier_GL_F","B_soldier_M_F","B_soldier_AA_F", "B_soldier_PG_F","B_soldier_repair_F","B_Soldier_F","B_soldier_LAT_F","B_Soldier_lite_F","B_soldier_UAV_F", "B_sniper_F","B_spotter_F" ],[],[],[],[],[3,0.2]] call bis_fnc_spawngroup; // Give order to group to start patrol at AO marker area, radios 100 meter [_grp1, (getmarkerPos "side_area"), 100] call bis_fnc_taskPatrol; // units in house if (isserver) then { _units = ["side_area",West,200,0.1,[ "B_Soldier_SL_F","B_soldier_AT_F","B_soldier_AR_F","B_Soldier_A_F","B_medic_F","B_RangeMaster_F", "B_Competitor_F","B_engineer_F","B_soldier_exp_F","B_Soldier_GL_F","B_soldier_M_F","B_soldier_AA_F", "B_soldier_PG_F","B_soldier_repair_F","B_Soldier_F","B_soldier_LAT_F","B_Soldier_lite_F","B_soldier_UAV_F", "B_sniper_F","B_spotter_F" ],-1] spawn SBGF_fnc_garrison; }; // spawn car at AO area and patrol _grp2 = createGroup West; _pos = [ (getmarkerPos "side_area"), random 300, random 359, false, [1, 300]] call SHK_pos; _carlist = ["rhsusf_m1025_d_m2","rhsusf_m1025_d_Mk19","B_MRAP_01_gmg_F","B_MRAP_01_hmg_F"] call BIS_fnc_selectRandom; _car1 = createVehicle [_carlist, _pos, [], 0, "CAN_COLLIDE"]; "B_Soldier_GL_F" createUnit [_pos, _grp2, " this MoveinGunner _car1",0.8,"SEARGENT"]; "B_Soldier_GL_F" createUnit [_pos, _grp2, " this MoveinDriver _car1",0.6,"PRIVATE"]; [_grp2, (getmarkerPos "side_area"), 1000] call bis_fnc_taskPatrol; // Spawn tank/apc at AO area and patrol _grp3 = createGroup West; _pos = [ (getmarkerPos "side_area"), random 300, random 359, false, [0,0]] call SHK_pos; _apclist = [ "B_APC_Tracked_01_rcws_F","B_APC_Wheeled_01_cannon_F","B_APC_Tracked_01_rcws_F","B_APC_Wheeled_01_cannon_F" ] call BIS_fnc_selectRandom; _apc1 = createVehicle [_apclist, _pos, [], 0, "CAN_COLLIDE"]; "B_crew_F" createUnit [_pos, _grp3, " this MoveinCommander _apc1",0.8,"SEARGENT"]; "B_crew_F" createUnit [_pos, _grp3, " this MoveinGunner _apc1",0.6,"PRIVATE"]; "B_crew_F" createUnit [_pos, _grp3, " this MoveinDriver _apc1",0.6,"PRIVATE"]; [_grp3, (getmarkerPos "side_area"), 1000] call bis_fnc_taskPatrol; // WAIT UNTIL objective destroy waitUntil { (!alive jet) }; // task complete hint ["Task1","succeeded"] call SHK_Taskmaster_upd; // delete AO marker and target deleteMarker "side_area"; sleep 10; deletevehicle jet; // remove mans/vehicles/air/static "optional" sleep 30; {if (!(isplayer _x)) then {deleteVehicle _x;};} foreach nearestobjects [_sidepos,[ "air","StaticWeapon","Landvehicle" ],2000]; sleep 10; {if (!(isplayer _x)) then {deleteVehicle _x;};} foreach nearestobjects [_sidepos,[ "man" ],2000]; sleep 5; // go for next side mission if (isserver) then { null=[]execVM "side_finder.sqf"; }; if(true)exitWith{}; and add more side missions like this. Note that i used mods classnames for some units and vehicles in example, you have to change classnames to arma vanilla classnames
  21. I m working on a DM mission.in this mission, last man standing alive will get a point and then game moving for next round.I get a code for trigger to do this but in hint board player won't sort by score,e.g player with 2 time win staying under player with one win. here is code in trigger act: Comment "By Renz"; if (isNil "ref") then { ref = []; playerScores = []; }; textArray = []; livingCount = {isPlayer _x && alive _x} count thisList; if ( livingCount == 0 ) then { hint "Draw!"; } else { systemChat "Last Man detected"; lastMan = objNull; }; {if (isPlayer _x && alive _x) then {lastMan = _x} } forEach thisList; unitID = name lastMan; index = (ref find unitID); if (index == -1) then { ref pushBack unitID; playerScores pushBack [unitID, 1]; } else { (playerScores select index) set[1, ((playerScores select index) select 1) + 1]; }; sortedScores = [playerScores, [], {(_x select 1)}, "ASCEND"] call BIS_fnc_sortBy; textArray = []; { _line = format["%3. %1 - %2",(_x select 0), (_x select 1),(_forEachIndex + 1)]; textArray pushBack _line } forEach sortedScores; countData = count sortedScores; if (count sortedScores < 5) then { for "_i" from 1 to (5 - countData) do { textArray pushBack ""; }; }; hint format["thisList: %6\n netID: %7 \n lastMan: %1\n livingCount: %2\n ref: %3 \n pScores: %4\n sortedScores %5",lastMan,livingCount,ref,pScores,sortedScores,thisList,unitID]; paragraph = format["Leader Board\n%1 \n%2 \n%3 \n%4 \n%5 ", (textArray select 0), (textArray select 1),(textArray select 2),(textArray select 3),(textArray select 4)]; GlobalHint = paragraph; publicVariable "GlobalHint"; hint GlobalHint; if (isServer) then { publicVariable "playerScores"; publicVariable "ref"; }; countstart = false; how i change this code to get players list sort by score in hint?
  22. Persian MO

    Authentic Gameplay Modification

    If all player are unconscious then mission fail, how to do it? This is good update, thanks for your hard works. I try ed to test heating and jam on MG but after used 5 maps, nothing happened.In older version, weapons got heat and jam faster then now and it was better if you ask me. Do you removed red color on hud when clips used and empty?
×