Hi, i just started my adventure in making plugins like 1 hour ago. And I'm facing a wierd warning in my IDE. The code was working ok, until i started writing the IFs to check for some things. Now I'm getting an error which can't actually translate to english... it's something like:
- WARNING: This translation might be just product of my imagination. -Code:"The type 'FacepunchBehaviour' is defined in an assembly that is not referenced. You must add a reference to the assembly 'Facepunch.UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
Well that error only occurs when placing the IFs, so I don't really get it.
Code:void OnEntityDeath(BaseCombatEntity victim, HitInfo info) { if(victim != null) { if (victim is BasePlayer) { } } }
The type facepunchbehaviour
Discussion in 'Rust Development' started by TheBandolero, Jun 13, 2018.
-
Wulf Community Admin
You're missing a reference to Facepunch.UnityEngine as the warning suggests.
-
I don't really know how to solve it lol, is it like an include? i dont really get why this type of error pops when doing that IF, when the code inside it didnt :/
-
Wulf Community Admin
-
yeah ok, i did that with all DLLs in the managed folder. question is, why is the IDE asking me for that only when writting the IFs? there's nothing in those IFs i didn't use already in the code inside them, and the code inside the IFs worked perfectly, i already tested it in a server. So it makes no sense at all to me.
This doesnt work:
Code:void OnEntityDeath(BaseCombatEntity victim, HitInfo info) { if(victim != null) { if (victim is BasePlayer) { var Online = BasePlayer.activePlayerList as System.Collections.Generic.List<BasePlayer>; BasePlayer randomPlayer = Online[JugadorAleatorio(Online.Count)]; string saltyMessage = "seriously " + GetVictimsName(victim) + ", you're a fucking noob, kill yourself"; Puts("El nombre de jugador aleatorio es: " + randomPlayer.displayName); Puts("El SaltyMessage es: " + saltyMessage); Server.Broadcast(saltyMessage, "<color=#54A7FB>" + randomPlayer.displayName + "</color>", GetSaltyPlayerID(randomPlayer)); } } }
Code:void OnEntityDeath(BaseCombatEntity victim, HitInfo info) { var Online = BasePlayer.activePlayerList as System.Collections.Generic.List<BasePlayer>; BasePlayer randomPlayer = Online[JugadorAleatorio(Online.Count)]; string saltyMessage = "seriously " + GetVictimsName(victim) + ", you're a fucking noob, kill yourself"; Puts("El nombre de jugador aleatorio es: " + randomPlayer.displayName); Puts("El SaltyMessage es: " + saltyMessage); Server.Broadcast(saltyMessage, "<color=#54A7FB>" + randomPlayer.displayName + "</color>", GetSaltyPlayerID(randomPlayer)); }
and where do i get that DLL from? and if it's not included in Oxide, how's the plugin going to work? i really dont get it. -
Wulf Community Admin
-
well, it works anyway with the warning now that i tested it. how can i check if the BaseCombatEntity is a scientist?
ok, with the NPCAPEXPlayer thingLast edited by a moderator: Jun 14, 2018