SA-MP Forums Archive
Getting errors when trying to edit clan ranks on dialog - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Getting errors when trying to edit clan ranks on dialog (/showthread.php?tid=660050)



Getting errors when trying to edit clan ranks on dialog - solstice_ - 23.10.2018

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 



Re: Getting errors when trying to edit clan ranks on dialog - Undef1ned - 23.10.2018

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



Re: Getting errors when trying to edit clan ranks on dialog - solstice_ - 23.10.2018

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

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


Re: Getting errors when trying to edit clan ranks on dialog - ReD_HunTeR - 23.10.2018

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


Re: Getting errors when trying to edit clan ranks on dialog - v1k1nG - 23.10.2018

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


Re: Getting errors when trying to edit clan ranks on dialog - KinderClans - 23.10.2018

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);



Re: Getting errors when trying to edit clan ranks on dialog - v1k1nG - 23.10.2018

intendi
PHP код:
#define MAX_RANK_NAME 15 



Re: Getting errors when trying to edit clan ranks on dialog - solstice_ - 23.10.2018

Thank you guys

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



Re: Getting errors when trying to edit clan ranks on dialog - v1k1nG - 23.10.2018

No worries mate