• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] String not showing ingame but printing fine
#2
I made some changes in your code. Try.

Code:
CMD:osts(playerid, params[])
{
? ? new accountname[24];

? ? if(sscanf(params, "s[24]", accountname))
? ? ? ? return SendClientMessage(playerid, COLOR_RED, "USAGE: /osts [account name]");

? ? new string[256];

? ? mysql_format(g_SQL, string, 128, "SELECT score,hours,minutes,money,kills,deaths, laston FROM `players` WHERE `username` = '%e' LIMIT 1",accountname);
? ? new Cache: result = mysql_query(g_SQL, string, true);
? ? new rows = cache_num_rows();

? ? if(rows)
? ? {
? ? ? ? new ohours, omins, oscore, obal, okills, odeaths, ologged[11];
? ? ? ?
? ? ? ? PlayerTextDrawShow(playerid, OStatsTD[playerid][0]);
? ? ? ? PlayerTextDrawShow(playerid, OStatsTD[playerid][1]);
? ? ? ? PlayerTextDrawShow(playerid, OStatsTD[playerid][3]);

? ? ? ? cache_get_value_name_int(0, "score", oscore);
? ? ? ? cache_get_value_name_int(0, "hours", ohours);
? ? ? ? cache_get_value_name_int(0, "minutes", omins);
? ? ? ? cache_get_value_name_int(0, "money", obal);
? ? ? ? cache_get_value_name_int(0, "kills", okills);
? ? ? ? cache_get_value_name_int(0, "deaths", odeaths);
? ? ? ? cache_get_value_name(0, "laston", ologged);
? ? ? ?
? ? ? ? format(string, sizeof(string), "~p~Username: ~w~%s~n~~p~Score: ~w~%d~n~~p~Kills:~w~ %d~n~~p~Deaths:~w~ %d~n~~p~Money:~w~ %d~n~~p~Last On:~w~ %s", accountname,oscore,okills,odeaths,obal, ologged);

? ? ? ? PlayerTextDrawSetString(playerid, OStatsTD[playerid][2], string);
? ? ? ? PlayerTextDrawShow(playerid, OStatsTD[playerid][2]);
? ? ? ? SetTimerEx("tdhide", 10000, false, "i", playerid);
? ? ?
? ? ? ? cache_delete(result);
? ? } else format(string, 128, "ERROR: %s isn't found in the database." ,accountname),
? ? SendClientMessage(playerid, COLOR_RED, string);
? ? return 1;
}
  Reply


Messages In This Thread
RE: String not showing ingame but printing fine - by Radical - 2021-04-19, 12:40 AM

Forum Jump: