Problem with dynamic faction system - 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: Problem with dynamic faction system (
/showthread.php?tid=473386)
Problem with dynamic faction system -
AA9 - 02.11.2013
Okay, so i started making dynamical faction system with MySQL. Everything works perfect except displaying faction under /stats.
Here is LoadFactions function
pawn Код:
stock LoadFactions()
{
for(new i = 1; i < MAX_FACTIONS; i++)
{
new query[600], savingstring[32];
format(query, sizeof(query), "SELECT * FROM factions WHERE ID = %i", i);
mysql_query(query);
mysql_store_result();
while(mysql_fetch_row_format(query, "|"))
{
mysql_fetch_field_row(savingstring, "ID");fInfo[i][frID] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Name");fInfo[i][Name] = savingstring;
mysql_fetch_field_row(savingstring, "Rank1");fInfo[i][Rank1] = savingstring;
mysql_fetch_field_row(savingstring, "Rank2");fInfo[i][Rank2] = savingstring;
mysql_fetch_field_row(savingstring, "Rank3"); fInfo[i][Rank3] = savingstring;
mysql_fetch_field_row(savingstring, "Rank4"); fInfo[i][Rank4] = savingstring;
mysql_fetch_field_row(savingstring, "Rank5"); fInfo[i][Rank5] = savingstring;
}
mysql_free_result();
new FName[32]; format(FName, 32, "%s", fInfo[i][Name]);
strreplace(FName, '_', ' ');
printf("Fraktsioon ID %i laetud; Nimi: %s", i, fInfo[i][Name]);
}
}
pawn Код:
new grupeering;
if(PlayerInfo[playerid][pMember] == 1) { grupeering = fInfo[1][Name];}
But when it displays on /stats, then result is -
https://www.upload.ee/image/3681115/Untitled.png
Iґve tried to make this many different ways, but result is always same. Some chinese symbols. I apperciate, when someone can help me.
Re: Problem with dynamic faction system -
bensmart469 - 02.11.2013
Make grupeering a string, e.g.
new grupeering[16];
You're using an integer for it right now.
Re: Problem with dynamic faction system -
AA9 - 02.11.2013
I tried that before, but i received a warning.
//E: I tried that IG and it didnґt work.
I try to use strcat function, im going to test
THANKS MAN, fixed.
pawn Код:
warning 229: index tag mismatch (symbol "fInfo")