29.03.2014, 22:54
You can load the accent in to a string array instead, once the player has logged in or connected.
Variable declaration:
Setting the player's accent value:
Getting the player's accent (in context):
So ultimately, based on the code you've shown us, this code can be added and called when the player logs in: (and should work)
Variable declaration:
pawn Код:
new g_szPlayerAccent[MAX_PLAYERS][32];
pawn Код:
strcat(g_szPlayerAccent[playerid], "Accent", 32); // Replace "Accent" with the string or accent text once the player connects
pawn Код:
format(szMessage, sizeof(szMessage), "(%s accent) %s says: %s", g_szPlayerAccent[playerid], szPlayerName, szText);
pawn Код:
stock LoadPlayerAccent(playerid) {
new
szResult[32],
szQuery[64];
format(szQuery, sizeof(szQuery), "SELECT `Accent` FROM `accounts` WHERE `id` = %d", PlayerSQLID[playerid]);
mysql_query(szQuery);
mysql_store_result();
while(mysql_retrieve_row()) {
mysql_fetch_field_row(szResult, "Accent");
}
mysql_free_result();
strcat(g_szPlayerAccent[playerid], szResult, 32);
return 1;
}