fix last commit, wrong file pushed for SaveLevel.sp

This commit is contained in:
BotoX 2016-02-21 16:04:00 +01:00
parent 80d52d9aaa
commit d8ba114de3

View File

@ -10,7 +10,7 @@ StringMap g_PlayerLevels;
KeyValues g_Config; KeyValues g_Config;
KeyValues g_PropAltNames; KeyValues g_PropAltNames;
#define PLUGIN_VERSION "1.0" #define PLUGIN_VERSION "1.1"
public Plugin myinfo = public Plugin myinfo =
{ {
name = "SaveLevel", name = "SaveLevel",
@ -260,11 +260,6 @@ public void OnClientDisconnect(int client)
} }
else if(StrEqual(sSection, "math")) else if(StrEqual(sSection, "math"))
{ {
int _Matches = 0;
int _ExactMatches = g_Config.GetNum("ExactMatches", -1);
int _MinMatches = g_Config.GetNum("MinMatches", -1);
int _MaxMatches = g_Config.GetNum("MaxMatches", -1);
if(g_Config.GotoFirstSubKey(false)) if(g_Config.GotoFirstSubKey(false))
{ {
do do
@ -272,33 +267,55 @@ public void OnClientDisconnect(int client)
g_Config.GetSectionName(sKey, sizeof(sKey)); g_Config.GetSectionName(sKey, sizeof(sKey));
g_Config.GetString(NULL_STRING, sValue, sizeof(sValue)); g_Config.GetString(NULL_STRING, sValue, sizeof(sValue));
int Target = 0;
int Input;
int Parameter;
Input = FindCharInString(sValue[Target], ',');
sValue[Input] = 0; Input++;
Parameter = Input + FindCharInString(sValue[Input], ',');
sValue[Parameter] = 0; Parameter++;
int Value = 0;
int Count = GetOutputCount(client, sKey); int Count = GetOutputCount(client, sKey);
for(int i = 0; i < Count; i++) for(int i = 0; i < Count; i++)
{ {
int Target; int _Target = 0;
int Input; int _Input;
int Parameter; int _Parameter;
int Len = GetOutputTarget(client, sKey, i, sOutput); _Input = GetOutputTarget(client, sKey, i, sOutput[_Target]);
sOutput[_Input] = 0; _Input++;
Input = Len; _Parameter = _Input + GetOutputTargetInput(client, sKey, i, sOutput[_Input]);
Len += GetOutputTargetInput(client, sKey, i, sOutput[Len]); sOutput[_Parameter] = 0; _Parameter++;
Parameter = Len; GetOutputParameter(client, sKey, i, sOutput[_Parameter]);
Len += GetOutputParameter(client, sKey, i, sOutput[Len]);
PrintToChatAll("Target: %d -> \"%s\"", sOutput[Target]); if(!StrEqual(sOutput[_Target], sValue[Target]))
PrintToChatAll("Input: %d -> \"%s\"", sOutput[Input]); continue;
PrintToChatAll("Parameter: %d -> \"%s\"", sOutput[Parameter]);
int _Value = StringToInt(sOutput[_Parameter]);
if(StrEqual(sOutput[_Input], "add", false))
Value += _Value;
else if(StrEqual(sOutput[_Input], "subtract", false))
Value -= _Value;
} }
int Result = StringToInt(sValue[Parameter]);
if(StrEqual(sValue[Input], "subtract", false))
Result *= -1;
if(Value == Result)
Matches += 1;
} }
while(g_Config.GotoNextKey(false)); while(g_Config.GotoNextKey(false));
g_Config.GoBack(); g_Config.GoBack();
} }
g_Config.GoBack(); g_Config.GoBack();
Matches += CalcMatches(_Matches, _ExactMatches, _MinMatches, _MaxMatches);
} }
} }
while(g_Config.GotoNextKey(false)); while(g_Config.GotoNextKey(false));