• 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!

Lua how to Implement functions on the server

Stellow

C++/C#/PHP/LUA
Joined
Oct 23, 2008
Messages
1,112
Reaction score
221
Location
Germany
GitHub
eubrunomiguel
Hello, I am trying to make shared xp work on my oldschool server, but is being a pain to implement the function.

The server is compiled with the following function in party.cpp, how do I implement it in functions.lua, or in other words, make this function usable ingame?

Thanks in advance.

Code:
bool Party::setSharedExperience(Player* player, bool _sharedExpActive)
{
    if(!player || getLeader() != player){
        return false;
    }

    if(sharedExpActive == _sharedExpActive){
        return true;
    }

    sharedExpActive = _sharedExpActive;

    if(sharedExpActive){
        sharedExpEnabled = canEnableSharedExperience();
        if(sharedExpEnabled){
            getLeader()->sendTextMessage(MSG_INFO_DESCR, "Shared Experience is now active.");
        }
        else{
            getLeader()->sendTextMessage(MSG_INFO_DESCR, "Shared Experience has been activated," \
                " but some members of your party are inactive.");
        }
    }
    else{
        getLeader()->sendTextMessage(MSG_INFO_DESCR, "Shared Experience has been deactivated.");
    }

    updateAllPartyIcons();
    return true;
}
 
Back
Top