English Invisible backpack for medics and cops

  • Auteur de la discussion Auteur de la discussion Mathis
  • Date de début Date de début

Mathis

The-Programmer
Membre du personnel
29/12/19
503
16
48
1 100
Welcome to this tutorial that will allow you to add invisible backpacks.
This tutorial is a response to an help request from Skyrise Skyrise.

Go in your mission/core/functions/fn_playerSkins.sqf, and search it :
Code:
case west {
(so that the cops have an invisible bag)
and/or
Code:
case independent {
(so that medics have an invisible bag)

Then, below the "case" you wanted, add this :
Code:
if ((backpack player) == "ClassnameBackpack") then {
     [player] remoteExecCall ["life_fnc_setbackpacktexture",0];
};

Create a file fn_setBackpackTexture.sqf into your core/civilian, and add this in the file :
Code:
_player = param [0,objNull,[objNull]];
if (isNull _player) exitWith {};

(unitbackpack _player) hideObject true;

And then, in Functions.hpp, find the "Civilian" class, and under :
Code:
file = "core\civilian";
Add on the line below :
Code:
class setBackpackTexture {};

And finally, look for this in the CfgRemoteExec.hpp :
Code:
/* Functions for everyone */
And add this below :
Code:
F(life_fnc_setbackpacktexture,ANYONE)

There you go, quick as lightning !

Sincerely,
Forum Manager Mathis
 
Is there a way to automatically reload the skins? Since I have the invisible backpack for civi in crafting, it is not displayed as invisible until after the relog
 
Dernière édition:
I'm not sure if it's the best way to do that, but you can try to add at the end of your core/init.sqf :
Code:
[] spawn {
    while {true} do {
        uiSleep 60;
        [] call life_fnc_playerSkins;
    };
};

It will refresh the skins every 60 seconds
 
  • Like
Les réactions: Crysis
I'm not sure if it's the best way to do that, but you can try to add at the end of your core/init.sqf :
Code:
[] spawn {
    while {true} do {
        uiSleep 60;
        [] call life_fnc_playerSkins;
    };
};

It will refresh the skins every 60 seconds
Thank you, that worked!
 
the backpack for civilians is still visible to other players! Can I change it so that the backpack for other players no longer sees the backpack of a civilian?

It works for cops and medics