AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   parse a line (https://forums.alliedmods.net/showthread.php?t=173634)

gamer99 12-08-2011 09:17

parse a line
 
Hi ,

In one of my file it is like

name power level

Now I have put into one array.
So now I have taken the string from that array like

ArrayGetString(g_sNames,i,sBuffer,63)

So sBuffer = name power level

Now I need to put the name into one variable, power into another and level into another. Can anybody please help me on that?

drekes 12-08-2011 09:20

Re: parse a line
 
parse()

gamer99 12-08-2011 09:34

Re: parse a line
 
Code:

                parse(sBuffer,name,33,day,5,month,5,year,5)
                server_print("Name - %s, Day %s,Month %s, Year %s",name,day,month,year)

When I am trying this I am getting error like

array must be index

Any help?

drekes 12-08-2011 11:37

Re: parse a line
 
How did you declare your variables ?

fysiks 12-08-2011 16:20

Re: parse a line
 
Just remember that the name cannot have any spaces or other characters that make parse() think the argumenet has ended. If it has any of these characters you need to put the entry in quotes.

gamer99 12-09-2011 04:32

Re: parse a line
 
Solved :oops:

Thanks drekes and fysiks


All times are GMT -4. The time now is 11:57.

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