Commands not working for no reason?
#1

Код:
CMD:stats(playerid, params[])
{
	new target;
	if(sscanf(params, "u", target))
	{
  		target = playerid;
		Server(playerid, "You can also use /stats [playerid]");
	}
	if(!IsPlayerConnected(target)) return Error(playerid, "Player is not connected.");
	if(User[target][loggedin] == 0) return Error(playerid, "Player is not logged in.");
    GetPlayerConnectedTime(target, User[target][ohours], User[target][ominutes], User[target][oseconds]);

	new
		DIALOG[1000],
		string[312],
		data[2][48],
		yes[4] = "Yes",
		no[3] = "No",
		Float:ratio
	;

	new handle = SQL::OpenEx(SQL::READ, ""PLAYERS_TABLE"", "username", GetName(target));
 	SQL::ReadString(handle, "joined", data[1], 48);
 	SQL::Close(handle);

	format(string, sizeof(string), ""purple"NRG Stats for %s's (ID:%i):\n\n", GetName(target), target);
	strcat(DIALOG, string);

    strcat(DIALOG, ""lightred"Main Statistics:\n");

	format(string, sizeof(string), ""white"•"lightblue"Account ID: "green"%i\n", User[target][id]);
	strcat(DIALOG, string);
	
	format(string, sizeof(string), ""white"•"lightblue"Registered date: "green"%s\n", data[1]);
	strcat(DIALOG, string);

	format(string, sizeof(string), ""white"•"lightblue"Online Time: "green"%02i hours %02i minutes %02i seconds\n", User[target][ohours], User[target][ominutes], User[target][oseconds]);
	strcat(DIALOG, string);

	format(string, sizeof(string), ""white"•"lightblue"Kills: "green"%i\n", User[target][kills]);
	strcat(DIALOG, string);

	format(string, sizeof(string), ""white"•"lightblue"Deaths: "green"%i\n", User[target][deaths]);
	strcat(DIALOG, string);

	if(User[target][deaths] <= 0) ratio = 0.0;
	else ratio = floatdiv(User[target][kills], User[target][deaths]);
	format(string, sizeof(string), ""white"•"lightblue"K/D Ratio: "green"%0.2f\n", ratio);
	strcat(DIALOG, string);

	format(string, sizeof(string), ""white"•"lightblue"Score: "green"%i\n", GetPlayerScore(target));
	strcat(DIALOG, string);
	
	format(string, sizeof(string), ""white"•"lightblue"Money: "green"$%i\n", GetPlayerMoney(target));
	strcat(DIALOG, string);
	
	format(string, sizeof(string), ""white"•"lightblue"Cookies: "green"%i\n\n", User[target][cookies]);
	strcat(DIALOG, string);

    strcat(DIALOG, ""lightred"Event Statistics:\n");
	
	format(string, sizeof(string), ""white"•"lightblue"Math Wins: "green"%i\n", User[target][maths]);
	strcat(DIALOG, string);
	
	format(string, sizeof(string), ""white"•"lightblue"Moneybag Founds: "green"%i\n", User[target][mbfound]);
	strcat(DIALOG, string);
	
	format(string, sizeof(string), ""white"•"lightblue"ReactionContest Wins: "green"%i\n\n", User[target][reactions]);
	strcat(DIALOG, string);
	
	strcat(DIALOG, ""lightred"Other Statistics:\n");

	format(string, sizeof(string), ""white"•"lightblue"Wanteds: "green"%i\n", User[target][wanteds]);
	strcat(DIALOG, string);

	format(string, sizeof(string), ""white"•"lightblue"Admin Level: "green"%i\n", User[target][level]);
	strcat(DIALOG, string);

	format(string, sizeof(string), ""white"•"lightblue"VIP Level: "green"%i\n", User[target][vip]);
	strcat(DIALOG, string);

	format(string, sizeof(string), ""white"•"lightblue"Trusted Player: "green"%s\n", ((IsPlayerTrusted(target)) ? yes : no));
	strcat(DIALOG, string);


	format(string, sizeof(string), ""white"•"lightblue"Jailed: "green"%s\n", ((IsPlayerJailed(target)) ? yes : no));
	strcat(DIALOG, string);

	format(string, sizeof(string), ""white"•"lightblue"Muted: "green"%s\n", ((IsPlayerMuted(target)) ? yes : no));
	strcat(DIALOG, string);

	format(string, sizeof(string), ""white"•"lightblue"Command Muted: "green"%s\n", ((IsPlayerCMDMuted(target)) ? yes : no));
	strcat(DIALOG, string);

	format(string, sizeof(string), ""white"•"lightblue"Warnings: "green"%i/%i\n", User[target][warns], MAX_WARNS);
	strcat(DIALOG, string);

	Dialog_Show(playerid, dialogUnused, DIALOG_STYLE_MSGBOX, "NRG Statistics", DIALOG, "Close", "");
	return 1;
}
for some reason whenever i type /stats it shows

< if this is not working then http://imgur.com/a/rYrZ4
Reply


Messages In This Thread
Commands not working for no reason? - by donhu789 - 03.09.2016, 13:13
Re: Commands not working for no reason? - by donhu789 - 03.09.2016, 13:23
Re: Commands not working for no reason? - by TORKQ - 03.09.2016, 13:24
Re: Commands not working for no reason? - by BlackbirdXd - 03.09.2016, 13:43
Re: Commands not working for no reason? - by SyS - 03.09.2016, 13:45
Re: Commands not working for no reason? - by jlalt - 03.09.2016, 13:56
Re: Commands not working for no reason? - by donhu789 - 03.09.2016, 14:20
Re: Commands not working for no reason? - by SyS - 03.09.2016, 14:22
Re: Commands not working for no reason? - by BlackbirdXd - 03.09.2016, 15:13
Re: Commands not working for no reason? - by jlalt - 03.09.2016, 17:33

Forum Jump:


Users browsing this thread: 2 Guest(s)