Category:Magma

Data Handles

 * Data.AddTableValue(string tablename, object key, object val):void -- Deprecated: Refer to DataStore Natives.
 * Data.GetConfigValue(string config, string section, string key):string
 * Data.GetTableValue(string tablename, object key) Object -- Deprecated: Refer to DataStore Natives.
 * Data.OverrideConfig(string config, string section, string key, string value):void
 * Data.SplitQuoteStrings(string str):string[]
 * Data.StrLen(string str):int
 * Data.Substring(string str, int from, int to):string
 * Data.ToInt(string num):int
 * Data.ToLower(string str):string
 * Data.ToUpper(string str):string

Entity Handles

 * Entity.ChangeOwner(Player p):void
 * Entity.Destroy:void
 * Entity.GetLinkedStructs:List
 * Entity.GetTakeDamage:TakeDamage
 * Entity.IsDeployableObject:bool
 * Entity.IsStructure:bool
 * Entity.SetDecayEnabled(bool c):void
 * Entity.UpdateHealth:void

Entity Pointers

 * Entity.Creator: Player
 * Entity.CreatorID:ulong
 * Entity.Health:float
 * Entity.InstanceID:int
 * Entity.Name:string
 * Entity.Object: Object
 * Entity.Owner: Player
 * Entity.OwnerID:ulong
 * Entity.X:float
 * Entity.Y:float
 * Entity.Z:float

Hooks

 * On_BlueprintUse(Player p, BPUseEvent ae):void
 * On_Chat(Player player, ref ChatString text):void
 * On_Command(Player player, string command, string[] args):void
 * On_Console(ref Arg arg, bool external):void
 * On_DoorUse(Player p, DoorEvent de):void
 * On_EntityDecay(DecayEvent de):float
 * On_EntityDeployed(Player p, Entity e):void
 * On_EntityHurt(HurtEvent he):void
 * On_ItemsLoaded(ItemsBlocks items):ItemDataBlock[]
 * On_NPCHurt(HurtEvent he):void
 * On_NPCKilled(DeathEvent de):void
 * On_PlayerConnected(Player player):bool
 * On_PlayerDisconnected(Player player):void
 * On_PlayerGathering(Player p, GatherEvent ge):void
 * On_PlayerHurt(HurtEvent he):void
 * On_PlayerKilled(DeathEvent de):bool
 * On_PlayerSpawning(Player p, SpawnEvent se):UnityEngine.Vector3
 * On_PlayerSpawned(Player p, SpawnEvent se):void
 * On_PluginInit:void
 * On_ServerInit:void
 * On_ServerShutdown:void
 * On_TablesLoaded(Dictionary lists): Dictionary

Timer Callbacks: See TimedEvent for reference.

NPC Handles

 * NPC.Kill:void
 * NPC Pointers
 * NPC.Character:Character
 * NPC.Health:float
 * NPC.Name:string

Player Handles

 * Player.Disconnect:void
 * Player.Find(string search): Player
 * Player.FindByGameID(string uid): Player
 * Player.FindByName(string name): Player
 * Player.FindByNetworkPlayer(uLink.NetworkPlayer np): Player
 * Player.FindByPlayerClient(PlayerClient pc): Player
 * Player.FindBySteamID(string uid): Player
 * Player.InventoryNotice(string arg):void
 * Player.Kill:void
 * Player.Message(string arg):void
 * Player.MessageFrom(string playername, string arg):void
 * Player.Notice(string arg):void
 * Player.Notice(string icon, string text, float duration):void
 * Player.SendCommand(string cmd):void
 * Player.TeleportTo(float x, float y, float z):void
 * Player.TeleportTo(Player p):void

Player Pointers

 * Player.Admin:bool
 * Player.GameID:string
 * Player.Health:float
 * Player.Inventory: PlayerInv
 * Player.IP:string
 * Player.IsBleeding:bool
 * Player.IsCold:bool
 * Player.IsInjured:bool
 * Player.Location:UnityEngine.Vector3
 * Player.Name:string
 * Player.Ping:int
 * Player.PlayerClient: PlayerClient
 * Player.SteamID:string
 * Player.TimeOnline:long
 * Player.X:float
 * Player.Y:float
 * Player.Z:float

PlayerInv
PlayerInv Handles


 * PlayerInv.AddItem(string name):void
 * PlayerInv.AddItem(string name, int amount):void
 * PlayerInv.AddItemTo(string name, int slot):void
 * PlayerInv.AddItemTo(string name, int slot, int amount):void
 * PlayerInv.Clear:void
 * PlayerInv.ClearAll:void
 * PlayerInv.ClearArmor:void
 * PlayerInv.ClearBar:void
 * PlayerInv.DropAll:void
 * PlayerInv.DropItem(int slot):void
 * PlayerInv.DropItem(PlayerItem pi):void
 * PlayerInv.HasItem(string name, int number):bool
 * PlayerInv.HasItem(string name):bool
 * PlayerInv.MoveItem(int s1, int s2):void
 * PlayerInv.RemoveItem(PlayerItem pi):void
 * PlayerInv.RemoveItem(string name, int number):void
 * PlayerInv.RemoveItem(int slot):void
 * PlayerInv.RemoveItemAll(string name):void

PlayerInv Pointers

 * PlayerInv.ArmorItems: PlayerItem[]
 * PlayerInv.BarItems: PlayerItem[]
 * PlayerInv.FreeSlots:int
 * PlayerInv.InternalInventory:Inventory
 * PlayerInv.Items: PlayerItem[]
 * PlayerItem Handles
 * PlayerItem.Consume(int qty):void
 * PlayerItem.Drop:void
 * PlayerItem.IsEmpty:bool
 * PlayerItem.TryCombine(PlayerItem pi):bool
 * PlayerItem.TryStack(PlayerItem pi):bool

PlayerItem Pointers

 * PlayerItem.InventoryItem:IInventoryItem
 * PlayerItem.Name:string
 * PlayerItem.Quantity:int
 * PlayerItem.Slot:int
 * PlayerItem.UsesLeft:int

Plugin Handles

 * Plugin.CreateDir(string name):bool
 * Plugin.CreateIni(string name):IniParser
 * Plugin.CreateTimer(string name, int timeoutDelay, ParamsList args):TimedEvent
 * Plugin.CreateTimer(string name, int timeoutDelay):TimedEvent
 * Plugin.DeleteLog(string file):void
 * Plugin.GetDate:string
 * Plugin.GetIni(string name):IniParser
 * Plugin.GetInis(string name):List
 * Plugin.GetTicks:int
 * Plugin.GetTime:string
 * Plugin.GetTimer(string name):TimedEvent
 * Plugin.GetTimestamp:long
 * Plugin.IniExists(string name):bool
 * Plugin.KillTimer(string name):void
 * Plugin.KillTimers:void
 * Plugin.Log(string file, string text):void

Plugin Pointers

 * Plugin.Code:string
 * Plugin.Commands:ArrayList
 * Plugin.Path:string

Server Handles

 * Server.Broadcast(string arg):void
 * Server.BroadcastFrom(string name, string arg):void
 * Server.BroadcastNotice(string s):void
 * Server.FindPlayer(string s): Player
 * Server.Save:void

Server Pointers

 * Server.ChatHistoryMessages:List
 * Server.ChatHistoryUsers:List
 * Server.Items:ItemsBlocks
 * Server.Players:List
 * Server.ServerStructures:StructureMaster

Utilities

 * Util.ConsoleLog(string str, bool adminOnly):void
 * Util.CreateArrayInstance(string name, int size): Object
 * Util.CreateInstance(string name, params object[] args): Object
 * Util.CreateQuat(float x, float y, float z, float w):UnityEngine.Quaternion
 * Util.CreateVector(float x, float y, float z):UnityEngine.Vector3
 * Util.DestroyObject(UnityEngine.GameObject go):void
 * Util.GetAbsoluteFilePath(string fileName):string
 * Util.GetMagmaFolder:string
 * Util.GetRootFolder:string
 * Util.GetRustPPDirectory:string
 * Util.GetServerFolder:string
 * Util.GetStaticField(string className, string field): Object
 * Util.GetVectorsDistance(UnityEngine.Vector3 v1, UnityEngine.Vector3 v2):float
 * Util.HashtableFromFile(string path):Hashtable
 * Util.HashtableToFile(Hashtable ht, string path):void
 * Util.Infront(Player p, float length):UnityEngine.Vector3
 * Util.InvokeStatic(string className, string method, params object[] args) Object
 * Util.Log(string str):void
 * Util.Regex(string input, string match):Match
 * Util.RotateX(UnityEngine.Quaternion q, float angle):UnityEngine.Quaternion
 * Util.RotateY(UnityEngine.Quaternion q, float angle):UnityEngine.Quaternion
 * Util.RotateZ(UnityEngine.Quaternion q, float angle):UnityEngine.Quaternion
 * Util.say(uLink.NetworkPlayer player, string playername, string arg):void
 * Util.sayAll(string arg):void
 * Util.sayUser(uLink.NetworkPlayer player, string arg):void
 * Util.sayUser(uLink.NetworkPlayer player, string customName, string arg):void
 * Util.SetStaticField(string className, string field, object val):void
 * Util.TryFindType(string typeName, out Type t):bool

Web Natives

 * Web.GET(string url):string
 * Web.POST(string url, string data):string

World Natives

 * World.Airdrop:void
 * World.Airdrop(int rep):void
 * World.AirdropAt(float x, float y, float z):void
 * World.AirdropAt(float x, float y, float z, int rep):void
 * World.AirdropAtPlayer(Player p):void
 * World.AirdropAtPlayer(Player p, int rep):void
 * World.Blocks:void
 * World.CreateSM(Player p):StructureMaster
 * World.CreateSM(Player p, float x, float y, float z):StructureMaster
 * World.CreateSM(Player p, float x, float y, float z, UnityEngine.Quaternion rot):StructureMaster
 * World.CreateZone(string name):Zone3D
 * World.GetGround(float x, float z):float
 * World.Lists:void
 * World.Prefabs:void
 * World.Spawn(string prefab, UnityEngine.Vector3 location, int rep): Object
 * World.Spawn(string prefab, UnityEngine.Vector3 location): Object
 * World.Spawn(string prefab, float x, float y, float z, UnityEngine.Quaternion rot, int rep): Object
 * World.Spawn(string prefab, float x, float y, float z, UnityEngine.Quaternion rot): Object
 * World.Spawn(string prefab, float x, float y, float z, int rep): Object
 * World.Spawn(string prefab, float x, float y, float z): Object
 * World.SpawnAtPlayer(string prefab, Player p, int rep): Object
 * World.SpawnAtPlayer(string prefab, Player p): Object

World Pointers

 * World.DayLength:float
 * World.Entities:List
 * World.NightLength:float
 * World.Time:float

Zone3D Handles

 * Zone3D.Contains(UnityEngine.Vector3 v):bool
 * Zone3D.Contains(Entity en):bool
 * Zone3D.Contains(Player p):bool
 * Zone3D.Get(string name):Zone3D
 * Zone3D.GlobalContains(Entity e):Zone3D
 * Zone3D.GlobalContains(Player p):Zone3D
 * Zone3D.HideMarkers:void
 * Zone3D.Mark(float x, float y):void
 * Zone3D.Mark(UnityEngine.Vector2 v):void
 * Zone3D.ShowMarkers:void

Zone3D Pointers

 * Zone3D.Entities:List
 * Zone3D.Points:List
 * Zone3D.Protected:bool
 * Zone3D.PVP:bool

ParamsList

 * ParamsList.Add(object o):void
 * ParamsList.Get(int index): Object
 * ParamsList.Remove(object o):void
 * ParamsList.ToArray: Object[]
 * ParamsList Pointers
 * ParamsList.Length:int

IniParser

 * IniParser.AddSetting(string sectionName, string settingName, string settingValue):void
 * IniParser.AddSetting(string sectionName, string settingName):void
 * IniParser.Count:int
 * IniParser.DeleteSetting(string sectionName, string settingName):void
 * IniParser.EnumSection(string sectionName):string[]
 * IniParser.GetSetting(string sectionName, string settingName):string
 * IniParser.isCommandOn(string cmdName):bool
 * IniParser.Save:void
 * IniParser.SaveSettings(string newFilePath):void
 * IniParser.SetSetting(string sectionName, string settingName, string value):void

DeathEvent Pointers
DeathEvent is extended by HurtEvent, so HurtEvent pointers apply to DeathEvent


 * DeathEvent.DropItems:bool
 * DeathEvent.Attacker: Player
 * DeathEvent.DamageAmount:float
 * DeathEvent.DamageEvent: DamageEvent
 * DeathEvent.DamageType:string
 * DeathEvent.Entity:Entity
 * DeathEvent.IsDecay:bool
 * DeathEvent.Victim: Player
 * DeathEvent.WeaponData:WeaponImpact
 * DeathEvent.WeaponName:string

HurtEvent Pointers

 * HurtEvent.Attacker: Player
 * HurtEvent.DamageAmount:float
 * HurtEvent.DamageEvent: DamageEvent
 * HurtEvent.DamageType:string
 * HurtEvent.Entity:Entity
 * HurtEvent.IsDecay:bool
 * HurtEvent.Victim: Player
 * HurtEvent.WeaponData:WeaponImpact
 * HurtEvent.WeaponName:string

DecayEvent Pointers

 * DecayEvent.DamageAmount:float
 * DecayEvent.Entity:Entity
 * BPUseEvent Pointers
 * BPUseEvent.Cancel:bool
 * BPUseEvent.DataBlock:BlueprintDataBlock
 * BPUseEvent.ItemName:string

DoorEvent Pointers

 * DoorEvent.Entity:Entity
 * DoorEvent.Open:bool
 * GatherEvent Pointers
 * GatherEvent.AmountLeft:int
 * GatherEvent.Item:string
 * GatherEvent.PercentFull:float
 * GatherEvent.Quantity:int
 * GatherEvent.Type:string

SpawnEvent Pointers

 * SpawnEvent.CampUsed:bool
 * SpawnEvent.X:float
 * SpawnEvent.Y:float
 * SpawnEvent.Z:float

TimedEvent Handles
See Plugin.CreateTimer for reference.


 * TimedEvent.Start:void
 * TimedEvent.Stop:void

Note: In 1.1.x, you can also pass parameters through timers. See ParamsList (updated soon) for reference.

TimedEvent Pointers

 * TimedEvent.Args: ParamsList
 * TimedEvent.Interval:double
 * TimedEvent.Name:string
 * TimedEvent.TimeLeft:double