My Stats Command Showing An Unknown Command -
ohmy - 24.12.2014
Hello
Why my stats command showing up an unknown command. here my code
pawn Code:
CMD:stats(playerid, params[])
{
new namajudul[100000];
new stats[100000];
GetPlayerName(playerid, namajudul, sizeof(namajudul));
format(namajudul, sizeof(namajudul), "Stats Player %s", namajudul);
format(stats, sizeof(stats), "Name: %s\nMoney: %d\nKills: %d\nDeath: %d\nScore: %d\nAdmin Level: %d\nV.I.P Level: %d\n\nDi Dalam PB: %d", User[playerid][USER_NAME], User[playerid][USER_MONEY], User[playerid][USER_KILLS], User[playerid][USER_DEATHS], User[playerid][USER_SCORE], User[playerid][USER_ADMIN], User[playerid][USER_VIP], User[playerid][USER_PB]);
ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, namajudul, stats, "OK", "");
return 1;
}
And My Enum
pawn Code:
enum USER_DATA
{
USER_ID,
USER_NAME[MAX_PLAYER_NAME],
USER_PASSWORD[129],
USER_ADMIN,
USER_VIP,
USER_MONEY,
USER_SCORE,
USER_KILLS,
USER_DEATHS,
USER_KD,
USER_PB,
USER_SKIN,
bool: USER_LOGGED_IN
};
new User[MAX_PLAYERS][USER_DATA];
It Compile without an error or warning, but when i type the command, it show an Unknown command
Re: My Stats Command Showing An Unknown Command -
M4D - 24.12.2014
pawn Code:
new namajudul[100000];
new stats[100000];
you created variables with VERY BIG size !!!
for namajudul you just need 24 !! because name character limite is 24 you don't need to make it with 100000 size !
you store player name in "USER_NAME[MAX_PLAYER_NAME]" variable so you don't need to get player name in command !
try:
pawn Code:
CMD:stats(playerid, params[])
{
new namajudul[40];
new stats[128];
format(namajudul, sizeof(namajudul), "Stats Player %s", User[playerid][USER_NAME]);
format(stats, sizeof(stats), "Name: %s\nMoney: %d\nKills: %d\nDeath: %d\nScore: %d\nAdmin Level: %d\nV.I.P Level: %d\n\nDi Dalam PB: %d", User[playerid][USER_NAME], User[playerid][USER_MONEY], User[playerid][USER_KILLS], User[playerid][USER_DEATHS], User[playerid][USER_SCORE], User[playerid][USER_ADMIN], User[playerid][USER_VIP], User[playerid][USER_PB]);
ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, namajudul, stats, "OK", "");
return 1;
}
Re: My Stats Command Showing An Unknown Command -
ohmy - 24.12.2014
Its worked now, thanks! rep+ for you