Posts: 107
Threads: 33
Joined: Aug 2015
Reputation:
0
Recently players started exploiting the SendClientMessage function.
For example if you write /report %s the server will try to output , but as the string contains %s the server would crash .
I'm sorry for my english but i'm doing my best .
an example would be :
Report from TheDarkBlade [2, level 3]: %s"
So i'm hoping for a golbal fix
Posts: 3,133
Threads: 71
Joined: Dec 2013
Reputation:
0
Show the code you use for the report command.
Posts: 11,827
Threads: 33
Joined: Dec 2011
Reputation:
0
Let the players write the command's parameters in chat mode and not a dialog, it converts % automatically to #
Otherwise you'll need to search in inputtext for sign character and return an error for invalid character.
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
As far as I know percent signs are replaced with pound signs (#) on the client before anything is even sent to the server for precisely this reason. Or perhaps this only works in OnPlayerText, not sure. Either way, should be an easy fix if you use strfind.
Posts: 542
Threads: 14
Joined: Aug 2016
Reputation:
0
%% - one % in the mainchat,%%%%- for 2 etc etc
Posts: 1,199
Threads: 238
Joined: Feb 2016
Reputation:
0
I just tried on localhost and no metter how much i type %%% output is always #
Posts: 11,827
Threads: 33
Joined: Dec 2011
Reputation:
0
You use double percent sign in format function only, you search for a single in strfind.