This is my latest code, i can't output any result pls help me ;c
PHP Code:
#include <sourcemod>
static String:KVPath[PLATFORM_MAX_PATH];
new String:Words[100][4];
public Plugin:myinfo =
{
name = "Key Values",
author = "Hoursplayed.net",
description = "",
url = "http://hoursplayed.net"
}
public OnPluginStart()
{
CreateDirectory("addons/sourcemod/configs",3);
BuildPath(Path_SM, KVPath, sizeof(KVPath), "configs/speech.cfg");
RegConsoleCmd("say", Command_Say);
RegConsoleCmd("say_team", Command_Say);
LoadWord();
}
public Action:Command_Say(client, args)
{
decl String:arg1[200];
GetCmdArg(1, arg1, sizeof(arg1));
for(new i = 0;i < 100;i++)
{
if(!StrEqual(Words[i][0], "") && !StrEqual(Words[i][1], ""))
{
if(StrContains(arg1, Words[i][0], false) != -1)
{
PrintToChatAll("%s", Words[i][1]);
ServerCommand("sm_slap @all");
} else continue;
} else continue;
}
return Plugin_Continue;
}
public LoadWord()
{
new Handle:DB = CreateKeyValues("Speech");
FileToKeyValues(DB, KVPath);
KvGotoFirstSubKey(DB); // Start
new i = 1, String:iInt[32];
IntToString(i, iInt, sizeof(iInt));
while(KvJumpToKey(DB, iInt))
{
new String:match[32], String:answer[32];
KvGetString(DB, "match", match[1], 32);
KvGetString(DB, "answer", answer[1], 32);
Words[i - 1][0] = match[1];
Words[i - 1][1] = answer[1];
i++
IntToString(i, iInt, sizeof(iInt));
CloseHandle(DB);
}
}
PHP Code:
"Speech"
{
"0"
{
"match" "fml"
"answer" "okay"
}
"1"
{
"match" "diu"
"answer" "on9"
}
}
__________________