Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. /*
  2.  
  3. [Command("call", true)]
  4. public void CallCMD(IPlayer player, int targetId)
  5. {
  6. try
  7. {
  8. if (player == null || !player.Exists) return;
  9. string targetCharName = Characters.GetCharacterName(targetId);
  10. if (targetCharName.Length <= 0)
  11. {
  12. HUDHandler.SendNotification(player, 3, 5000, $"Warnung: Die angegebene Character-ID wurde nicht gefunden ({targetId}).");
  13. return;
  14. }
  15. if (!Characters.ExistCharacterName(targetCharName))
  16. {
  17. HUDHandler.SendNotification(player, 3, 5000, $"Warnung: Der angegebene Charaktername wurde nicht gefunden ({targetCharName} - ID: {targetId}).");
  18. return;
  19. }
  20. var targetPlayer = Alt.Server.GetPlayers().FirstOrDefault(x => x != null && x.Exists && x.GetCharacterMetaId() == (ulong)targetId);
  21. if (targetPlayer == null || !targetPlayer.Exists) { HUDHandler.SendNotification(player, 4, 5000, "Fehler: Spieler ist nicht online."); return; }
  22. player.Emit("SaltyChat_EstablishedCall",targetPlayer);
  23. targetPlayer.Emit("SaltyChat_EstablishedCall",player);
  24.  
  25. }
  26. catch (Exception e)
  27. {
  28. Alt.Log($"{e}");
  29. }
  30. }
  31.  
  32. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement