03.07.2012, 08:58
Hi guys! I have some problems with my script! when i type /clans ... just first clan is showed in dialog and said Members: 0
Please help me! REP ++;
Please help me! REP ++;
pawn Код:
stock GetTotalMembers( clan[ ] )
{
new membersquery[ 256 ];
format( membersquery, 256, "SELECT `members` FROM `clans` WHERE `clanname` = '%s'", clan );
Result = db_query( Database, membersquery );
new rows = db_num_rows( Result );
db_free_result( Result );
return ( rows );
}
stock GetAllClans()
{
new clanquery[1024];
new minfo[1024];
format(clanquery, sizeof(clanquery), "SELECT `clanname` FROM `clans`");
Result = db_query( Database, clanquery );
for(new i;i<db_num_rows(Result);i++)
{
new string[30];
db_get_field_assoc(Result, "clanname", string, 30);
format(minfo,sizeof(minfo),"%s\n"W"ClanName: "G"%s\t"O"|\t"YE"Members: "G"%d" ,minfo, string, GetTotalMembers(string));
db_next_row(Result);
}
db_free_result(Result);
return minfo;
}