Advertisement
Guest User

Untitled

a guest
Jan 5th, 2019
863
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. #include <iostream>
  2. #include <API/ARK/Ark.h>
  3.  
  4. #pragma comment(lib, "ArkApi.lib")
  5.  
  6.  
  7.  
  8. void SuicideCMD(AShooterPlayerController* AttackerShooterController, FString* message, int mode)
  9. {
  10. if (!AttackerShooterController || !AttackerShooterController->PlayerStateField() || !AttackerShooterController->GetPlayerCharacter() || AttackerShooterController->GetPlayerCharacter()->IsDead() || !AttackerShooterController->GetPlayerCharacter()->IsConscious() || AttackerShooterController->GetPlayerCharacter()->IsSitting(false)) return;
  11. if (AttackerShooterController && AttackerShooterController->PlayerStateField() && AttackerShooterController->GetPlayerCharacter() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField())
  12. {
  13. FString WeaponName;
  14. AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()->GetItemName(&WeaponName, false, true, nullptr);
  15. if (WeaponName.Contains(L"Handcuffs")) return;
  16. }
  17. if (!ArkApi::GetApiUtils().IsRidingDino(AttackerShooterController)) AttackerShooterController->GetPlayerCharacter()->Suicide();
  18.  
  19. }
  20.  
  21.  
  22. void Load()
  23. {
  24. Log::Get().Init("NoNunnaki");
  25.  
  26.  
  27.  
  28. ArkApi::GetCommands().AddChatCommand("/suicide", &SuicideCMD);
  29.  
  30.  
  31. }
  32.  
  33. void Unload()
  34. {
  35.  
  36. ArkApi::GetCommands().RemoveChatCommand("/suicide");
  37. }
  38.  
  39. BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
  40. {
  41. switch (ul_reason_for_call)
  42. {
  43. case DLL_PROCESS_ATTACH:
  44. Load();
  45. break;
  46. case DLL_PROCESS_DETACH:
  47. Unload();
  48. break;
  49. }
  50. return TRUE;
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement