File tree 2 files changed +6
-3
lines changed
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ Default configuration:
72
72
## API
73
73
74
74
``` cs
75
- string GetCode (BasePlayer player );
75
+ string GetCode (BasePlayer player , bool guest = false );
76
76
void SetCode (BasePlayer player , string code , bool guest = false );
77
77
void RemoveCode (BasePlayer player , bool guest = false );
78
78
bool IsValidCode (string codeString );
Original file line number Diff line number Diff line change @@ -199,12 +199,15 @@ protected override void LoadDefaultMessages()
199
199
/// Get the code for the given player.
200
200
/// </summary>
201
201
/// <param name="player">The player to get the code for.</param>
202
+ /// <param name="guest">If true, the guest code will be returned instead of the main code.</param>
202
203
/// <returns>A string of the player's code or null if the player doesn't have a code.</returns>
203
- public string GetCode ( BasePlayer player )
204
+ public string GetCode ( BasePlayer player , bool guest = false )
204
205
{
205
206
if ( data . Inst . playerSettings . ContainsKey ( player . userID ) )
206
207
{
207
- return data . Inst . playerSettings [ player . userID ] . code ;
208
+ return guest
209
+ ? data . Inst . playerSettings [ player . userID ] . guestCode
210
+ : data . Inst . playerSettings [ player . userID ] . code ;
208
211
}
209
212
210
213
return null ;
You can’t perform that action at this time.
0 commit comments