Getting errors when trying to edit clan ranks on dialog
#1

So, I'm getting an error when I'm trying to compile my script.. Here's the code:

pawn Код:
Dialog:DIALOG_RANK1EDIT(playerid, response, listitem, inputtext[])
{
    if(response)
    {
        new clanid = UserStats[playerid][Clan];
        new query[100];
        mysql_format(Database, query, sizeof(query), "UPDATE `clans` SET `Rank1` = '%e'", inputtext);
        mysql_tquery(Database, query);
        ClanInfo[clanid][Rank1] = inputtext;
    }
    return 1;
}
Line:

PHP код:
ClanInfo[clanid][Rank1] = inputtext
Error:
PHP код:
error 047: array sizes do not match, or destination array is too small 
Reply
#2

PHP код:
format(ClanInfo[clanid][Rank1], 15"%s"inputtext); 
Reply
#3

Quote:
Originally Posted by Undef1ned
Посмотреть сообщение
PHP код:
format(ClanInfo[clanid][Rank1], 15"%s"inputtext); 
Will that work the same as

PHP код:
ClanInfo[clanid][Rank1] = inputtext
?
Reply
#4

Quote:
Originally Posted by willbedie
Посмотреть сообщение
Will that work the same as

PHP код:
ClanInfo[clanid][Rank1] = inputtext
?
Yes, change "15" to maximum rank name you can have
Reply
#5

Hey will
ClanInfo[clanid][Rank1] = inputtext;

I had a problem similar to yours. I used format instead of making it equal and it worked.
But in my case I wasn't getting any compiling errors!
So yeah, use format I guess
Reply
#6

Or if he has a define like:

pawn Код:
#define MAX_RANK_NAME 15
He can just do:

pawn Код:
format(ClanInfo[clanid][Rank1], sizeof(MAX_RANK_NAME), "%s", inputtext);
Reply
#7

intendi
PHP код:
#define MAX_RANK_NAME 15 
Reply
#8

Thank you guys

Код:
You have given out too much Reputation in the last 24 hours, try again later.
Reply
#9

No worries mate
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)