Jump to content

Kabs

Member
  • Content Count

    47
  • Joined

  • Last visited

  • Medals

Posts posted by Kabs


  1. Jman;2649716']in =BTC=_revive\=BTC=_functions.sqf

    Insert after line 350 which is: _injured setVariable ["BTC_need_revive"' date=0,true];

    	
    if (group player == group _injured) then {
            addToScore = [player, 1]; publicVariable "addToScore";
    ["ScoreBonus", ["Revived a fellow soldier.", "1"]] call bis_fnc_showNotification;
    } else {
    addToScore = [player, 2]; publicVariable "addToScore";
    ["ScoreBonus", ["Revived a squad member.", "2"]] call bis_fnc_showNotification;
    };
    

    description.ext

    Insert class ScoreBonus in class CfgNotifications or create as below:

    class CfgNotifications
    {
    class ScoreBonus
    {
    	title = "SCORE BONUS";
    	description = "%1";
    	iconPicture = "notificons\score_bonus.paa";
    	iconText = "+%2";
    	color[] = {0.38, 0.81, 0.16, 1};
    	priority = 5;
    };
    }
    

    init.sqf

    Add the following to the bottom of init.sqf:

    if (isDedicated) exitWith { "addToScore" addPublicVariableEventHandler { ((_this select 1) select 0) addScore ((_this select 1) select 1); }; };
    

    Finally, download score_bonus.paa, create a directory in your mission called notificons and copy to it.

    Thanks Jman, that worked well ! i wrote u a pm btw ;)


  2. Hello together,

    atm i am trying to add a function for giving points to medics wich have revived someone. As i am not so good with coding maybe someone can help me out. I would definately give regards for my project.

    so here comes the facts:

    some base code of how player makes points on kills.

    ScriptName "server\onplayerkilled.sqf";

    if (isServer) then

    {

    [format ["server\onplayerkilled.sqf %1",_this]] execVM "debug.sqf";

    PRIVATE ["_killed","_killer","_killedside","_killerside","_points","_killerunit"];

    _killed = _this select 0;

    _killer = _this select 1;

    _killedside = _this select 2;

    _points = 1;

    if (_killedside == SIDE_WEST) then {EGES = (EGES + _points);PublicVariable "EGES";};

    if (_killedside == SIDE_EAST) then {WGES = (WGES + _points);PublicVariable "WGES";};

    if ((alive _killer) && (_killer != _killed)) then

    {

    if ((side _killer) == west) then {_killerside = SIDE_WEST;};

    if ((side _killer) == east) then {_killerside = SIDE_EAST;};

    if ((_killedside == _killerside) && (_killerside != SIDE_CIV) && ((count (crew _killer))>0)) then

    {

    _killerunit = ((crew _killer) select 0);

    [] call compile format ["%1SCORE = %1SCORE - %2;PublicVariable ""%1SCORE"";",(vehiclevarname _killerunit),_points];

    };

    if ((_killedside != _killerside) && ((count (crew _killer))>0)) then

    {

    _killerunit = ((crew _killer) select 0);

    [] call compile format ["%1SCORE = %1SCORE + %2;PublicVariable ""%1SCORE"";",(vehiclevarname _killerunit),_points];

    };

    };

    };

    this i want to have a similar function for the stiuation ive someone revived. a look here in the BTC_first_aid.sqf where i want the point for the reviver to get.

    if (Alive player) then

    it would be great if someone can help me out here since i am really stucked.

    greetz and thanks in advance

    Kabs


  3. thought it fixed that, but only in editor preview. on my server, the gun is still missplaced. gotta look into that maybe some more..

    This is how i fixed it for server:

    if(typeOf _gun in _L) then {_gun attachto [_veh,[0,-2.4,0.30]];_gun setDir 360;_gun setPos getPos _gun;};

    if(typeOf _gun in _LT) then {_gun attachto [_veh,[0,-2.4,0.30]];_gun setDir 360;_gun setPos getPos _gun;};

    but now i have problems with the remove action. the guns trying to get to ground but ending again on the offroader.


  4. found out that static at gets destroyed when mounted.

    Edit: This fixes it. With new namecheck.

    _LT = ["I_static_AT_F","O_static_AT_F","B_static_AT_F"];

    if(typeOf _gun in _LT) then {_gun attachto [_veh,[0,-1.5,0.26]];_gun setDir 180;_gun setPos getPos _gun;};

    thought it fixed that, but only in editor preview. on my server, the gun is still missplaced. gotta look into that maybe some more..


  5. I am searching for a way to get the player out of them if they didnt have the required rank.

    i tried trigger (gamelogic axis=0):

    condition:

    (vehicle player isKindOf "O_Mortar_01_F" and rank player == "private" and player == driver vehicle player)

    anyobdy in mood of help :)?

    Thnx in advance!

    greetz

    Kabs

    ---------- Post added at 00:41 ---------- Previous post was at 23:16 ----------

    *SOLVED*

    got it just make detection to:

    (vehicle player isKindOf "StaticMortar" and rank player == "private" and player == gunner vehicle player)


  6. @ Kabs -

    I think there might be a setObjectTextureglobal

    well yeah i allready figured that out as u can red above ;)

    addactions are available when you are in the drivers / passenger seat. Might be a nice option to choose whether acctions are available when you are in the vehicle or you HAVE to be outside of the vehicle.

    jep, true. it seems unrealistic in any way. but i would set this optional too for good.


  7. Can you guys confirm this script is well, or did i miss something ?

    /////////////////////////////////// V1.1 ///////////////////////////////////

    /**************************************************************************

    Add to vehicle's init in the editor

    null = [this] execVM "scripts\MHQVehicleInit.sqf";

    ***************************************************************************/

    _spawnDelay = 20; // Respawn timer

    /**************************************************************************/

    ///////////////////////////////////////////////////////////////////////

    /////////////////////////// VEHICLE ACTIONS ///////////////////////////

    MHQ_vehAction2 =

    {

    _this addAction

    ["Prepare truck for weapon","support\scripts\truck_initv2.sqf",

    nil, 1, false, true, "",

    "alive _this && {speed _this == 0}"];

    publicVariable "VEH_vehAction1";

    };

    // Keep all added actions Above Server Check

    if (!isServer) exitWith {};

    ///////////////////////////////////////////////////////////////////////

    //////////////////// INIT MHQ / Actions / Extra ///////////////////////

    /**************************************************************************

    List of actions, sqf's, and any other functions to call on vehicle spawn

    or vehicle destroyed

    ***************************************************************************/

    MHQ_VehicleInit =

    {

    private ["_vehAction1","_vehAction2","_state","_vehicle"];

    _vehicle = _this select 0;

    _vehName = _this select 1;

    _state = _this select 2; // 1 - onSpawn; 0 - onDestroyed;

    _nameCheck = ["Offroad1", "Offroad2", "Offroad3", "Offroad4", "Offroad5", "Offroad6", "Offroad7", "Offroad8"]; // Use the actual names of the vehicles given in the editor here.

    // Vehicle spawn/Init

    if (_state == 1) then

    {

    // vehicles 3,4,5,6 will use this code

    if (_vehName in _nameCheck) then

    {

    MU = [_vehicle,"MHQ_vehAction2",nil,true] spawn BIS_fnc_MP;

    _vehicle setObjectTexture [0,"ambience\modules\images\fia_camo.paa"];

    _vehicle setObjectTexture [1,"ambience\modules\images\fia_camo.paa"];

    };

    _nameCheck2 = ["Offroad5", "Offroad6", "Offroad7", "Offroad8"]; // Use the actual names of the vehicles given in the editor here.

    // Vehicle spawn/Init

    if (_state == 1) then

    {

    // vehicles 3,4,5,6 will use this code

    if (_vehName in _nameCheck2) then

    {

    MU = [_vehicle,"MHQ_vehAction2",nil,true] spawn BIS_fnc_MP;

    _vehicle setObjectTexture [0,"ambience\modules\images\USWoodland512.paa"];

    _vehicle setObjectTexture [1,"ambience\modules\images\USWoodland512.paa"];

    };

    _nameCheck3 = ["Truck1", "Truck2", "Truck3", "Truck4", "Truck5", "Truck6", "Truck7", "Truck8", "Truck9", "Truck10", "Truck11", "Truck12", "Truck13", "Truck14", "Truck15", "Chopper1", "Chopper2", "Chopper3", "Chopper4"]; // Use the actual names of the vehicles given in the editor here.

    // vehicles 3,4,5,6 will use this code

    if (_vehName in _nameCheck3) then

    {

    _vehicle setObjectTexture [0,"ambience\modules\images\fia_camo.paa"];

    _vehicle setObjectTexture [1,"ambience\modules\images\fia_camo.paa"];

    _vehicle setObjectTexture [2,"ambience\modules\images\fia_camo.paa"];

    _heli setObjectTexture [0,"ambience\modules\images\fia_camo.paa"];

    _heli setObjectTexture [1,"ambience\modules\images\fia_camo.paa"];

    _heli setObjectTexture [2,"ambience\modules\images\fia_camo.paa"];

    };

    _nameCheck4 = ["Chopper5", "Chopper6", "Chopper7", "Chopper8", "Truck18", "Truck19", "Truck20", "Truck21", "Truck22", "Truck23", "Truck24", "Truck25", "Truck26", "Truck27", "Truck28", "Truck29", "Truck30", "Truck31", "Truck32", "Truck33"]; // Use the actual names of the vehicles given in the editor here.

    // vehicles 3,4,5,6 will use this code

    if (_vehName in _nameCheck4) then

    {

    _vehicle setObjectTexture [0,"ambience\modules\images\USWoodland512.paa"];

    _vehicle setObjectTexture [1,"ambience\modules\images\USWoodland512.paa"];

    _vehicle setObjectTexture [2,"ambience\modules\images\USWoodland512.paa"];

    _heli setObjectTexture [0,"ambience\modules\images\USWoodland512.paa"];

    _heli setObjectTexture [1,"ambience\modules\images\USWoodland512.paa"];

    _heli setObjectTexture [2,"ambience\modules\images\USWoodland512.paa"];

    };

    // vehciles one and two will use this code

    if (!(_vehName in _nameCheck)) then

    {

    // call addaction functions

    //_vehAction1 = [_vehicle,"MHQ_vehAction1",nil,true] spawn BIS_fnc_MP;

    // Execute external Sqf's

    // If these two don't work then you could try to use call compile with _vehName instead of _vehicle

    _vehicle setObjectTexture [0,"ambience\modules\images\fia_camo.paa"];

    _vehicle setObjectTexture [1,"ambience\modules\images\fia_camo.paa"];

    };

    };

    };

    // Vehicle Destroyed - If there's nothing to do then delete this if statement

    /**************************************************************************

    The Rest of the Script - Edit at your own risk

    ***************************************************************************/

    _vehicle = _this select 0;

    _NameCached = _this select 1;

    _oNL = objNull;

    // Loop until vehicle is valid

    if (_vehicle == _oNL)then

    {

    while {_vehicle == _oNL} do { sleep 0.5; _vehicle = _this select 0;};

    };

    // Get vehicle name and position

    _vehName = vehicleVarName _vehicle;

    _vehiclepos = getPos _vehicle;

    _vehicledir = getDir _vehicle;

    _classname = typeOf _vehicle;

    // Loop variables

    _vehKilled = false;

    _run = true;

    // Init actions, etc

    sleep 1;

    call {[_vehicle,_vehName, 1] call MHQ_VehicleInit};

    while {_run} do

    {

    sleep 1; // rest between cycles

    if (!(alive _vehicle)) then

    {

    _vehKilled = true;

    // Process Additional Destroyed functions

    call {[_vehicle,_vehName, 0] call MHQ_VehicleInit};

    sleep 1;

    };

    if (_vehKilled) then

    {

    sleep _spawnDelay;

    deleteVehicle _vehicle;

    sleep 4;

    // set vehicle position and name

    _vehicle = _classname createVehicle _vehiclepos;

    _vehicle setPos _vehiclepos;

    _vehicle setDir _vehicledir;

    sleep 0.1;

    // name vehicle globally

    _vehicle SetVehicleVarName _vehName;

    missionNameSpace setVariable [_vehName, _vehicle];

    publicVariable _vehName;

    // Process Additional Spawn functions

    call {[_vehicle, _vehName, 1] call MHQ_VehicleInit};

    // Respawn and init done!

    _vehKilled = false;

    };

    };

    i am not really sure :I Well whatever it seems not, since its not working ^ hope you can help me again Richard :/


  8. I gave John some tasks to fullfill his script.

    Why dont you use "BTC Revive" for your mobile HQ ? i am on it, but i got some problems atm, not knowing all your scripts wich may do problems to it.

    ATM when i respawn i cant find any point to respawn, still can press the button, ending with just lying down where i died in dead position, cant move but throw grenades ^O^ö


  9. but the version from LKincheloe is working for me without any problem ! *on his mod* so whats different ?

    ---------- Post added at 16:46 ---------- Previous post was at 15:28 ----------

    Well ok i got it fixed now... somehow... think there was a missmatch in comands @vehicle. Or a spelling problem, not shure.

    Now what you need to fix:

    1. when prepare vehicle -> get in driver = prepare lost until car is destroyed.

    2. When going out of mounted statics, often ends up glitching in the vehicle.

    3. a better understanding/request where you can activate the action on the vehicle.

    4. statics can be mounted from one vehicle to another *in mounted state* wich ends with the first vehicle removing itself no more static on itself bringing the static from the vehicle far away with the static, right behind the one without the static.

    Also you can remove from both vehicles then :p its sorta glitchy and will bring bugusing in pvp thought.

    5. we need to find a way to prevent statics from being dissassemble. For sure not if its mounted. this also leads to very bad glitches!!!!!!!

    if thoose bad 5 are fixed, i thinks that would be nearly a stable realse time.

    Thoose are big problems.


  10. can you show here all the folders/files and other things wich are needed to implement into another mission than resistance.

    Thus i tried to implement into another mod, but the "prepare vehicle" option isnt showing up on the vehicle...

    i found:

    Truck_initV2

    Truck_init

    truck_mountweapon

    i gave the vehicle the name and the script that was working in resistance.

    is there anything else i need to do other than copy thoose files in the correct folder way ?

    handle any id`s ?

    handle the prepare dialog elsewhere than thoose folders ?

    any other files that it is working with i missed ?

    something else ?


  11. The main problem with the mobile marker is it's a home-brew script and thus most likely breaks when touched. I figured out something else to do instead of making broken scripts.

    sounds good mate! hope you find the solution an easy task.

    I also saw that this despawn from eos markers my make problems. Sometimes when the troops spawn and u going off that zone for a while, there will be no units anymore and you arent beeing able to capture the zone anymore. For me it was the first Tower.

    BTW. so you said nothing about me, want to help with your mission. So ?

×