Raised This Month: $ Target: $400
 0% 

[REQUEST]Reading from a multiple files


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 02-12-2013 , 16:09   Re: [REQUEST]Reading from a multiple files
Reply With Quote #6

( old read file native i know ... : P )

If you want to read from file ( addons/myidontknowwhat.txt ) example 2 things: mapname value


PHP Code:

// how many costom things to you want to be in param 2
#define d_costom 3

// param 2 from file
new const d_param2[d_costom][] = { "vipmenu""awp""and so on..." }

// Variable for readed param 2
// this goes that way
// if map is example de_dust and param 2 is awp then this variable hold 1
// vipmenu will hold 0
// awp will hold 1
// and so on... hold 2, if you add more this way the number will go, i hope you understand
new d_param2


// lets read a file

public plugin_init()
{
    new 
ab[32], line[128], c[64], d[64], e
    get_mapname
(b,29)
        
    for(
0!= -1a++) {
    
b[31] = read_file"addons/myidontknowwhat.txt"aline126b[30])
    if(!
b[31]) break
    if( !
line[0] || line[0] == ' ' || line[0] == '/' ) continue
    
parse(linec); trim(c); trim(d)
    if(
equal(c,b)) {
    for(
0d_costome++) {
    if(
equal(d,d_param2[e])) { d_param2 e; break }; }
}}}

// now what do you need to do is only check variable d_param2
// example

if ( d_param2 == )
{
    
// param2 from file was awp

.Dare Devil. is offline
 



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 20:30.


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