Thread: [Solved] What wrong is my array?
View Single Post
Author Message
_COLOURFUL
Member
Join Date: May 2017
Location: Hong Kong
Old 08-08-2017 , 06:45   What wrong is my array?
Reply With Quote #1

PHP Code:
#include <sourcemod>

static String:KVPath[PLATFORM_MAX_PATH];
new 
Words[100][2];

public 
OnPluginStart() 
{
    
CreateDirectory("addons/sourcemod/configs",3);
    
BuildPath(Path_SMKVPathsizeof(KVPath), "configs/speech.cfg");
    
RegConsoleCmd("say"Command_Say);
    
RegConsoleCmd("say_team"Command_Say);
    
LoadWord();
}

public 
LoadWord()
{
    new 
Handle:DB CreateKeyValues("Speech");
    
FileToKeyValues(DBKVPath);
    
KvGotoFirstSubKey(DB); // Start
    
new 1String:iInt[32];
    
IntToString(iiIntsizeof(iInt));
    while(
KvJumpToKey(DBiInt))
    {
        new 
String:match[32], String:answer[32];
        
KvGetString(DB"match"matchsizeof(match));
        
KvGetString(DB"answer"answersizeof(answer));
        
Words[1][0] = match;
        
Words[1][1] = answer;
        
i++
        
IntToString(iiIntsizeof(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
__________________
Love Dodgeball

Last edited by _COLOURFUL; 08-08-2017 at 10:32.
_COLOURFUL is offline