How to store strings? Player Accent...
#1

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);
    }
I just realised I'm using this ridiculous system.

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!!
Reply


Messages In This Thread
How to store strings? Player Accent... - by Dokins - 29.03.2014, 21:38
Re: How to store strings? Player Accent... - by Matess - 29.03.2014, 22:49
Re: How to store strings? Player Accent... - by Calgon - 29.03.2014, 22:54
Re: How to store strings? Player Accent... - by Konstantinos - 29.03.2014, 22:54
Re: How to store strings? Player Accent... - by Pottus - 29.03.2014, 23:44
Re: How to store strings? Player Accent... - by Dokins - 30.03.2014, 00:15

Forum Jump:


Users browsing this thread: 2 Guest(s)