• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ Outfits to GM Downgrade Nekiro 1.5 7.72

bpm91

Advanced OT User
Joined
May 23, 2019
Messages
1,044
Solutions
7
Reaction score
176
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?
 
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;
    }
 
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;
    }
In this case I would like GM's not to be able to change clothes other than what he has.

it should only have the gm outfit option
Post automatically merged:

i found this on events/scripts
1722729369195.webp

Could you edit directly here, if the player is a gamemaster, can't he change clothes, for example?
 
Last edited:
Just after function creature... add:
LUA:
local player = Player(self)
if player:getGroup():getAccess() and player:getAccountType() >= ACCOUNT_TYPE_GAMEMASTER then
    return false
end
 
LUA:
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

1722782537352.webp
number 4
1722782560980.webp
Post automatically merged:

no error appears in tfs, and it didn't work either
 
Have you enabled this function in events.xml?

XML:
<event class="Creature" method="onChangeOutfit" enabled="1" />

I can't remember, but I believe that accountid 4 is a gm account and groupid 4 too, so it should work, but as I'm not at home and I don't know if that's really the case, I can't confirm
 
solved > game.cpp


LUA:
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();
}
 
Last edited:
Back
Top