AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Can someone help with read_file (https://forums.alliedmods.net/showthread.php?t=146848)

sibox 01-02-2011 02:37

Can someone help with read_file
 
How can i read line by line file and if the file has // on the line to not show this line and go to next

Exolent[jNr] 01-02-2011 02:40

Re: Can someone help with read_file
 
https://forums.alliedmods.net/showthread.php?t=46218

To check if the data from a line contains "//", there are 3 ways you can check:
Code:
if(szData[0] == '/' && szData[1] == '/') if(equal(szData, "//", 2)) if(contain(szData, "//") == 0)

I advise you to use the first one because it does not require a native call.

sibox 01-02-2011 02:42

Re: Can someone help with read_file
 
Thank you, sir :) but i'm trying to use this for
Code:
public ReadKey(szLine[]) {     new szBuffer[32];     new b = 0;     read_file(g_Buttons, szLine, szBuffer, 31, b) }

Exolent[jNr] 01-02-2011 02:43

Re: Can someone help with read_file
 
The line must be an integer, not a string.

sibox 01-02-2011 02:44

Re: Can someone help with read_file
 
how can i set it to integer str_to_num ?

Exolent[jNr] 01-02-2011 02:45

Re: Can someone help with read_file
 
Yes.

sibox 01-02-2011 02:48

Re: Can someone help with read_file
 
Code:
public ReadKey(szLine[]) {     str_to_num(szLine);     new szBuffer[32];     new b = 0;     read_file(g_Buttons, szLine, szBuffer, 31, b) }
and again not working. Error: Argument type mismatch (argument 2) on line 41

sibox 01-02-2011 02:50

Re: Can someone help with read_file
 
I fix it thank you very much exo :) and one more question how can i get the maxlines in the file?


All times are GMT -4. The time now is 02:08.

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