Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
paintitem.c
Go to the documentation of this file.
1
class
PaintItem
2
{
4
static
void
Paint
(
ItemBase
item_tool,
ItemBase
item_target,
string
base_name,
PlayerBase
player,
float
specialty_weight = 0)
5
{
6
string
spray_color = item_tool.ConfigGetString(
"color"
);
7
string
item_color = item_target.ConfigGetString(
"color"
);
8
9
string
new_class_name = base_name +
"_"
+ spray_color;
10
PaintItem
.
SwitchItems
(item_target, new_class_name, player);
11
}
12
13
static
bool
CanPaintItem
(
ItemBase
item_tool,
ItemBase
item_target)
14
{
15
string
spray_color = item_tool.ConfigGetString(
"color"
);
16
string
item_color = item_target.ConfigGetString(
"color"
);
17
18
if
( spray_color != item_color )
19
{
20
return
true
;
21
}
22
else
23
{
24
return
false
;
25
}
26
}
27
29
static
void
SwitchItems
(
EntityAI
old_item,
string
new_item,
PlayerBase
player)
30
{
31
MiscGameplayFunctions.TurnItemIntoItemEx(player,
new
PaintItemLambda
(old_item, new_item, player));
32
}
33
};
34
35
36
class
PaintItemLambda
:
TurnItemIntoItemLambda
37
{
38
void
PaintItemLambda
(
EntityAI
old_item,
string
new_item_type,
PlayerBase
player) { }
39
};
EntityAI
Definition
inventoryitem.c:2
ItemBase
Definition
inventoryitem.c:742
PaintItem
Definition
paintitem.c:2
PaintItem::CanPaintItem
static bool CanPaintItem(ItemBase item_tool, ItemBase item_target)
Definition
paintitem.c:13
PaintItem::SwitchItems
static void SwitchItems(EntityAI old_item, string new_item, PlayerBase player)
Will switch the 'item' for a new game entity, the new entity's classname will be formed by adding the...
Definition
paintitem.c:29
PaintItem::Paint
static void Paint(ItemBase item_tool, ItemBase item_target, string base_name, PlayerBase player, float specialty_weight=0)
WIll open the 'item_target' by spawning a new entity and transferring item variables to the new one.
Definition
paintitem.c:4
PaintItemLambda
Definition
paintitem.c:37
PaintItemLambda::PaintItemLambda
void PaintItemLambda(EntityAI old_item, string new_item_type, PlayerBase player)
Definition
paintitem.c:38
PlayerBase
Definition
playerbaseclient.c:2
TurnItemIntoItemLambda
Definition
miscgameplayfunctions.c:92
Games
Dayz
scripts
4_world
static
paintitem.c
Generated by
1.17.0