Headshot Suicide by right-mouse-click in player gear

Bruchi

New Member
Hi @all..

would there be any chance to change Grafzahl's Headshot suicide script to
player gear -> right-mouse-click on handgun ?
Maybe by puttin it into server.pbo ?

Hope that anyone has an idea...
 
There isn't a way as far as I know to edit the right click menu on items unless you change CfgMagazines (or is it CfgWeapons for a handgun?) which since it is not pointed to by anything in the mission.pbo cannot be changed without making a custom mod.
 
Looks possible but that's a lot of code to figure out exactly what the script is receiving from CfgMagazines.

Nice to see someone finding a way around it.
 
You have to bind it directly to certain item or gun. Maybe something like this:
Code:
if (_button == 1) then {
    _group = _parent displayCtrl 6902;
    _pos = ctrlPosition _group;
    _pos set [0,((_this select 2) + 0.48)];
    _pos set [1,((_this select 3) + 0.07)];
    _item = gearSlotData _control;
    _conf = configFile >> "cfgWeapons" >> _item;
    _name = getText(_conf >> "displayName");
    _cfgActions = _conf >> "ItemActions";
    _numActions = (count _cfgActions);
    _height = 0;
    if (_item == "Makarov") then {
        _menu = _parent displayCtrl (1600 + 0);
        _menu ctrlShow true;
        _type = "Commit Suicide";
        _script = "Scripts\suicide.sqf";
        _height = _height + (0.025 * safezoneH);
        _compile = format["_id = '%2' execVM '%1';closeDialog 0;",_script,_item];
        uiNamespace setVariable ['uiControl', _control];
        _menu ctrlSetText format[_type,_name];
        _menu ctrlSetTextColor [1,0,0,1];
        _menu ctrlSetEventHandler ["ButtonClick",_compile];
    };
 
Back
Top