RaphaelÃâžÂ Posted June 21, 2011 Author Share Posted June 21, 2011 Hi! This is my first tutorial (or in this case, fix :P). Do not repair the spelling errors, English was never my forte (I'm using google translator).I saw an error, which forces the server to close by too much experience a player (basically because there is a limit).I made a correction, it was quite simple, if you have any errors, please let me know.On the server, go to modPlayer, and locate "Player(index).exp = exp".Add this code below:```If GetPlayerLevel(index) = MAX_LEVELS And Player(index).exp > GetPlayerNextLevel(index) Then Player(index).exp = GetPlayerNextLevel(index)End If```On the client, add before the "Sub SetPlayerExp"(modDatabase) the following code:```Function GetPlayerNextLevel(ByVal index As Long) As Long ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If index > MAX_PLAYERS Then Exit Function GetPlayerNextLevel = (50 / 3) * ((GetPlayerLevel(index) + 1) ^ 3 - (6 * (GetPlayerLevel(index) + 1) ^ 2) + 17 * (GetPlayerLevel(index) + 1) - 12) ' Error handler Exit Functionerrorhandler: HandleError "GetPlayerNextLevel", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit FunctionEnd Function```And below the "Player(index).EXP" (Sub SetPlayerExp), this code:```If GetPlayerLevel(index) = MAX_LEVELS And Player(index).EXP > GetPlayerNextLevel(index) Then Player(index).EXP = GetPlayerNextLevel(index) Exit Sub End If```Well, that's it. Goodbye :D(Credits goes to me.) Link to comment Share on other sites More sharing options...
chuchoide Posted June 21, 2011 Share Posted June 21, 2011 Nice, this error never happened to me, but it's a nice fix. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now