Getting the unknown command message with ZCMD
#1

Hello, there is this super weird thing that is happening to me, whenever I write the command /stats I will get the message "SERVER: UNKNOWN COMMAND".

All the other commands in the script works, and I have no idea why this particular command is not working. The includes I use are ZCMD, foreach, Dini and the sscanf2 plugin.

This is the command:
pawn Code:
CMD:stats(playerid, params[])
{
    new str[128], Float:Health, Float:Armour, PlayerDeaths;
    GetPlayerHealth(playerid, Health);
    GetPlayerArmour(playerid, Armour);
   
    if(Info[playerid][Deaths] == 0) PlayerDeaths = 1;
   
    format(str, 128, "{FFFF00}Health: {FFFFFF}%.2f\nArmour: %.2f\nKills: %d\nDeaths: %d\nKill/Death Ratio: %.2f\nCurrent Killstreak: %d", Health, Armour, Info[playerid][Kills], Info[playerid][Deaths], Info[playerid][Kills]/PlayerDeaths, Info[playerid][KillStreak]);
    ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, "{FFFF00}Stats", str, "Close", "");
    return 1;
}
And this is the error I get, I have no idea why:
Reply
#2

I think your problem is here: "Info[playerid][Kills]/PlayerDeaths". Check that out.
Reply
#3

Thank you, this was the problem. It worked before when I used SendClientMessage instead of the dialog, and my intention was to divide it to get the ratio.

Now I use Float:Info[playerid][Kills]/PlayerDeaths instead, thank you again!

EDIT: PENTS GET https://sampforum.blast.hk/showthread.php?pid=3099999#pid3099999
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)