Raised This Month: $32 Target: $400
 8% 

Solved Problem when reading strings


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 09-05-2018 , 11:49   Problem when reading strings
Reply With Quote #1

PHP Code:
enum _:DataInfo
{
    
STRING[ ][ ]
}

new 
g_iData33 ][ DataInfo ];

public Function( )
{
    
EXAMPLE_KEY VALUE_1VALUE_2VALUE_3

How would I parse all the values into STRING without hard-coding the count of values?
__________________

Last edited by edon1337; 09-05-2018 at 12:20.
edon1337 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 09-05-2018 , 11:57   Re: Problem when reading strings
Reply With Quote #2

Use dynamic arrays.
__________________
klippy is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 09-05-2018 , 11:59   Re: Problem when reading strings
Reply With Quote #3

I think I found what I needed.
PHP Code:
if (equal(key"WIN ZOMBIES"))
                {
                    
// Parse sounds
                    
while (value[0] != && strtok(valuekeycharsmax(key), valuecharsmax(value), ','))
                    {
                        
// Trim spaces
                        
trim(key)
                        
trim(value)
                        
                        
// Add to sounds array
                        
ArrayPushString(sound_win_zombieskey)
                    }
                } 
__________________

Last edited by edon1337; 09-05-2018 at 12:02.
edon1337 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 09-05-2018 , 13:54   Re: Problem when reading strings
Reply With Quote #4

Quote:
Originally Posted by KliPPy View Post
Use dynamic arrays.
Thats what you need.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 09-05-2018 , 16:08   Re: Problem when reading strings
Reply With Quote #5

Quote:
Originally Posted by Natsheh View Post
Thats what you need.
Why did you post this?
__________________
edon1337 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 09-06-2018 , 04:02   Re: Problem when reading strings
Reply With Quote #6

Quote:
Originally Posted by edon1337 View Post
Why did you post this?
Because KliPPy just provided you with the solution and you claiming that you found it.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 09-06-2018 , 05:49   Re: Problem when reading strings
Reply With Quote #7

Quote:
Originally Posted by Natsheh View Post
Because KliPPy just provided you with the solution and you claiming that you found it.
Makes no-sense. There was no need for you to re-quote what Klippy said. I already said I found what I needed.
__________________
edon1337 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 17:33.


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