S3M4J Posted January 9, 2015 Report Share Posted January 9, 2015 hello looking for help a wonder if its possible to stop players eating cans of food untill that have a tin opener, so people require a tin opener to eat the food in my overpoch server? Link to comment Share on other sites More sharing options...
0 StiflersM0M Posted January 9, 2015 Report Share Posted January 9, 2015 There is a can opener in overwatch :O ? if yes i did not notice it yet, but here you go: in your custom compiles.sqf search for player_eat.sqf and change the path to a custom mpmission path like: "custom\player_eat.sqf" Then grap the player_eat.sqf from the dayz_code and paste it to your custom folder or any other folder depends where you want the file. in player_eat.sqf search for : if (!_hasfooditem) exitWith {cutText [format[(localize "str_player_31"),_text,"consume"] , "PLAIN DOWN"]}; And paste under it: _itemneeded = "INSERT_ITEM_CLASSNAME_WHICH_IS_NEEDED_HERE"; _hasopener = _itemneeded in magazines player; if ((_hasoutput) && !(_hasopener)) exitwith {cutText [format["You need a %1 to open this can!",_itemneeded], "PLAIN DOWN"];}; insert the item classname from your can opener in _itemneeded. Now the script will exit with the message above if the player did not have the can opener in his inventory. Link to comment Share on other sites More sharing options...
0 seelenapparat Posted January 9, 2015 Report Share Posted January 9, 2015 how would the same scriptpart look, but with, lets say, two can openers instead? like: you need either a knife or a machete to use this with the can to open it up. would something like this work: _itemneeded = "ItemKnife"; _itemneeded2 = "ItemMachete"; _hasopener = _itemneeded or _itemneeded2 in magazines player; Link to comment Share on other sites More sharing options...
0 S3M4J Posted January 9, 2015 Author Report Share Posted January 9, 2015 prity sure its "tool_canopener" Link to comment Share on other sites More sharing options...
0 StiflersM0M Posted January 9, 2015 Report Share Posted January 9, 2015 how would the same scriptpart look, but with, lets say, two can openers instead? like: you need either a knife or a machete to use this with the can to open it up. would something like this work: _itemneeded = "ItemKnife"; _itemneeded2 = "ItemMachete"; _hasopener = _itemneeded or _itemneeded2 in magazines player; I would do it on this way: _itemlist = ["Item1","Item2","Item3","Item4","Item5"]; _gotitem = 0; { if (_x in magazines player) then { _gotitem = _gotitem +1; } forEach _itemlist; If ((_hasoutput) && (_gotitem > 0)) exitwith {cutText [format["You need one of these %1 tools to open this can!",_itemlist], "PLAIN DOWN"];}; Link to comment Share on other sites More sharing options...
0 seelenapparat Posted January 11, 2015 Report Share Posted January 11, 2015 yours didn't work the way I wanted it to. so made it a bit simpler. works great: _itemneeded = "ItemKnife" in items player; _itemneeded2 = "ItemMachete" in items player; if ((_hasoutput) && !(_itemneeded || _itemneeded2)) exitwith {cutText [format["You need a Knife or Machete to open this can."], "PLAIN DOWN"];}; Link to comment Share on other sites More sharing options...
Question
S3M4J
hello
looking for help a wonder if its possible to stop players eating cans of food untill that have a tin opener, so people require a tin opener to eat the food in my overpoch server?
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now