@@ -25,14 +25,10 @@ public static TargetFind Find(CommandInfo command, bool singleTarget, bool allow
25
25
{
26
26
if ( allowSteamID )
27
27
{
28
- // Get the argument and remove whitespace
29
28
string arg = command . GetArg ( 1 ) . Trim ( ) ;
30
29
31
- SteamID ? steamId = null ;
32
- // Try the standard parsing method
33
- if ( ! SteamID . TryParse ( arg , out steamId ) || steamId == null )
30
+ if ( ! SteamID . TryParse ( arg , out SteamID ? steamId ) || steamId == null )
34
31
{
35
- // If standard parsing fails, try converting as a number
36
32
if ( ulong . TryParse ( arg , out ulong steamIdNum ) )
37
33
{
38
34
steamId = new SteamID ( steamIdNum ) ;
@@ -46,16 +42,15 @@ public static TargetFind Find(CommandInfo command, bool singleTarget, bool allow
46
42
47
43
if ( playerdata == null )
48
44
{
49
- // If not found, create a new offline record (you can adjust this logic as needed)
50
45
playerdata = new Store_Player
51
46
{
52
47
SteamID = steamId . SteamId64 ,
53
48
Credits = 0 ,
54
- PlayerName = steamId . SteamId64 . ToString ( ) // ou outro valor padrão
49
+ PlayerName = steamId . SteamId64 . ToString ( )
55
50
} ;
56
51
Instance . GlobalStorePlayers . Add ( playerdata ) ;
57
52
}
58
- // Define the TargetName: if PlayerName is filled and different from SteamID, use it; otherwise, use SteamID.
53
+
59
54
string finalTargetName = ( ! string . IsNullOrEmpty ( playerdata . PlayerName ) &&
60
55
playerdata . PlayerName != steamId . SteamId64 . ToString ( ) )
61
56
? playerdata . PlayerName
0 commit comments