AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Read_file and Write_file code (https://forums.alliedmods.net/showthread.php?t=57821)

bumbastik 07-12-2007 09:19

Read_file and Write_file code
 
I need to read number from some cfg file.

For example I have %s/PlayerLOGs/plogs.cfg and in plogs.cfg first line contains number 5 (f.e) Number of lines - 1 line.

new plogspath[64]
get_configsdir( plogspath, 63 )
server_cmd("exec %s/PlayerLOGs/plogs.cfg", plogspath )

new filename[128]
new len
formatex(filename, 127, "%s/plogs.cfg", plogspath)
read_file(filename, 1, What I must write here, 63, And here)

_Master_ 07-12-2007 11:54

Re: Read_file and Write_file code
 
Read it like any other line then do a str_to_num()

bumbastik 07-12-2007 12:44

Re: Read_file and Write_file code
 
read_file(filename, 1, What I must write here, 63, And here)

Arkshine 07-12-2007 12:59

Re: Read_file and Write_file code
 
http://www.amxmodx.org/funcwiki.php?...file&go=search

bumbastik 07-13-2007 13:35

Re: Read_file and Write_file code
 
Muhhahahahah If you dint know I find it before ask!


All times are GMT -4. The time now is 21:28.

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