29.03.2014, 21:38
pawn Код:
public OnPlayerText(playerid, text[])
{
new string[256];
if(UsingAccent[playerid] == 1 && BeingCalled[playerid] == 0 && Calling[playerid] == 0)
{
format(string, sizeof(string), "%s says [%s Accent]: %s", GetNameEx(playerid), GetPlayerAccent(playerid), text);
ProxDetector(15.0, playerid, string, COLOUR_FADE1,COLOUR_FADE2,COLOUR_FADE3,COLOUR_FADE4,COLOUR_FADE5);
}
The reason for it being ridiculous is because of GetPlayerAccent, which is this:
pawn Код:
stock GetPlayerAccent(playerid)
{
new szQuery[300], result[50];
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(result, "Accent");
}
mysql_free_result();
return result;
}
How can I store the string locally without checking mysql everytime someone speaks, I know how ridiculous that is, I wrote that ages ago!!