Getting the unknown command message with ZCMD - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Getting the unknown command message with ZCMD (
/showthread.php?tid=522749)
Getting the unknown command message with ZCMD -
[NWA]Hannes - 29.06.2014
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:
Respuesta: Getting the unknown command message with ZCMD -
SickAttack - 29.06.2014
I think your problem is here: "Info[playerid][Kills]/PlayerDeaths". Check that out.
Re: Getting the unknown command message with ZCMD -
[NWA]Hannes - 29.06.2014
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