-----
_ Script _
procedure OnPlayerSpeak(ID: byte; Text: string);
begin
if ( GetPiece(LowerCase(Text), ' ', 0 ) = '!ping' ) then begin
WriteConsole(0, IDToName(ID)+' [Ping]: '+GetPlayerStat([b]GetPiece(Text, ' ', 1 )[/b], 'Ping' ), RGB(255,215,0) );
end;
end;
_ ConsoleLog _
11-04-20 00:03:59 Console Log Started
11-04-20 00:03:59 Welcome to Soldat 1.5.0
11-04-20 00:03:59 [*] ScriptCore v2.6 loaded! Found 2 scripts...
11-04-20 00:03:59 [*] Compiling default -> Core.pas...
11-04-20 00:03:59 [*] Compiling default -> NetworkCore.pas...
11-04-20 00:03:59 [*] Compiling default -> AdminCore.pas...
11-04-20 00:03:59 [*] Compiling asd -> asd.pas...
11-04-20 00:03:59 [*] asd -> [Error] (7:113): [b]Type mismatch[/b]
11-04-20 00:03:59 [*] Compilation Failed.
11-04-20 00:03:59 Shutting down server...
11-04-20 00:03:59 Shutting down admin server...
11-04-20 00:03:59 Shutting down ScriptCore...
-----
If I edit the script like below, it is working.
procedure OnPlayerSpeak(ID: byte; Text: string);
begin
if ( GetPiece(LowerCase(Text), ' ', 0 ) = '!ping' ) then begin
WriteConsole(0, IDToName(ID)+' [Ping]: '+GetPlayerStat([b]1[/b], 'Ping' ), RGB(255,215,0) );
end;
end;
-----
GetPlayerStat(GetPiece(Text, ' ', 1 ), 'Ping' )
So, why is this statement above not true?
Thanks, Utku.