Raised This Month: $ Target: $400
 0% 

new ban


Post New Thread Reply   
 
Thread Tools Display Modes
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-24-2010 , 18:14   Re: new ban
Reply With Quote #11

Quote:
Originally Posted by Nyuszy View Post
ok ,but i again get "S10 10 0"
Show the code that you use for parsing and for printing the info after the parse().
__________________
fysiks is offline
Nyuszy
Senior Member
Join Date: Apr 2009
Old 08-24-2010 , 18:22   Re: new ban
Reply With Quote #12

PHP Code:
public plugin_cfg()
{
    new 
0
    
new len
    
new line[100]
    
    while(
file_size(banfile1))
    {
        
read_file(banfileiline[i], 50len)
        if(
len 0)
        {
            
parse(line[i], bans[i][0], 32bans[i][1], 32bans[i][2], 32)
            
server_print("%s %s %s"bans[i][0], bans[i][1], bans[i][2])
        }
        
i++
    }
    
    return 
PLUGIN_HANDLED

Nyuszy is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-24-2010 , 18:26   Re: new ban
Reply With Quote #13

It's because you are indexing "line". It should not be indexed at all, it is a string.

If line = "hello" then:

Code:
line[0] = 'h'
line[1] = 'e'
line[2] = 'l'
line[3] = 'l'
line[4] = '0'
line[5] = '^0'

How is "bans" defined? I forgot you posted the code lol. You need to define bans as
new bans[MAXBANS][3][MAX_STR_LENGTH+1]

This is for non-Steam?
__________________

Last edited by fysiks; 08-24-2010 at 18:35.
fysiks is offline
Nyuszy
Senior Member
Join Date: Apr 2009
Old 08-24-2010 , 18:35   Re: new ban
Reply With Quote #14

the new code:

PHP Code:
public plugin_cfg()
{
    new 
0
    
new len
    
new line[100]
    
    while(
file_size(banfile1))
    {
        
read_file(banfileiline50len)
        if(
len 0)
        {
            
parse(linebans[i][0], 32bans[i][1], 32bans[i][2], 32)
            
server_print("%s %s %s"bans[i][0], bans[i][1], bans[i][2])
        }
        
i++
    }
    
    return 
PLUGIN_HANDLED

and again: S10 10 0
Nyuszy is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-24-2010 , 18:36   Re: new ban
Reply With Quote #15

Quote:
Originally Posted by fysiks View Post
It's because you are indexing "line". It should not be indexed at all, it is a string.

If line = "hello" then:

Code:
line[0] = 'h'
line[1] = 'e'
line[2] = 'l'
line[3] = 'l'
line[4] = '0'
line[5] = '^0'

How is "bans" defined? I forgot you posted the code lol. You need to define bans as
new bans[MAXBANS][3][MAX_STR_LENGTH+1]

This is for non-Steam?
Sorry, I edited while you were not looking.
__________________
fysiks is offline
Nyuszy
Senior Member
Join Date: Apr 2009
Old 08-25-2010 , 01:37   Re: new ban
Reply With Quote #16

Quote:
Originally Posted by fysiks View Post
new bans[MAXBANS][3][MAX_STR_LENGTH+1]
PHP Code:
new bans[MAXBANS][3][100
compiler:

new_ban.sma(88 -- 89) : error 033: array must be indexed (variable "bans")
new_ban.sma(99 -- 100) : error 033: array must be indexed (variable "bans")
new_ban.sma(165) : error 033: array must be indexed (variable "bans")
PHP Code:
if(bans[i][2] == 0
new_ban.sma(170) : error 033: array must be indexed (variable "bans")
PHP Code:
if(bans[i][2] * 60 get_systime()) 
new_ban.sma(186) : error 033: array must be indexed (variable "bans")
new_ban.sma(191) : error 033: array must be indexed (variable "bans")
Nyuszy is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-25-2010 , 01:39   Re: new ban
Reply With Quote #17

That's because you can't compare a string to an integer.
__________________
fysiks is offline
Nyuszy
Senior Member
Join Date: Apr 2009
Old 08-26-2010 , 08:07   Re: new ban
Reply With Quote #18

thanks for help, the plugin now works perfect
Nyuszy is offline
Reply



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 11:33.


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