567 {
568
569 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
571 {
574
575 if (is_preset_fixed)
576 {
578
579 }
580 else
581 {
583 }
584
585 if (clear_inventory)
586 {
588 }
589
590 for (int i = 0; i < preset_array.Count(); i++)
591 {
592 float health = -1;
593 int quantity = 1;
594 bool with_physics = false;
595 if (is_preset_fixed)
596 {
600 }
601 else
602 {
606 }
608 EntityAI ent =
m_Developer.SpawnEntityInInventory(target, preset_array.Get(i), -1, quantity,
false, preset_name);
609
611 {
612 m_Developer.SpawnEntityOnCursorDir(player, preset_array.Get(i), quantity, distance, health,
false, preset_name, with_physics);
613 }
614 }
615 if (
g_Game.IsMultiplayer())
616 {
617 ScriptRPC rpc = new ScriptRPC();
618 rpc.
Write(preset_name);
620 rpc.
Send(player,
ERPCs.DEV_RPC_SPAWN_PRESET,
true, player.GetIdentity());
621 }
622 else
623 {
624 PluginDeveloper plugin = PluginDeveloper.Cast(
GetPlugin(PluginDeveloper));
625 plugin.HandlePresetSpawn(player,preset_name,target);
626 }
627 }
628 }
InventoryLocationType
types of Inventory Location
PluginBase GetPlugin(typename plugin_type)
bool IsCurrentPresetFixed()
PluginDeveloper m_Developer
int GetCurrentPresetIndex()
PluginConfigDebugProfile m_ConfigDebugProfile
PluginConfigDebugProfileFixed m_ConfigDebugProfileFixed
proto native void Send(Object target, int rpc_type, bool guaranteed, PlayerIdentity recipient=NULL)
Initiate remote procedure call. When called on client, RPC is evaluated on server; When called on ser...
proto bool Write(void value_out)
class array< Class T > TStringArray