PHP Code:
#include <sourcemod>
static String:KVPath[PLATFORM_MAX_PATH];
new Words[100][2];
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 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, sizeof(match));
KvGetString(DB, "answer", answer, sizeof(answer));
Words[i - 1][0] = match;
Words[i - 1][1] = answer;
i++
IntToString(i, iInt, sizeof(iInt));
CloseHandle(DB);
}
}
PHP Code:
"speech"
{
"1"
{
"match" "I'm gay"
"answer" "okay"
}
"2"
{
"match" "I'm handsome"
"answer" "okay"
}
}
This is the output :
PHP Code:
// C:\server_backup\tf2\tf\addons\sourcemod\scripting\spse.sp(42) : error 006: must be assigned to an array
// C:\server_backup\tf2\tf\addons\sourcemod\scripting\spse.sp(43) : error 006: must be assigned to an array
Where is wrong of my code? Plsss help me ;c
__________________