number of arguments does not match definition
#1

can you help me ?

PHP код:
public Loadrumah() {
    new 
num_rows,num_fields;
    
cache_get_data(num_rows,num_fields);
    if(
num_rows)
    {
        for(new 
r=0cache_get_row_count(); r++)
        {
            
RumahInfo[r][rumahID] = cache_get_row_int (r0); 
            
RumahInfo[r][pemilik] = cache_get_row    (,1);
        }
    }
    return 
1;

Код:
D:\data aji\Samp server\gamemodes\percobaan.pwn(135) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Line 135 RumahInfo[r][pemilik] = cache_get_row (r ,1);
Reply
#2

Код:
cache_get_row(row, field_idx, destination[], connectionHandle = 1, max_len = sizeof(destination))
Your missing the destination

If the other line is a int you need you can just go

Код:
public Loadrumah() { 
    new num_rows,num_fields; 
    cache_get_data(num_rows,num_fields); 
    if(num_rows) 
    { 
        for(new r=0; r < cache_get_row_count(); r++) 
        { 
            RumahInfo[r][rumahID] = cache_get_row_int (r, 0);  
            RumahInfo[r][pemilik] = cache_get_row_int    (r ,1); 
        } 
    } 
    return 1; 
}
Reply
#3

Quote:
Originally Posted by JessThompson
Посмотреть сообщение
Код:
cache_get_row(row, field_idx, destination[], connectionHandle = 1, max_len = sizeof(destination))
Your missing the destination

If the other line is a int you need you can just go

Код:
public Loadrumah() { 
    new num_rows,num_fields; 
    cache_get_data(num_rows,num_fields); 
    if(num_rows) 
    { 
        for(new r=0; r < cache_get_row_count(); r++) 
        { 
            RumahInfo[r][rumahID] = cache_get_row_int (r, 0);  
            RumahInfo[r][pemilik] = cache_get_row_int    (r ,1); 
        } 
    } 
    return 1; 
}
sorry im newbie what is destination[] ?
Reply
#4

Try this code this should compile okay

Код:
public Loadrumah() { 
    new num_rows,num_fields; 
    cache_get_data(num_rows,num_fields); 
    if(num_rows) 
    { 
        for(new r=0; r < cache_get_row_count(); r++) 
        { 
            RumahInfo[r][rumahID] = cache_get_row_int (r, 0);  
            cache_get_row(r, 1, RumahInfo[r][pemilik]);
        } 
    } 
    return 1; 
}
Explanation:

[number of arguments does not match definition] This error means there is too many or too less arguments to the function within that line. So for example

You used

Код:
cache_get_row(row, field_idx, destination[], connectionHandle = 1, max_len = sizeof(destination))
that requires 3 arguments you only provided 2
Код:
RumahInfo[r][pemilik] = cache_get_row_int    (r ,1);
I recoded it to the correct definition of that function

Код:
cache_get_row(r, 1, RumahInfo[r][pemilik]);
Reply
#5

What is this variable?:
Код:
RumahInfo[r][pemilik]
If it's an int, you have to change the line 135 to:
Код:
RumahInfo[r][pemilik] = cache_get_row_int(r ,1);
If it's a string you have to change the line 135 to:
Код:
cache_get_row(r, 1, RumahInfo[r][pemilik]);
Look at this documentation (MySQL R33): https://sampwiki.blast.hk/wiki/MySQL/R33#cache_get_row

@Edit
Jess was faster
Reply
#6

Quote:
Originally Posted by renatog
Посмотреть сообщение
What is this variable?:
Код:
RumahInfo[r][pemilik]
If it's an int, you have to change the line 135 to:
Код:
RumahInfo[r][pemilik] = cache_get_row_int(r ,1);
If it's a string you have to change the line 135 to:
Код:
cache_get_row(r, 1, RumahInfo[r][pemilik]);
Look at this documentation (MySQL R33): https://sampwiki.blast.hk/wiki/MySQL/R33#cache_get_row

@Edit
Jess was faster
ITS WORK THANKS
Reply
#7

No problem ;P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)