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

Solved Pre-Defined Multi-Dimensional Array


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AnimalMonster
Senior Member
Join Date: May 2020
Old 12-10-2020 , 16:04   Pre-Defined Multi-Dimensional Array
Reply With Quote #1

Hey there, if you want to help me just answer this question, what's wrong with the code below?:
PHP Code:
new color[][][] = {
        {
"Blue"00255},
        
// other 9 like this one above

I wanted to use this into a plugin for reducing the amount of lines but when i tried to use this into a set_dhudmessage it threw an error: Argument Type Mismatch. (In the first 3 arguments)
Used it alike that: color[x][0..2]
I used x in this example bcs i used another two dimensional array that works perfectly.

Edit: i think i understand, because of "Blue" it throws this error bcs the numbers has to be strings to work bcs they re not the same type, so i can make
PHP Code:
new color[][][] = {
        {
"Blue""0""0""255"},
        
// other 9 like this one above

And
PHP Code:
str_to_num(color[x][0]) 
?

Last edited by AnimalMonster; 12-10-2020 at 16:18. Reason: I think i solve myself the problem:)
AnimalMonster is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 12-10-2020 , 17:00   Re: Pre-Defined Multi-Dimensional Array
Reply With Quote #2

PHP Code:

new const g_COLOR[ ][ ][ ] = {
        {
"Blue", { 00255} },
        
// other 9 like this one above


new 
szColorName[16RGB_CODE[3];

RGB_CODE g_COLOR[0][1];
copy(szColorName15g_COLOR[0][0]); 
It should be an array as u can see this should work
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 12-10-2020 at 17:02.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
AnimalMonster
Senior Member
Join Date: May 2020
Old 12-10-2020 , 17:02   Re: Pre-Defined Multi-Dimensional Array
Reply With Quote #3

Quote:
Originally Posted by Natsheh View Post
PHP Code:

new const g_COLOR[ ][ ][ ] = {
        {
"Blue", { 00255} },
        
// other 9 like this one above


new 
szColorName[16RGB_CODE[3];

RGB_CODE g_COLOR[0][1];
copy(szColorName15g_COLOR[0][0]); 
True that it's easier this way but gotta test tommorow this
AnimalMonster is offline
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 08:11.


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