Jump to content
Sign in to follow this  
malakdecaen

Delete item after action ?

Recommended Posts

hi ,

i have a problem with a script , this script is not from me , it's from GITS EVO .

i want delete a item in my inventory after an action , i 've try a lot of code but nothing work .

this is the script :

// allows medics to build a mash
if (player in list AirportIn) exitWith {hint localize "STR_M04t76"};

//EGG_EVO_CHITEMS = ["ToolKit","MineDetector"];
if !((EGG_EVO_CHITEMS select 1) in (items player)) exitWith {hint "You need a MEDIKIT to build a MASH"};

mtent = mymash;
deletevehicle mtent;

player playMove "AinvPknlMstpSlayWrflDnon_medic";
sleep 3.0;
WaitUntil {animationState player != "AinvPknlMstpSlayWrflDnon_medic"};

_mark = format["%1mash",(name player)];
deleteMarker _mark;
mtent = (EGG_EVO_MASH select 0) createVehicle (position player);Sleep EGG_EVO_GlobalSleep;
player clearItemCargoGlobal MineDetector;
_posm = [(getposATL player select 0) + (sin(getdir player) * 3), (getposATL player select 1) + (cos(getdir player) * 3)];
mtent setpos _posm;
Sleep EGG_EVO_GlobalSleep;
_pos2 = [(getpos mtent select 0)+3,(getpos mtent select 1),0];

//temp - is this crashing the script?
mbox = (EGG_EVO_MASH select 1) createVehicle _pos2;
clearWeaponCargoGlobal mbox;
clearmagazineCargoGlobal mbox;
clearItemCargoGlobal mbox;
mbox addItemCargoGlobal ["FirstAidKit",6];

mtent addEventHandler ["killed", {handle = [_this select 0] execVM "scripts\resurrect.sqf"}];
//mbox addEventHandler ["killed", {handle = [_this select 0] execVM "scripts\bury.sqf"}];

_pos = position mtent;
_mssg = format["%1's MASH",(name player)];
_medmark = createMarker [_mark, _pos];
_medmark setMarkerShape "ICON";
_medmark setMarkerType "b_med";
_medmark setMarkerColor "ColorBlack";
_medmark setMarkerText _mssg;
_medmark setMarkerSize [0.5, 0.5];

I just want delete the item Minedetector after build the mash .

or do you know a script like that very simple to build something if you have the good stuff in you'r inventory ?

thanks a lot for you'r help .

Share this post


Link to post
Share on other sites

i've already tried : player removeItem Minedetector; but don't work .

Maybe something wrong ?

Share this post


Link to post
Share on other sites
Syntax:

unit removeItem item

Parameters:

unit: Object

item: String

Pay attention to parameters description - your item needs to be a string.

player removeItem "Minedetector";

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×