AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   load from file ? (https://forums.alliedmods.net/showthread.php?t=294081)

killerZM 02-19-2017 09:49

load from file ?
 
i am trying to make vip plugin but i cant load anything from file
PHP Code:

static store_name[33] , store_pass[20] , block_f[33]
    
ArrayClear(dm_flags)
    
ArrayClear(dm_name)
    
ArrayClear(dm_pass)
    new 
f
    
    f 
fopen(files "rt")
    
    while(!
feof(f))
    {
            new 
info[300//, name[33] ,pass[20]
            
fgets(info 299)
            
            if(
info[0] == ';')
                continue
            
            if(
parse(info block_f,charsmax(block_f),store_name charsmax(store_name) , store_pass charsmax(store_pass)) !=3) continue
            
            
ArrayPushString(dm_name store_name)
            
ArrayPushString(dm_pass store_pass)
            
ArrayPushCell(dm_flags read_flags(block_f))
            
vips++
    }
    
fclose(f)    
    
server_print("[VIP] Loaded %i vips" vips )
    return 
1


is it right ??

killerZM 02-19-2017 11:16

Re: load from file ?
 
anyone

OciXCrom 02-19-2017 11:35

Re: load from file ?
 
Really? You bumped after 1 hour??? I won't help you because of that.

Natsheh 02-19-2017 13:15

Re: load from file ?
 
cant you just search?

killerZM 02-19-2017 13:31

Re: load from file ?
 
i searched tried everything no work

Natsheh 02-20-2017 00:54

Re: load from file ?
 
Try to check 2 things

First the array files outprint must be like this "addons/amxmodx/configs/filename.type"

Second no need to check add this
PHP Code:

            if(info[0] == ';' || strlen(info) < 5)
                continue 

And thirdly create the info array out of the loop...

OciXCrom 02-20-2017 07:01

Re: load from file ?
 
The least you can do is open a plugin that uses a file and see how it's done there instead of being lazy. The ones in my signature are all using files.

killerZM 02-20-2017 13:24

Re: load from file ?
 
Quote:

Originally Posted by Natsheh (Post 2496804)
Try to check 2 things

And thirdly create the info array out of the loop...

what you mean ?

oxc look at my last post

OciXCrom 02-20-2017 13:54

Re: load from file ?
 
There's nothing to see there except lazy excuses. If you tried EVERYTHING, you woulnd't have posted this thread.


All times are GMT -4. The time now is 20:45.

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