/stats
#1

Код:
CMD:stats(playerid, params[])
{
	new string1[256], string2[256];
	format(string1, sizeof(string1), ""COL_WHITE"Name: %s (%d) | $%d | Score: %d\n", GetName(playerid), playerid, GetPlayerMoney(playerid), GetPlayerScore(playerid));
	format(string2, sizeof(string2), "Kills: %d | Deaths: %d | K/D Ratio: %.1f\n", pInfo[playerid][Kills], pInfo[playerid][Deaths], pInfo[playerid][Kills] / pInfo[playerid][Deaths]);
	strcat(string1, string2);
	format(string2, sizeof(string2), "Admin Level: %d | VIP Level: %d | Hours Played: %.2f", pInfo[playerid][AdminLevel], pInfo[playerid][VIPLevel], pInfo[playerid][HoursPlayed]);
	strcat(string1, string2);
	ShowPlayerDialog(playerid, d_stats, DIALOG_STYLE_MSGBOX, "Statistics", string1, "OK", "");
	return 1;
}
Returns 0 with me. d_stats is good.
Reply
#2

What is wrong here ?
Reply
#3

It returns 0 with me, which means "ERROR: command not found"
Reply
#4

That is probably a Runtime error 11: "Divide by zero" on pInfo[playerid][Kills] / pInfo[playerid][Deaths]

You can load crashdetect for more information about crashes and run time errors. If that is the cause of it, then change to:
pawn Код:
floatdiv(pInfo[playerid][Kills], pInfo[playerid][Deaths])
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)