Skip to content

Instantly share code, notes, and snippets.

@MEXAHOTABOP
Created July 10, 2012 21:22
Show Gist options
  • Save MEXAHOTABOP/3086322 to your computer and use it in GitHub Desktop.
Save MEXAHOTABOP/3086322 to your computer and use it in GitHub Desktop.
#include "_macros.fos"
#include "_itempid.fos"
void _ToolInt(Item& Tool, bool firstTime)
{
if (Tool.GetProtoId() == PID_MULTI_TOOL)
Tool.SetEvent(ITEM_EVENT_USE ,"_OnUseMultiTool");
}
bool _OnUseMultiTool(Item& Tool, Critter& player, Critter@ none, Item@ TargetItem, Scenery@ TargetScenery)
{
if (!valid(Tool) || !valid(TargetItem) ) return false;
if(TargetItem.GetProtoId() == PID_METAL_TRASH)
{
if (TargetItem.GetCount() == 10)
{
TargetItem.SetCount(1);
TargetItem.ChangeProto(PID_CHEST);
TargetItem.Update ();
return true;
}
else
return false;
}
else
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment