Jump to content

[Release] Skin Trader 0.6 (Buy any arma skin)


boyd

Recommended Posts

List Men and List Women for the text price change. 

 

First thing you should do with any script is look through all the files, also helps if you need to change directories. Also you can open all the files in Notepad ++ for example and search in all opened documents. Worldspace and game co-ordinates are the same in fact there is only worldspace coordinates but for some reason in the mission.sqm they listed the height in the middle instead of at the end just to confuse us. 

 

Anyone get the preview working? I notice the files are there (WIP?) but nothing points to them. 

Link to comment
Share on other sites

Hiya, when I add this I see no trader anywhere and ALL map markers dissapear!!

 

where in stary is the trader supposded to be plz

 

 

Many thanks

 

 

Robbie

 

 

 

Im getting this as well  :(  anyone have any idea why that happens?

Link to comment
Share on other sites

Im getting this as well  :(  anyone have any idea why that happens?

I would go through through the instructions again mainly dealing with the mission.sqm part of the install, something might be wrong in there. Also make sure your coords for the trader are correct in the mission.sqm. (XZY) not XYZ

position[]={6303.8,0.001,7795.03};//Trader City Stary

Link to comment
Share on other sites

15:06:51 Warning Message: Cannot load mission
15:06:51 Side !!!
15:06:51 Side 198891776

 

 

 

That's the error message I get. I checked all my punctuation, I checked brackets, checked my custom\variables.sqf

 

It's gotta be pointing to something i overlooked but I'm not seeing it.

 

edit:

 

I figured it out; RTFM right? 

 

Add the Trader in Mission.sqm after the 3rd ; after classitem 1 instead of after the last bracket closing out the string.

 

Derp.

Link to comment
Share on other sites

Awesome script!

I am using this on an overpoch server I just put together for a friend and had to change a few things due to multiple issues. Someone else already posted about using AllPlayers=Allplayers+[skins]; (instead of count AllPlayers) but I wanted to post the other fix in case someone else runs into trouble:

I had players able to click the buy multiple times and would rapidly glitch out then get banned by infistar. I added

 

s_player_buying_skins=-1;

 

to my variables.sqf and changed GetMen.sqf to

 

// by Boyd
if(not local player) exitWith{};
if(s_player_buying_skins!=1) then {
s_player_buying_skins=1;
#include "config.sqf"
#include "dialog\definitions.sqf"
disableSerialization;
 
_display = findDisplay SKINS_DIALOG;
_listbox = _display displayCtrl SKINS_UNITLIST;
_sel = lbCurSel _listbox; if(_sel < 0) exitWith{};
 
_unittype = Men_Clothing select _sel;
_typename = lbtext [sKINS_UNITLIST,_sel];
 
_hasGPS = false;
_hasCompass = false;
_hasRadio = false;
_hasWatch = false;
_hasMap = false;
 
/********************* Buy Skin ********************/
if (str _unittype == str _unittype)then{
if (Global_Price call player_checkItems) then {
_removed = Global_Price call player_removeItems;
systemchat format ["<System>: " + localize "You gave" + " %2 %1.",(Global_Price select 0)select 0,(Global_Price select 0)select 1];
if (!isNull (unitBackpack player)) then {
 
cutText ["You cannot change your Skin while wearing a backpack", "PLAIN"];
}else{
if (player hasWeapon "ItemCompass") then {
_hasCompass = true;
};
 
if (player hasWeapon "ItemRadio") then {
_hasRadio = true;
};
 
if (player hasWeapon "ItemGPS") then {
_hasGPS = true;
};
 
if (player hasWeapon "ItemWatch") then {
_hasWatch = true;
};
 
if (player hasWeapon "ItemMap") then {
_hasMap = true;
 
};
 
 
player playActionNow "Medic";
sleep 7;
CloseDialog 0;
sleep 1;
[dayz_playerUID,dayz_characterID,_unittype] spawn player_humanityMorph;
sleep 0.2;
vehicle player switchCamera 'EXTERNAL';
sleep 3;
 
 
if (!_hasCompass) then {
player removeWeapon "ItemCompass";
};
 
if (!_hasRadio) then {
player removeWeapon "ItemRadio";
};
 
if (!_hasGPS) then {
player removeWeapon "ItemGPS";
};
 
if (!_hasWatch) then {
player removeWeapon "ItemWatch";
};
 
if (!_hasMap) then {
player removeWeapon "ItemMap";
};
};
}else{
systemchat format ["Not enough gold Need" + " %2 %1.",(Global_Price select 0)select 0,(Global_Price select 0)select 1];
};
};
s_player_buying_skins=-1;
}else{};
/*******************************************************/

 
and GetWoman.sqf to

// by Boyd
if(not local player) exitWith{};
if(s_player_buying_skins!=1) then {
s_player_buying_skins=1;
#include "config.sqf"
#include "dialog\definitions.sqf"
disableSerialization;
 
_display = findDisplay SKINS_DIALOG;
_listbox = _display displayCtrl SKINS_UNITLIST;
_sel = lbCurSel _listbox; if(_sel < 0) exitWith{};
 
_unittype = Woman_Clothing select _sel;
_typename = lbtext [sKINS_UNITLIST,_sel];
 
_hasGPS = false;
_hasCompass = false;
_hasRadio = false;
_hasWatch = false;
_hasMap = false;
 
/********************* Buy Skin ********************/
if (str _unittype == str _unittype)then{
if (Global_Price call player_checkItems) then {
_removed = Global_Price call player_removeItems;
systemchat format ["<System>: " + localize "You gave" + " %2 %1.",(Global_Price select 0)select 0,(Global_Price select 0)select 1];
if (!isNull (unitBackpack player)) then {
 
cutText ["You cannot change your Skin while wearing a backpack", "PLAIN"];
}else{
if (player hasWeapon "ItemCompass") then {
_hasCompass = true;
};
 
if (player hasWeapon "ItemRadio") then {
_hasRadio = true;
};
 
if (player hasWeapon "ItemGPS") then {
_hasGPS = true;
};
 
if (player hasWeapon "ItemWatch") then {
_hasWatch = true;
};
 
if (player hasWeapon "ItemMap") then {
_hasMap = true;
 
};
 
 
player playActionNow "Medic";
sleep 7;
CloseDialog 0;
sleep 1;
[dayz_playerUID,dayz_characterID,_unittype] spawn player_humanityMorph;
sleep 0.2;
vehicle player switchCamera 'EXTERNAL';
sleep 3;
 
 
if (!_hasCompass) then {
player removeWeapon "ItemCompass";
};
 
if (!_hasRadio) then {
player removeWeapon "ItemRadio";
};
 
if (!_hasGPS) then {
player removeWeapon "ItemGPS";
};
 
if (!_hasWatch) then {
player removeWeapon "ItemWatch";
};
 
if (!_hasMap) then {
player removeWeapon "ItemMap";
};
};
}else{
systemchat format ["Not enough gold Need" + " %2 %1.",(Global_Price select 0)select 0,(Global_Price select 0)select 1];
};
};
s_player_buying_skins=-1;
}else{};
/*******************************************************/

 

The changes make it so as soon as the buy button is clicked that variable I added is changed and any further presses do nothing. 

Link to comment
Share on other sites

  • 2 weeks later...

Hey there ;)

 

Nice Addon, but i have a problem with it.

If i use an "INS" Skin, like "Ins_Soldier_Sapper", the AI´s dont shooting at me. They fully ignoring me. DZMS, WAI and DZAI.

Only DZAI is shot some rounds when iam opening the fire, but after a few seconds they stop and ignore me furtherways.

 

What can i do, that the AI is able to shot at me with these skins ?

 

cheers

Link to comment
Share on other sites

First I want to say THX for this Trader, search a long time for something like this.

But I got a little Problem with this.

Have two Traders on Map, one is for the Player and one is for the UN-Forces. Thats a little Group of Player and they "help" other Player, so they need the Skins with blue helmets to protect them against PVP while doing their job. And thats the reason why I need the second Trader, this will sell the UN-Skins for free. We put him in the stairway in a firehouse and closed this with a cinderblock doorway.

But you can trade with him through the walls of the firestation, also throug the cinderwalls. The nearest point where you could be to the Trader is about 10m....

So my Question, can someone tell how I could "turn" down the range for the Trademenu-Option?

 

Sorry about my bad english, hope somebody understand my Problem..

Link to comment
Share on other sites

maybe ask the mission system creators

 

 

Its nothing to do with the mission systems, some of the skins set your side to East and the usual skin change setting it back to West doesn't seem to work. All you have to do is remove the skins that break it and it works fine. 

Link to comment
Share on other sites

Its nothing to do with the mission systems, some of the skins set your side to East and the usual skin change setting it back to West doesn't seem to work. All you have to do is remove the skins that break it and it works fine. 

You could also set something up where it creates a new west group, sets skin to the one in question then switches player to that side west group. I've seen someone post something like that when an arma update made certain bandit skins do the same thing.

Link to comment
Share on other sites

hogscraper, but how to do so ?

i was trying around the whole day with "setSide" and such other variables but with no success....

 

If i change the AI skins to survivor2_dz as example, they shoot me if iam a survivor, thats ok, but they dont if i wear INS clothing.

If i change the AI group to west, they shoot me if i am wear INS clothing but they dont if i wear survivor (civilian clothing).

 

There have to be a way. I dont wanna miss INS clothing.

 

Any little hint could help me out (please)?! :)

Link to comment
Share on other sites

I never wrote anything of problems with this script itself. I wrote from a problem with the AI with using skins of this script. 

 

But well done, i finally figured it out !

 

player_switchModel.sqf:

 

change:

/**********************************/
//DONT USE player AFTER THIS POINT//
/**********************************/
_group = createGroup west;
_newUnit = _group createUnit [_class,dayz_spawnPos,[],0,"NONE"];
_newUnit setPosATL _position;
_newUnit setDir _dir;

 

to this:

/**********************************/
//DONT USE player AFTER THIS POINT//
/**********************************/
_group = createGroup WEST;
_newUnit = _group createUnit [_class,dayz_spawnPos,[],0,"NONE"];
_newUnit setPosATL _position;
_newUnit setDir _dir;
[_newUnit] joinSilent createGroup WEST;
Link to comment
Share on other sites

  • 3 weeks later...

 

I never wrote anything of problems with this script itself. I wrote from a problem with the AI with using skins of this script. 

 

But well done, i finally figured it out !

 

player_switchModel.sqf:

 

change:

/**********************************/
//DONT USE player AFTER THIS POINT//
/**********************************/
_group = createGroup west;
_newUnit = _group createUnit [_class,dayz_spawnPos,[],0,"NONE"];
_newUnit setPosATL _position;
_newUnit setDir _dir;

to this:

/**********************************/
//DONT USE player AFTER THIS POINT//
/**********************************/
_group = createGroup WEST;
_newUnit = _group createUnit [_class,dayz_spawnPos,[],0,"NONE"];
_newUnit setPosATL _position;
_newUnit setDir _dir;
[_newUnit] joinSilent createGroup WEST;

 

That's what I searched for the last 3 hours, thanks!^^

 

Had the same problem with AI not shooting and players couldn't get in a vehicle together.

 

But you better use this

[_newUnit] joinSilent _group;

Each side can only have 144 groups and you would create 2 groups for each player and only one group is deleted, when this player dies or changes the clothes. After some deaths and changing clothes the side would be full and couldn't let the new players join in, whitout giving any error report. Don't know what would happen then, but could believe AI would stop shooting again?

 

regards

Link to comment
Share on other sites

  • 4 weeks later...

player_switchModel.sqf ... should be around line 58, if you didnt already edit this file, add:

removeAllItems _newUnit;

and it will not add the toolbelt items anymore

I've tested this. It does not work for me. No. It, instead, fails to create my character. Or alternatively will crash my server entirely.

I've placed this script below the removeAllWeapons _newUnit;

Link to comment
Share on other sites

this is the single currency with the bits i added to stop items being added on respawn or login and a fix to make AI see you if you wear an overwatch skin

i have highlighted them in green

switchmodel

private ["_weapons","_backpackWpn","_backpackMag","_currentWpn","_backpackWpnTypes","_backpackWpnQtys","_countr","_class","_position","_dir","_currentAnim","_tagSetting","_playerUID","_countMags","_magazines","_primweapon","_secweapon","_newBackpackType","_muzzles","_oldUnit","_group","_newUnit","_playerObjName","_wpnType","_ismelee"];

_class = _this;
_position = getPosATL player;
_dir = getDir player;
_currentAnim = animationState player;
_tagSetting = player getVariable["DZE_display_name",false];
_playerUID = getPlayerUID player;
_weapons = weapons player;
_countMags = call player_countMagazines;
_magazines = _countMags select 0;
_cashMoney = player getVariable["cashMoney",0];
_bankMoney = player getVariable["bankMoney",0];

if ((_playerUID == dayz_playerUID) && (count _magazines == 0) && (count (magazines player) > 0 )) exitWith {cutText [(localize "str_epoch_player_17"), "PLAIN DOWN"]};

_primweapon = primaryWeapon player;
_secweapon    = secondaryWeapon player;

if(!(_primweapon in _weapons) && _primweapon != "") then {
    _weapons = _weapons + [_primweapon];
};

if(!(_secweapon in _weapons) && _secweapon != "") then {
    _weapons = _weapons + [_secweapon];
};

dayz_myBackpack = unitBackpack player;

_newBackpackType = (typeOf dayz_myBackpack);

if(_newBackpackType != "") then {
    _backpackWpn = getWeaponCargo unitBackpack player;
    _backpackMag = _countMags select 1;
};

_currentWpn = currentWeapon player;
_muzzles = getArray(configFile >> "cfgWeapons" >> _currentWpn >> "muzzles");

if (count _muzzles > 1) then {
    _currentWpn = currentMuzzle player;
};

player setPosATL dayz_spawnPos;

_oldUnit = player;
_group = createGroup west;
_newUnit = _group createUnit [_class,dayz_spawnPos,[],0,"NONE"];
[_newUnit] joinSilent createGroup WEST;
_newUnit setPosATL _position;
_newUnit setDir _dir;
_newUnit setVariable ["cashMoney",_cashMoney,true];
_newUnit setVariable ["bankMoney",_bankMoney];

{_newUnit removeMagazine _x;} count  magazines _newUnit;

removeAllWeapons _newUnit;    
removeAllItems _newUnit;

{
    if (typeName _x == "ARRAY") then {if ((count _x) > 0) then {_newUnit addMagazine [(_x select 0), (_x select 1)]; }; } else { _newUnit addMagazine _x; };
} count _magazines;

{
    _newUnit addWeapon _x;
} count _weapons;

if(str(_weapons) != str(weapons _newUnit)) then {

    {
        _weapons = _weapons - [_x];
    } count (weapons _newUnit);
    
    {
        _newUnit addWeapon _x;
    } count _weapons;
};

if(_primweapon !=  (primaryWeapon _newUnit)) then {
    _newUnit addWeapon _primweapon;        
};

if (_primweapon == "MeleeCrowbar") then {
    _newUnit addMagazine 'crowbar_swing';
};

if (_primweapon == "MeleeSledge") then {
    _newUnit addMagazine 'sledge_swing';
};

if (_primweapon == "MeleeHatchet_DZE") then {
    _newUnit addMagazine 'Hatchet_Swing';
};

if (_primweapon == "MeleeMachete") then {
    _newUnit addMagazine 'Machete_swing';
};

if (_primweapon == "MeleeFishingPole") then {
    _newUnit addMagazine 'Fishing_Swing';
};

if(_secweapon != (secondaryWeapon _newUnit) && _secweapon != "") then {
    _newUnit addWeapon _secweapon;        
};

_switchUnit = {
    addSwitchableUnit _newUnit;
    setPlayable _newUnit;
    selectPlayer _newUnit;
    removeAllWeapons _oldUnit;
    {_oldUnit removeMagazine _x;} count  magazines _oldUnit;
    deleteVehicle _oldUnit;
    if(_currentWpn != "") then {_newUnit selectWeapon _currentWpn;};
};

if (!isNil "_newBackpackType") then {
    if (_newBackpackType != "") then {
        _newUnit addBackpack _newBackpackType;
        dayz_myBackpack = unitBackpack _newUnit;
        _backpackWpnTypes = [];
        _backpackWpnQtys = [];
        if (count _backpackWpn > 0) then {
            _backpackWpnTypes = _backpackWpn select 0;
            _backpackWpnQtys = _backpackWpn select 1;
        };
        [] call _switchUnit;
        if (gear_done) then {sleep 0.001;};
        ["1"] call gearDialog_create;
        _countr = 0;
        {
            if (!(isClass(configFile >> "CfgWeapons" >> _x))) then {
                _countr = _countr + 1;
                if ((typeName _x) != "STRING") then {
                    (unitBackpack player) addMagazineCargoGlobal [(_x select 0), 1];
                    _idc = 4999 + _countr;
                    _idc setIDCAmmoCount (_x select 1);
                } else {
                    (unitBackpack player) addMagazineCargoGlobal [_x, 1];
                };
            };
        } count _backpackMag;
        (findDisplay 106) closeDisplay 0;
        _countr = 0;
        {
            (unitBackpack player) addWeaponCargoGlobal [_x,(_backpackWpnQtys select _countr)];
            _countr = _countr + 1;
        } count _backpackWpnTypes;
    } else { [] call _switchUnit; };
} else { [] call _switchUnit; };

[objNull, player, rSwitchMove,_currentAnim] call RE;

player disableConversation true;

if (_tagSetting) then {
    DZE_ForceNameTags = true;
};

_playerUID = getPlayerUID player;
_playerObjName = format["PVDZE_player%1",_playerUID];

call compile format["%1 = player;",_playerObjName];

publicVariableServer _playerObjName;

_wpnType = primaryWeapon player;
_ismelee = (gettext (configFile >> "CfgWeapons" >> _wpnType >> "melee"));

if (_ismelee == "true") then {
    call dayz_meleeMagazineCheck;
};

{player reveal _x} count (nearestObjects [getPosATL player, dayz_reveal, 50]);

Link to comment
Share on other sites

  • 5 weeks later...

Anyone got the skin "frb_stealth_sabot" to work? I just can't get the createvehicle restriction fixed properly for this particular skin.

createvehicle.log :

Nekuan () - #30 "frb_stealth_sabot" 11:296 [0,0,0]

createvehicle.txt:

5 "_SABOT" !="Navy_SEAL_Sabot" !="frb_stealth_sabot"
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...