반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- Ark Survival
- 마인크래프트 공지 플러그인 만들기
- discord
- 슬래시 커맨드
- 만들기
- 아크 플러그인
- ark plugin
- discord.py
- 공지
- 디스코드 봇
- 디스코드
- 마인크래프트 공지 플러그인
- 자살명령어
- 아크서바이벌 플러그인 만들기
- 파이썬으로 디스코드 봇 만들기
- discord embed
- DISCORD BOT
- 명령어
- slash command
- 디스코드 봇 만들기
- 파이썬 봇
- 아크서바이벌 플러그인
- ARK Survival Evolved
- 슬래시 명령어
- 플러그인 제작
- ARK
- 개발자 툴
- 플러그인
- 디스코드 임베드
- 파이썬
Archives
- Today
- Total
Mojangcam
ARK 서버용 ' 자살 명령어' 커맨드 플러그인 제작기 🔫 본문
반응형
🧠 왜 만들었는가?
ARK 서버 운영을 하다 보면, 다음과 같은 상황들이 종종 발생합니다.
- 지형 버그에 끼어서 움직이지 못함
- 텔레포트 기능 없이 리스폰이 필요한 상황
- 스스로 죽지 않으면 진행이 안 되는 퀘스트나 이벤트
이럴 때 서버 운영자나 유저에게 /suicide 명령어를 제공하면 굉장히 유용합니다.
하지만 너무 무분별하게 사용되면 서버 밸런스를 해칠 수도 있죠.
그래서 저는 "조건부 자살 명령어" 플러그인을 만들었습니다.
즉, 관리자가 허용한 상황에서만 자살이 가능하도록 제어하는 거죠.
🧩 주요 기능
- 🛡️ 관리자 전용 설정 가능 (AllowOnlyAdminCommand)
- 🦖 탈것 탑승 중 자살 제한 (AllowRidingDinoSuicide)
- 😵 무의식 상태에서 자살 제한 (AllowUnconsiousSuicide)
- 🧠 노글린 정신지배 상태 제한 (AllowNoglineSuicide)
- 🔗 수갑 착용 중 제한 (AllowTakeUpHandcuffs)
- 💊 특정 버프 보유 중 제한 (AllowCustomHaveBuffs)
- 🔫 특정 무기 장착 중 제한 (AllowCustomTakeUpWeapon)
CommandSuicide.cpp
void CommandSuicide(AShooterPlayerController* playerController, FString* msg, int mode) {
if (!config["suicide"]["EnableMode"])
return;
// 관리자 권한 체크
if (config["suicide"]["AllowOnlyAdminCommand"] == true) {
if (!playerController->bIsAdmin()()) {
// 관리자 아닐 경우 차단 메시지 출력
SendDenyMessage(playerController, "PermissionDeniedMessage");
return;
}
}
// 탈것 탑승 체크
if (!config["suicide"]["AllowRidingDinoSuicide"] && playerController->IsRidingDino()) {
SendDenyMessage(playerController, "DeniedRidingDinoSuicideMessage");
return;
}
// 무의식 상태 체크
if (!config["suicide"]["AllowUnconsiousSuicide"] && !playerController->GetPlayerCharacter()->IsConscious()) {
SendDenyMessage(playerController, "DeniedUnconsiousSuicideMessage");
return;
}
// 노글린 정신지배 체크
if (!config["suicide"]["AllowNoglineSuicide"] && bIsNoglinMindControllForPlayer(playerController)) {
SendDenyMessage(playerController, "DeniedNoglineSuicideMessage");
return;
}
// 수갑 착용 체크
if (!config["suicide"]["AllowTakeUpHandcuffs"] && bIsPlayerHandCuffed(playerController)) {
SendDenyMessage(playerController, "DeniedTakeUpHandcuffsMessage");
return;
}
// 커스텀 버프 보유 여부 확인
if (!config["suicide"]["AllowCustomHaveBuffs"]) {
if (bIsPlayerHaveBuffs(playerController, LoadBuffList("BuffList"))) {
SendDenyMessage(playerController, "DeniedCustomHaveBuffsMessage");
return;
}
}
// 커스텀 무기 장착 여부 확인
if (!config["suicide"]["AllowCustomTakeUpWeapon"]) {
if (bIsPlayerTakeUpWeapon(playerController, LoadBuffList("weaponList"))) {
SendDenyMessage(playerController, "DeniedCustomTakeUpWeaponMessage");
return;
}
}
// 자살 실행
playerController->GetPlayerCharacter()->Suicide();
SendSuccessMessage(playerController, "SuicideMessage");
}
💬 메시지 출력과 목록 로딩은 헬퍼 함수로 추상화하면 깔끔해요!
PlayerStatusUtils.cpp
bool bIsPlayerHaveBuffs(AShooterPlayerController* playerController, TArray<FString> BuffList) {
auto playerBuffs = playerController->GetPlayerCharacter()->BuffsField();
for (auto buff : playerBuffs) {
FString playerBuffBP = ArkApi::GetApiUtils().GetBlueprint(buff);
if (BuffList.Contains(playerBuffBP)) return true;
}
return false;
}
bool bIsNoglinMindControllForPlayer(AShooterPlayerController* playerController) {
TArray<FString> noglinBuff = { "Blueprint'/Game/Genesis2/Dinos/BrainSlug/Buff_BrainSlug_HumanControl.Buff_BrainSlug_HumanControl'" };
return bIsPlayerHaveBuffs(playerController, noglinBuff);
}
bool bIsPlayerTakeUpWeapon(AShooterPlayerController* playerController, TArray<FString> WeaponList) {
auto weapon = playerController->GetPlayerCharacter()->CurrentWeaponField();
if (!weapon) return false;
FString weaponBP = ArkApi::GetApiUtils().GetBlueprint(weapon->AssociatedPrimalItemField());
return WeaponList.Contains(weaponBP);
}
🛠️ 적용 방법
- CommandSuicide.cpp 와 PlayerStatusUtils.cpp 를 프로젝트에 추가 (일부 소스코드는 아직 비공개 입니다 :D)
- suicide 관련 설정 항목 .json 파일에 정의
- 커맨드 시스템에 suicide 명령어 연결
- 테스트 → 성공하면 운영 적용!
💬 마무리
게임 내 자살 기능이라고 하면 무겁게 느껴질 수 있지만,
서버 운영 측면에선 굉장히 필요하고 실용적인 기능이 될 수 있습니다.
플레이어가 자유롭게 상황을 정리할 수 있게 하면서도,
운영자는 그 자유를 제어 가능한 옵션으로 만들 수 있어요.
반응형
'Ark Survival Evolved Plugin' 카테고리의 다른 글
아크 서바이벌 플러그인 만들기 - 명령어 (2) | 2023.12.22 |
---|