Raised This Month: $51 Target: $400
 12% 

error 023: array assignment must be simple assignment


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mofforg
Senior Member
Join Date: Aug 2010
Location: Moscow, Russia
Old 07-16-2013 , 10:10   error 023: array assignment must be simple assignment
Reply With Quote #1

Here's a part of custom translit plugin to translate symbols and add some info to msg.

PHP Code:
    new p_Name[32]
    
get_user_name(id,p_Name,31)
    
    
format (s_Out191"^1%s"p_Name)
    
    if (
get_user_flags(id) & ADMIN_CHAT)
    {
        
s_Out += format (s_Out191"^1[^4Admin^1]:^4")
        
s_Color true
    
}
    else 
s_Out += format (s_Out191"^3 ");
    
    
s_Out += format (s_Out191" %s"sz_Msg)
    
    if ( 
s_Transl || s_Color )
    {
        
client_printcolor(0,s_Out)
        return 
PLUGIN_HANDLED
    
}
    
    return 
PLUGIN_CONTINUE 
In few lines, where i try to plus existed content with new content returns
PHP Code:
error 023: array assignment must be simple assignment 
PHP Code:
s_Out += format (s_Out191"^1[^4Admin^1]:^4")

else 
s_Out += format (s_Out191"^3 ");

s_Out += format (s_Out191" %s"sz_Msg
Why should it be wrong? I assume it should work because i don't know another way to plus strings.
Mofforg is offline
Send a message via ICQ to Mofforg Send a message via Skype™ to Mofforg
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 07-16-2013 , 10:15   Re: error 023: array assignment must be simple assignment
Reply With Quote #2

You cannot do that with a String. You must use format(ex) or another command to combine multiple strings together
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Mofforg
Senior Member
Join Date: Aug 2010
Location: Moscow, Russia
Old 07-16-2013 , 10:21   Re: error 023: array assignment must be simple assignment
Reply With Quote #3

Quote:
Originally Posted by YamiKaitou View Post
You cannot do that with a String. You must use format(ex) or another command to combine multiple strings together
Eeee, i am stupid.

This way?

PHP Code:
    formatex (s_Out191"^1%s"p_Name)
    
    if (
get_user_flags(id) & ADMIN_CHAT)
    {
        
formatex (s_Out191"%s^1[^4Admin^1]:^4"s_Out)
        
s_Color true
    

Mofforg is offline
Send a message via ICQ to Mofforg Send a message via Skype™ to Mofforg
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:14.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode