Raised This Month: $12 Target: $400
 3% 

load from file ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
killerZM
Senior Member
Join Date: Sep 2016
Old 02-19-2017 , 09:49   load from file ?
Reply With Quote #1

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 ??

Last edited by killerZM; 02-19-2017 at 10:45.
killerZM is offline
killerZM
Senior Member
Join Date: Sep 2016
Old 02-19-2017 , 11:16   Re: load from file ?
Reply With Quote #2

anyone
killerZM is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-19-2017 , 11:35   Re: load from file ?
Reply With Quote #3

Really? You bumped after 1 hour??? I won't help you because of that.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Natsheh
Veteran Member
Join Date: Sep 2012
Old 02-19-2017 , 13:15   Re: load from file ?
Reply With Quote #4

cant you just search?
__________________
@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
killerZM
Senior Member
Join Date: Sep 2016
Old 02-19-2017 , 13:31   Re: load from file ?
Reply With Quote #5

i searched tried everything no work
killerZM is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 02-20-2017 , 00:54   Re: load from file ?
Reply With Quote #6

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...
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 02-20-2017 at 00:56.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-20-2017 , 07:01   Re: load from file ?
Reply With Quote #7

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.
__________________

Last edited by OciXCrom; 02-20-2017 at 07:01.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
killerZM
Senior Member
Join Date: Sep 2016
Old 02-20-2017 , 13:24   Re: load from file ?
Reply With Quote #8

Quote:
Originally Posted by Natsheh View Post
Try to check 2 things

And thirdly create the info array out of the loop...
what you mean ?

oxc look at my last post
killerZM is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-20-2017 , 13:54   Re: load from file ?
Reply With Quote #9

There's nothing to see there except lazy excuses. If you tried EVERYTHING, you woulnd't have posted this thread.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Reply


Thread Tools
Display Modes

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 08:19.


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