Skocz do zawartości

  • Zaloguj korzystając z Facebooka Zaloguj korzystając z Twittera Zaloguj przez Steam Zaloguj poprzez Google      Logowanie »   
  • Rejestracja

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.

  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

[ANY] Chat Responder [UPDATED 2/11/15]


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
Brak odpowiedzi do tego tematu

#1 Adminek AMXX.PL

    Admin :)

  • Bot

Reputacja: 156
Profesjonalista

  • Postów:7179
  • Lokalizacja:AMXX.PL
Offline

Napisano 12.02.2016 03:46

<div><div align="center"><b><font size="5">[ANY] Chat Responder </font></b></div><br /><b><font size="3">ABOUT<b></b>:</font></b><br />This plugin takes triggers and responces from a config file and when a player types a phrase, it'll check to see if there are any triggers in it. If so, it'll print back. It can be configured to detect &quot;exact&quot; or &quot;contains&quot; phrases.<br /><br />If I type &quot;Hey whats up!&quot; and &quot;Hey whats up!&quot; is registered as an exact trigger, it'll cause a response.<br />If I type &quot;Banana Man yo&quot; and &quot;yo&quot; is registered as a &quot;contains&quot; trigger, then it'll cause a responce.<br /><br />The config file looks like this<br /><div style="margin: 5px;">
<div class="smallfont" style="margin-bottom: 2px;">
<b>Spoiler</b> <input value="Show" style="margin: 0px; padding: 0px; width: 45px; font-size: 10px;" onclick="if(this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != 'inline')
{ this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'inline'; this.innerText = ''; this.value = 'Hide'; }
else
{ this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value='Show'; }" type="button">
</div>
<div class="alt2" style="border: 1px inset; padding: 6px;">
<div class="spoiler" style="display: none;"><div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">Code:</div>
<hr /><code style="margin:0px" dir="ltr" style="text-align:left">&quot;Chat Responder&quot;<br />{<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;Hi&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;response&quot; &quot;Hey! How are you!&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;type&quot; &quot;e&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;Can you hear me?&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;response&quot; &quot;I can hear ya loud and clear!&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;type&quot; &quot;c&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;Testing 1 2 3&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;response&quot; &quot;I can hear ya loud and clear!&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;type&quot; &quot;e&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;What's my name?&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;response&quot; &quot;Your name is {NAME}!&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;type&quot; &quot;e&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />}</code><hr />
</div></div>
</div>
</div><br /><br />Where &quot;Hi&quot; will trigger the response and &quot;type&quot; will determine if it's supposed to be an exact or a contain trigger.<br /><br /><b><font size="3">CREDITS:</font></b><br />Thanks to ThatOneGuy for introducing me to ADT Arrays when I was learning and also shout out to this thread for giving me the idea <a href="https://forums.allie...d.php?t=267133"target="_blank">[link]</a><br /><br /><b><font size="3">BUGS:</font></b><br />If there are any bugs please comment below, don't forget to check your error logs!<br /><br /><b><font size="3">SOURCE:</font></b><br /><div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
<div class="alt2">
<hr />
<code style="white-space:nowrap">
<div dir="ltr" style="text-align:left;">
<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #FF8000">/****************************************************************************
<br />&nbsp;&nbsp;&nbsp;&nbsp;[ANT]&nbsp;Chat&nbsp;Responder&nbsp;-&nbsp;A&nbsp;friend&nbsp;inside&nbsp;the&nbsp;code&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*
<br />&nbsp;&nbsp;&nbsp;&nbsp;Copyright&nbsp;©&nbsp;2015&nbsp;&nbsp;Michael&nbsp;Flaherty&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br />
<br />&nbsp;&nbsp;&nbsp;&nbsp;This&nbsp;program&nbsp;is&nbsp;free&nbsp;software:&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and/or&nbsp;modify&nbsp;&nbsp;&nbsp;&nbsp;*
<br />&nbsp;&nbsp;&nbsp;&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;as&nbsp;published&nbsp;by&nbsp;&nbsp;&nbsp;&nbsp;*
<br />&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation,&nbsp;either&nbsp;version&nbsp;3&nbsp;of&nbsp;the&nbsp;License,&nbsp;or&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*
<br />&nbsp;&nbsp;&nbsp;&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*
<br />
<br />&nbsp;&nbsp;&nbsp;&nbsp;This&nbsp;program&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*
<br />&nbsp;&nbsp;&nbsp;&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*
<br />&nbsp;&nbsp;&nbsp;&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*
<br />&nbsp;&nbsp;&nbsp;&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*
<br />
<br />&nbsp;&nbsp;&nbsp;&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*
<br />&nbsp;&nbsp;&nbsp;&nbsp;along&nbsp;with&nbsp;this&nbsp;program.&nbsp;&nbsp;If&nbsp;not,&nbsp;see&nbsp;&lt;http://www.gnu.org/l...p;&nbsp;&nbsp;*
<br />*****************************************************************************/
<br />#include&nbsp;&lt;sourcemod&gt;
<br />#include&nbsp;&lt;autoexecconfig&gt;
<br />
<br />#pragma&nbsp;semicolon&nbsp;1
<br />#pragma&nbsp;newdecls&nbsp;required
<br />#pragma&nbsp;dynamic&nbsp;131072&nbsp;//increase&nbsp;stack&nbsp;space&nbsp;to&nbsp;from&nbsp;4&nbsp;kB&nbsp;to&nbsp;131072&nbsp;cells&nbsp;(or&nbsp;512KB,&nbsp;a&nbsp;cell&nbsp;is&nbsp;4&nbsp;bytes).
<br />
<br />#define&nbsp;TAG&nbsp;"&nbsp;x04"
<br />#define&nbsp;PLUGIN_VERSION&nbsp;"1.0"
<br />
<br />/*&nbsp;ADT&nbsp;Arrays&nbsp;*/
<br /></span><span style="color: #0000BB">Handle&nbsp;gh_adtExactTextsResponse</span><span style="color: #007700">;
<br /></span><span style="color: #0000BB">Handle&nbsp;gh_adtExactTextsTrigger</span><span style="color: #007700">;
<br /></span><span style="color: #0000BB">Handle&nbsp;gh_adtContainTextTrigger</span><span style="color: #007700">;
<br /></span><span style="color: #0000BB">Handle&nbsp;gh_adtContainTextResponse</span><span style="color: #007700">;
<br />
<br />
<br /></span><span style="color: #FF8000">/*&nbsp;Lonely&nbsp;Bool&nbsp;*/
<br /></span><span style="color: #0000BB">bool&nbsp;g_bLateLoad</span><span style="color: #007700">;
<br />
<br /></span><span style="color: #FF8000">/*&nbsp;Strings&nbsp;*/
<br /></span><span style="color: #0000BB">char&nbsp;g_sPath</span><span style="color: #007700">[</span><span style="color: #0000BB">PLATFORM_MAX_PATH</span><span style="color: #007700">];
<br />
<br /></span><span style="color: #FF8000">/*&nbsp;ConVars&nbsp;*/
<br /></span><span style="color: #0000BB">ConVar&nbsp;gcv_bPluginEnabled</span><span style="color: #007700">;
<br /></span><span style="color: #0000BB">ConVar&nbsp;gcv_sFilePath</span><span style="color: #007700">;
<br /></span><span style="color: #0000BB">ConVar&nbsp;gcv_bGlobalReply</span><span style="color: #007700">;
<br />
<br />public&nbsp;</span><span style="color: #0000BB">Plugin&nbsp;myinfo&nbsp;</span><span style="color: #007700">=
<br />{
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">name&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"[ANY]&nbsp;Chat&nbsp;Responder"</span><span style="color: #007700">,
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">author&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"Headline"</span><span style="color: #007700">,
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">description&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"A&nbsp;simple&nbsp;chat&nbsp;bot"</span><span style="color: #007700">,
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">version&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">PLUGIN_VERSION</span><span style="color: #007700">,
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">url&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"http://www.michaelwflaherty.com"
<br /></span><span style="color: #007700">};
<br />
<br />public&nbsp;</span><span style="color: #0000BB">APLRes&nbsp;AskPluginLoad2</span><span style="color: #007700">(</span><span style="color: #0000BB">Handle&nbsp;hMyself</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">bool&nbsp;bLate</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">char</span><span style="color: #007700">[]&nbsp;</span><span style="color: #0000BB">sError</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">int&nbsp;err_max</span><span style="color: #007700">)
<br />{
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">g_bLateLoad&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">bLate</span><span style="color: #007700">;
<br />&nbsp;&nbsp;&nbsp;&nbsp;
<br />&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">APLRes_Success</span><span style="color: #007700">;
<br />}
<br />
<br />public&nbsp;</span><span style="color: #0000BB">void&nbsp;OnPluginStart</span><span style="color: #007700">()
<br />{
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">AutoExecConfig_SetFile</span><span style="color: #007700">(</span><span style="color: #DD0000">"hl_chatresponder"</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">AutoExecConfig_CreateConVar</span><span style="color: #007700">(</span><span style="color: #DD0000">"hl_chatresponder_version"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">PLUGIN_VERSION</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"Headline's&nbsp;Chat&nbsp;Responder&nbsp;:&nbsp;Version"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">FCVAR_NOTIFY</span><span style="color: #007700">|</span><span style="color: #0000BB">FCVAR_DONTRECORD</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">gcv_bPluginEnabled&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">AutoExecConfig_CreateConVar</span><span style="color: #007700">(</span><span style="color: #DD0000">"hl_chatresponder_enable"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"1"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"Enable&nbsp;the&nbsp;plugin?n&nbsp;(1&nbsp;=&nbsp;Yes,&nbsp;0&nbsp;=&nbsp;No)"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">FCVAR_NONE</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0.0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1.0</span><span style="color: #007700">);&nbsp;&nbsp;&nbsp;&nbsp;
<br />&nbsp;&nbsp;&nbsp;&nbsp;
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">gcv_sFilePath&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">AutoExecConfig_CreateConVar</span><span style="color: #007700">(</span><span style="color: #DD0000">"hl_chatresponder_filepath"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"configs/hl_chatresponder.txt"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"File&nbsp;path&nbsp;to&nbsp;parse"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">FCVAR_NONE</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">gcv_bGlobalReply&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">AutoExecConfig_CreateConVar</span><span style="color: #007700">(</span><span style="color: #DD0000">"hl_chatresponder_global&nbsp;reply"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"1"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"Make&nbsp;it&nbsp;so&nbsp;the&nbsp;Bot's&nbsp;responses&nbsp;are&nbsp;visible&nbsp;to&nbsp;everyone?n&nbsp;(1&nbsp;=&nbsp;Yes,&nbsp;0&nbsp;=&nbsp;No)"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">FCVAR_NONE</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0.0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1.0</span><span style="color: #007700">);&nbsp;&nbsp;&nbsp;&nbsp;
<br />
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">AutoExecConfig_ExecuteFile</span><span style="color: #007700">();
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">AutoExecConfig_CleanFile</span><span style="color: #007700">();
<br />&nbsp;&nbsp;&nbsp;&nbsp;
<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">g_bLateLoad</span><span style="color: #007700">)
<br />&nbsp;&nbsp;&nbsp;&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">OnConfigsExecuted</span><span style="color: #007700">();
<br />&nbsp;&nbsp;&nbsp;&nbsp;}
<br />&nbsp;&nbsp;&nbsp;&nbsp;
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">AddCommandListener</span><span style="color: #007700">(</span><span style="color: #0000BB">OnSay</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"say"</span><span style="color: #007700">);&nbsp;
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">AddCommandListener</span><span style="color: #007700">(</span><span style="color: #0000BB">OnSay</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"say_team"</span><span style="color: #007700">);
<br />}
<br />
<br />public&nbsp;</span><span style="color: #0000BB">void&nbsp;OnConfigsExecuted</span><span style="color: #007700">()
<br />{
<br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">gcv_bPluginEnabled</span><span style="color: #007700">.</span><span style="color: #0000BB">BoolValue</span><span style="color: #007700">)
<br />&nbsp;&nbsp;&nbsp;&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">InitializeADTArrays</span><span style="color: #007700">();
<br />&nbsp;&nbsp;&nbsp;&nbsp;}
<br />}
<br />
<br />public&nbsp;</span><span style="color: #0000BB">Action&nbsp;OnSay</span><span style="color: #007700">(</span><span style="color: #0000BB">int&nbsp;client</span><span style="color: #007700">,&nbsp;const&nbsp;</span><span style="color: #0000BB">char</span><span style="color: #007700">[]&nbsp;</span><span style="color: #0000BB">command</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">int&nbsp;args</span><span style="color: #007700">)&nbsp;
<br />{
<br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!</span><span style="color: #0000BB">gcv_bPluginEnabled</span><span style="color: #007700">.</span><span style="color: #0000BB">BoolValue</span><span style="color: #007700">)
<br />&nbsp;&nbsp;&nbsp;&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">Plugin_Continue</span><span style="color: #007700">;
<br />&nbsp;&nbsp;&nbsp;&nbsp;}
<br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!</span><span style="color: #0000BB">IsValidClient</span><span style="color: #007700">(</span><span style="color: #0000BB">client</span><span style="color: #007700">))
<br />&nbsp;&nbsp;&nbsp;&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">Plugin_Continue</span><span style="color: #007700">;
<br />&nbsp;&nbsp;&nbsp;&nbsp;}
<br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">client&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">)
<br />&nbsp;&nbsp;&nbsp;&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">Plugin_Continue</span><span style="color: #007700">;
<br />&nbsp;&nbsp;&nbsp;&nbsp;}
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">char&nbsp;sText</span><span style="color: #007700">[</span><span style="color: #0000BB">4096</span><span style="color: #007700">];&nbsp;
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">GetCmdArgString</span><span style="color: #007700">(</span><span style="color: #0000BB">sText</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sizeof</span><span style="color: #007700">(</span><span style="color: #0000BB">sText</span><span style="color: #007700">));
<br />&nbsp;&nbsp;&nbsp;&nbsp;
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">StripQuotes</span><span style="color: #007700">(</span><span style="color: #0000BB">sText</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">Handle&nbsp;hData&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">CreateDataPack</span><span style="color: #007700">();
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">WritePackCell</span><span style="color: #007700">(</span><span style="color: #0000BB">hData</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">client</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">WritePackString</span><span style="color: #007700">(</span><span style="color: #0000BB">hData</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sText</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">ResetPack</span><span style="color: #007700">(</span><span style="color: #0000BB">hData</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">CreateTimer</span><span style="color: #007700">(</span><span style="color: #0000BB">0.3</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">Timer_Reply</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">hData</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">TIMER_FLAG_NO_MAPCHANGE</span><span style="color: #007700">);
<br />
<br />&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">Plugin_Continue</span><span style="color: #007700">;
<br />}
<br />&nbsp;&nbsp;&nbsp;&nbsp;
<br />public&nbsp;</span><span style="color: #0000BB">Action&nbsp;Timer_Reply</span><span style="color: #007700">(</span><span style="color: #0000BB">Handle&nbsp;hTimer</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">Handle&nbsp;hData</span><span style="color: #007700">)
<br />{
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">char&nbsp;sText</span><span style="color: #007700">[</span><span style="color: #0000BB">4096</span><span style="color: #007700">];&nbsp;
<br />
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">int&nbsp;client&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ReadPackCell</span><span style="color: #007700">(</span><span style="color: #0000BB">hData</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">ReadPackString</span><span style="color: #007700">(</span><span style="color: #0000BB">hData</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sText</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sizeof</span><span style="color: #007700">(</span><span style="color: #0000BB">sText</span><span style="color: #007700">));
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">CloseHandle</span><span style="color: #007700">(</span><span style="color: #0000BB">hData</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">char&nbsp;sTrigger</span><span style="color: #007700">[</span><span style="color: #0000BB">128</span><span style="color: #007700">];
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">char&nbsp;sResponse</span><span style="color: #007700">[</span><span style="color: #0000BB">128</span><span style="color: #007700">];
<br />
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">bool&nbsp;bFoundResponse&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;
<br />&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;(</span><span style="color: #0000BB">int&nbsp;i&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">i&nbsp;</span><span style="color: #007700">&lt;&nbsp;</span><span style="color: #0000BB">GetArraySize</span><span style="color: #007700">(</span><span style="color: #0000BB">gh_adtExactTextsTrigger</span><span style="color: #007700">);&nbsp;</span><span style="color: #0000BB">i</span><span style="color: #007700">++)
<br />&nbsp;&nbsp;&nbsp;&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">GetArrayString</span><span style="color: #007700">(</span><span style="color: #0000BB">gh_adtExactTextsTrigger</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">i</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sTrigger</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sizeof</span><span style="color: #007700">(</span><span style="color: #0000BB">sTrigger</span><span style="color: #007700">));
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">StrEqual</span><span style="color: #007700">(</span><span style="color: #0000BB">sText</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sTrigger</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">))
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">GetArrayString</span><span style="color: #007700">(</span><span style="color: #0000BB">gh_adtExactTextsResponse</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">i</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sResponse</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sizeof</span><span style="color: #007700">(</span><span style="color: #0000BB">sResponse</span><span style="color: #007700">));
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">StrContains</span><span style="color: #007700">(</span><span style="color: #0000BB">sResponse</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"{NAME}"</span><span style="color: #007700">))
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">char&nbsp;sName</span><span style="color: #007700">[</span><span style="color: #0000BB">MAX_NAME_LENGTH</span><span style="color: #007700">];
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">GetClientName</span><span style="color: #007700">(</span><span style="color: #0000BB">client</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sName</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sizeof</span><span style="color: #007700">(</span><span style="color: #0000BB">sName</span><span style="color: #007700">));
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">ReplaceString</span><span style="color: #007700">(</span><span style="color: #0000BB">sResponse</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sizeof</span><span style="color: #007700">(</span><span style="color: #0000BB">sResponse</span><span style="color: #007700">),&nbsp;</span><span style="color: #DD0000">"{NAME}"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sName</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">gcv_bGlobalReply</span><span style="color: #007700">.</span><span style="color: #0000BB">BoolValue</span><span style="color: #007700">)
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">PrintToChatAll</span><span style="color: #007700">(</span><span style="color: #DD0000">"%s%s"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">TAG</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sResponse</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">PrintToChat</span><span style="color: #007700">(</span><span style="color: #0000BB">client</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"%s%s"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">TAG</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sResponse</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">bFoundResponse&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">;
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">bFoundResponse&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
<br />&nbsp;&nbsp;&nbsp;&nbsp;}
<br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!</span><span style="color: #0000BB">bFoundResponse</span><span style="color: #007700">)
<br />&nbsp;&nbsp;&nbsp;&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;(</span><span style="color: #0000BB">int&nbsp;i&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">i&nbsp;</span><span style="color: #007700">&lt;&nbsp;</span><span style="color: #0000BB">GetArraySize</span><span style="color: #007700">(</span><span style="color: #0000BB">gh_adtContainTextTrigger</span><span style="color: #007700">);&nbsp;</span><span style="color: #0000BB">i</span><span style="color: #007700">++)
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">GetArrayString</span><span style="color: #007700">(</span><span style="color: #0000BB">gh_adtContainTextTrigger</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">i</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sTrigger</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sizeof</span><span style="color: #007700">(</span><span style="color: #0000BB">sTrigger</span><span style="color: #007700">));
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">StrContains</span><span style="color: #007700">(</span><span style="color: #0000BB">sText</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sTrigger</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">)&nbsp;!=&nbsp;-</span><span style="color: #0000BB">1</span><span style="color: #007700">)
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">GetArrayString</span><span style="color: #007700">(</span><span style="color: #0000BB">gh_adtContainTextResponse</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">i</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sResponse</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sizeof</span><span style="color: #007700">(</span><span style="color: #0000BB">sResponse</span><span style="color: #007700">));
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">PrintToChatAll</span><span style="color: #007700">(</span><span style="color: #DD0000">"%s%s"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">TAG</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sResponse</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">bFoundResponse&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">;
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
<br />&nbsp;&nbsp;&nbsp;&nbsp;}
<br />}
<br />
<br />public&nbsp;</span><span style="color: #0000BB">void&nbsp;ParseKvFile</span><span style="color: #007700">()
<br />{
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">char&nbsp;sPath</span><span style="color: #007700">[</span><span style="color: #0000BB">PLATFORM_MAX_PATH</span><span style="color: #007700">];
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">gcv_sFilePath</span><span style="color: #007700">.</span><span style="color: #0000BB">GetString</span><span style="color: #007700">(</span><span style="color: #0000BB">sPath</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sizeof</span><span style="color: #007700">(</span><span style="color: #0000BB">sPath</span><span style="color: #007700">));
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">BuildPath</span><span style="color: #007700">(</span><span style="color: #0000BB">Path_SM</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">g_sPath</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sizeof</span><span style="color: #007700">(</span><span style="color: #0000BB">g_sPath</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">sPath</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">Handle&nbsp;hKeyValues&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">CreateKeyValues</span><span style="color: #007700">(</span><span style="color: #DD0000">"Chat&nbsp;Responder"</span><span style="color: #007700">);
<br />
<br />&nbsp;&nbsp;&nbsp;&nbsp;if(!</span><span style="color: #0000BB">FileExists</span><span style="color: #007700">(</span><span style="color: #0000BB">g_sPath</span><span style="color: #007700">))
<br />&nbsp;&nbsp;&nbsp;&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">SetFailState</span><span style="color: #007700">(</span><span style="color: #DD0000">"Configuration&nbsp;file&nbsp;%s&nbsp;not&nbsp;found!"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">g_sPath</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;
<br />&nbsp;&nbsp;&nbsp;&nbsp;}
<br />
<br />&nbsp;&nbsp;&nbsp;&nbsp;if(!</span><span style="color: #0000BB">FileToKeyValues</span><span style="color: #007700">(</span><span style="color: #0000BB">hKeyValues</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">g_sPath</span><span style="color: #007700">))
<br />&nbsp;&nbsp;&nbsp;&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">SetFailState</span><span style="color: #007700">(</span><span style="color: #DD0000">"Improper&nbsp;structure&nbsp;for&nbsp;configuration&nbsp;file&nbsp;%s!"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">g_sPath</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;
<br />&nbsp;&nbsp;&nbsp;&nbsp;}
<br />
<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">KvGotoFirstSubKey</span><span style="color: #007700">(</span><span style="color: #0000BB">hKeyValues</span><span style="color: #007700">))
<br />&nbsp;&nbsp;&nbsp;&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;do
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">char&nbsp;sSectionName</span><span style="color: #007700">[</span><span style="color: #0000BB">128</span><span style="color: #007700">];
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">char&nbsp;sType</span><span style="color: #007700">[</span><span style="color: #0000BB">128</span><span style="color: #007700">];
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">char&nbsp;sText</span><span style="color: #007700">[</span><span style="color: #0000BB">128</span><span style="color: #007700">];
<br />
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">KvGetSectionName</span><span style="color: #007700">(</span><span style="color: #0000BB">hKeyValues</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sSectionName</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sizeof</span><span style="color: #007700">(</span><span style="color: #0000BB">sSectionName</span><span style="color: #007700">));&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//get&nbsp;name&nbsp;of&nbsp;section
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">KvGetString</span><span style="color: #007700">(</span><span style="color: #0000BB">hKeyValues</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"response"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sText</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sizeof</span><span style="color: #007700">(</span><span style="color: #0000BB">sText</span><span style="color: #007700">));
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">KvGetString</span><span style="color: #007700">(</span><span style="color: #0000BB">hKeyValues</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"type"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sType</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sizeof</span><span style="color: #007700">(</span><span style="color: #0000BB">sType</span><span style="color: #007700">));&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//call&nbsp;key-value&nbsp;by&nbsp;name&nbsp;of&nbsp;key&nbsp;and&nbsp;store&nbsp;value&nbsp;in&nbsp;variable,&nbsp;with&nbsp;default&nbsp;as&nbsp;"blah"&nbsp;if&nbsp;it&nbsp;doesnt&nbsp;exist
<br />
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">StrEqual</span><span style="color: #007700">(</span><span style="color: #0000BB">sType</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"e"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">))
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">PushArrayString</span><span style="color: #007700">(</span><span style="color: #0000BB">gh_adtExactTextsTrigger</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sSectionName</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">PushArrayString</span><span style="color: #007700">(</span><span style="color: #0000BB">gh_adtExactTextsResponse</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sText</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;if&nbsp;(</span><span style="color: #0000BB">StrEqual</span><span style="color: #007700">(</span><span style="color: #0000BB">sType</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"c"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">))
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">PushArrayString</span><span style="color: #007700">(</span><span style="color: #0000BB">gh_adtContainTextTrigger</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sSectionName</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">PushArrayString</span><span style="color: #007700">(</span><span style="color: #0000BB">gh_adtContainTextResponse</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sText</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while(</span><span style="color: #0000BB">KvGotoNextKey</span><span style="color: #007700">(</span><span style="color: #0000BB">hKeyValues</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">));
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">KvGoBack</span><span style="color: #007700">(</span><span style="color: #0000BB">hKeyValues</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;}
<br />&nbsp;&nbsp;&nbsp;&nbsp;else
<br />&nbsp;&nbsp;&nbsp;&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">SetFailState</span><span style="color: #007700">(</span><span style="color: #DD0000">"Can't&nbsp;find&nbsp;first&nbsp;subkey&nbsp;in&nbsp;configuration&nbsp;file&nbsp;%s!"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">g_sPath</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">CloseHandle</span><span style="color: #007700">(</span><span style="color: #0000BB">hKeyValues</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;
<br />&nbsp;&nbsp;&nbsp;&nbsp;}
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">CloseHandle</span><span style="color: #007700">(</span><span style="color: #0000BB">hKeyValues</span><span style="color: #007700">);
<br />}
<br />
<br /></span><span style="color: #0000BB">stock&nbsp;void&nbsp;InitializeADTArrays</span><span style="color: #007700">()
<br />{
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">gh_adtExactTextsTrigger&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">CreateArray</span><span style="color: #007700">(</span><span style="color: #0000BB">64</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">gh_adtExactTextsResponse&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">CreateArray</span><span style="color: #007700">(</span><span style="color: #0000BB">128</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">ClearArray</span><span style="color: #007700">(</span><span style="color: #0000BB">gh_adtExactTextsTrigger</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">ClearArray</span><span style="color: #007700">(</span><span style="color: #0000BB">gh_adtExactTextsResponse</span><span style="color: #007700">);
<br />
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">gh_adtContainTextTrigger&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">CreateArray</span><span style="color: #007700">(</span><span style="color: #0000BB">64</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">gh_adtContainTextResponse&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">CreateArray</span><span style="color: #007700">(</span><span style="color: #0000BB">128</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">ClearArray</span><span style="color: #007700">(</span><span style="color: #0000BB">gh_adtContainTextTrigger</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">ClearArray</span><span style="color: #007700">(</span><span style="color: #0000BB">gh_adtContainTextResponse</span><span style="color: #007700">);
<br />
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">ParseKvFile</span><span style="color: #007700">();
<br />}
<br />
<br /></span><span style="color: #0000BB">stock&nbsp;bool&nbsp;IsValidClient</span><span style="color: #007700">(</span><span style="color: #0000BB">int&nbsp;client</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">bool&nbsp;bAllowBots&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">bool&nbsp;bAllowDead&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">)
<br />{
<br />&nbsp;&nbsp;&nbsp;&nbsp;if(!(</span><span style="color: #0000BB">1&nbsp;</span><span style="color: #007700">&lt;=&nbsp;</span><span style="color: #0000BB">client&nbsp;</span><span style="color: #007700">&lt;=&nbsp;</span><span style="color: #0000BB">MaxClients</span><span style="color: #007700">)&nbsp;||&nbsp;!</span><span style="color: #0000BB">IsClientInGame</span><span style="color: #007700">(</span><span style="color: #0000BB">client</span><span style="color: #007700">)&nbsp;||&nbsp;(</span><span style="color: #0000BB">IsFakeClient</span><span style="color: #007700">(</span><span style="color: #0000BB">client</span><span style="color: #007700">)&nbsp;&amp;&amp;&nbsp;!</span><span style="color: #0000BB">bAllowBots</span><span style="color: #007700">)&nbsp;||&nbsp;</span><span style="color: #0000BB">IsClientSourceTV</span><span style="color: #007700">(</span><span style="color: #0000BB">client</span><span style="color: #007700">)&nbsp;||&nbsp;</span><span style="color: #0000BB">IsClientReplay</span><span style="color: #007700">(</span><span style="color: #0000BB">client</span><span style="color: #007700">)&nbsp;||&nbsp;(!</span><span style="color: #0000BB">bAllowDead&nbsp;</span><span style="color: #007700">&amp;&amp;&nbsp;!</span><span style="color: #0000BB">IsPlayerAlive</span><span style="color: #007700">(</span><span style="color: #0000BB">client</span><span style="color: #007700">)))
<br />&nbsp;&nbsp;&nbsp;&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;
<br />&nbsp;&nbsp;&nbsp;&nbsp;}
<br />&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">;
<br />}
<br />
<br /></span><span style="color: #FF8000">/*
<br />&nbsp;&nbsp;&nbsp;&nbsp;Change&nbsp;log
<br />&nbsp;&nbsp;&nbsp;&nbsp;1.0
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;First&nbsp;release&nbsp;
<br />*/&nbsp;
<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
</div>
</code>
<hr />
</div>
</div></div>


<br /> <div style="padding:6px">








<fieldset class="fieldset">
<legend>Attached Files</legend>
<table cellpadding="0" cellspacing="3" border="0">
<tr>
<td><img class="inlineimg" src="https://forums.allie...attach/zip.gif"alt="File Type: zip" width="16" height="16" border="0" style="vertical-align:baseline" /></td>
<td>


<a href="https://forums.allie...sponder.zip</a>(15.6 KB)


</td>
</tr>
</table>
</fieldset>


</div>

Wyświetl pełny artykuł




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych