View Single Post
Author Message
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 02-19-2021 , 08:02   error 001: expected token: "]", but found "-identifier-"
Reply With Quote #1

Hello coders! I'm trying to make message from rows defined in array, but getting error 001: expected token: "]", but found "-identifier-".
Can someone help me to fix it?
Here's problem code:
PHP Code:
new const BHP2_HEADER[] = "^n* Possible arguments:^n"
new const BHP2_HELP[][128] = {
    
"* help - show this message^n",
    
"* toggle - toggle bhop^n",
    
"* autojump <1 | 0> - toggle autojump^n",
    
"* list - show bhop users list^n" }
new const 
BHP2_FOOTER[] = "***"

new xbh_help_msg[1024]

public 
xbhop_help(id)
{
    new 
i
    format
(xbh_help_msgcharsmax(xbh_help_msg), "%s"BHP2_HEADER)
    
    for(
i=03i++)
    {
        
// PROMBLEM CODE IS BELOW
        
add(xbh_help_msgcharsmax(xbh_help_msg), BHP2_HELP[i], charsmax(BHP2_HELP[i])) //ERROR COMES HERE
        // PROMBLEM CODE IS ABOVE
    
}
    
    
add(xbh_help_msgcharsmax(xbh_help_msg), BHP2_FOOTERcharsmax(BHP2_FOOTER))

    
client_print(idprint_consolexbh_help_msg)
    
    return 
PLUGIN_HANDLED


Last edited by kww; 02-20-2021 at 06:24.
kww is offline