This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void SpawnGrenade(Vector3 position, bool isFlash = false, float fusedur = -1, ReferenceHub player = null) | |
{ | |
if(player == null) player = ReferenceHub.GetHub(PlayerManager.localPlayer); | |
var gm = player.GetComponent<Grenades.GrenadeManager>(); | |
Grenades.Grenade component = UnityEngine.Object.Instantiate(gm.availableGrenades[isFlash ? (int)GRENADE_ID.FLASH_NADE : (int)GRENADE_ID.FRAG_NADE].grenadeInstance).GetComponent<Grenades.Grenade>(); | |
if(fusedur != -1) component.fuseDuration = fusedur; | |
component.FullInitData(gm, position, Quaternion.Euler(component.throwStartAngle), Vector3.zero, component.throwAngularVelocity); | |
NetworkServer.Spawn(component.gameObject); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using sanyae2439.SyncVarHackExtensions; | |
// Example:SyncVar | |
public static void SetTargetOnlyVisibleBadge(this Player target, string text) | |
{ | |
target.SendCustomSyncVar(target.ReferenceHub.networkIdentity, typeof(ServerRoles), nameof(ServerRoles.NetworkMyText), text); | |
} | |
// Example:TargetRpc | |
public static void TargetShake(this Player target, bool achieve) |