bpm91
Advanced OT User
- Joined
- May 23, 2019
- Messages
- 1,046
- Solutions
- 7
- Reaction score
- 180
- Location
- Brazil
- YouTube
- caruniawikibr
Does anyone have any ideas on how I can make the gm character not have access to normal outfits. Just the GM outfit?
In this case I would like GM's not to be able to change clothes other than what he has.You can add this check inside here so the outfit window request is denied for access players. You could also use a playerflag check if you don't wanna hinder all of the access group players and only certain groups.
C++:if (player->isAccessPlayer()) { return; }

local player = Player(self)
if player:getGroup():getAccess() and player:getAccountType() >= ACCOUNT_TYPE_GAMEMASTER then
return false
end
Show me how you put it in the script and which character did you test it with?no work to me
function Creature:onChangeOutfit(outfit)
local player = Player(self)
if player:getGroup():getAccess() and player:getAccountType() >= ACCOUNT_TYPE_GAMEMASTER then
return false
end
if hasEventCallback(EVENT_CALLBACK_ONCHANGEMOUNT) then
if not EventCallback(EVENT_CALLBACK_ONCHANGEMOUNT, self, outfit.lookMount) then
return false
end
end
if hasEventCallback(EVENT_CALLBACK_ONCHANGEOUTFIT) then
return EventCallback(EVENT_CALLBACK_ONCHANGEOUTFIT, self, outfit)
else
return true
end
end


<event class="Creature" method="onChangeOutfit" enabled="1" />
void Game::playerRequestOutfit(uint32_t playerId)
{
if (!g_config.getBoolean(ConfigManager::ALLOW_CHANGEOUTFIT)) {
return;
}
Player* player = getPlayerByID(playerId);
if (!player) {
return;
}
// Verifica se o jogador é um Game Master
if (player->getAccountType() == ACCOUNT_TYPE_GAMEMASTER) {
// Se for um Game Master, não permite trocar de outfit
return;
}
// Jogadores normais podem trocar de outfit
player->sendOutfitWindow();
}