SA-MP Forums Archive
SERVER: UNKNOWN COMMAND - 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: SERVER: UNKNOWN COMMAND (/showthread.php?tid=307044)



SERVER: UNKNOWN COMMAND - iTorran - 28.12.2011

pawn Код:
CMD:stats(playerid, params[])
{
    if(GetPVarInt(playerid, "Logged") == 1)
    {
        new kills = GetPVarInt(playerid, "Kills"), deaths = GetPVarInt(playerid, "Deaths");
        format(string, sizeof string, "{00CFCF}Username: {FFFFFF}%s\n\n{00CFCF}Money: {FFFFFF}%i\n{00CFCF}Score: {FFFFFF}%i\n\n{00CFCF}Kills: {FFFFFF}%i\n{00CFCF}Deaths: {FFFFFF}%i\n{00CFCF}Ratio: {FFFFFF}%02f",
        GetName(playerid), GetPlayerMoney(playerid), GetPlayerScore(playerid), GetPVarInt(playerid, "Kills"), GetPVarInt(playerid, "Deaths"), ((kills) / (deaths)));
        ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX, "Statistics", string, "Send", "Close");
    }
    return 1;
}
Says UNKNOWN COMMAND ingame.
If i comment out either the ratio or string it will work.


Re: SERVER: UNKNOWN COMMAND - park4bmx - 28.12.2011

Try to return 1 before the if statement but leave that one as it is
Also u can remove the Params since ur not using it
If that doesn't work then I would say but the kills & deaths into separate lines !


Re: SERVER: UNKNOWN COMMAND - [ABK]Antonio - 28.12.2011

try kills/deaths instead of ((kills) / (deaths))


Re: SERVER: UNKNOWN COMMAND - iTorran - 29.12.2011

Still unknown command, ratio is the cause.


Re: SERVER: UNKNOWN COMMAND - Seven_of_Nine - 29.12.2011

Look for codes that are before the command and have [minor] mistakes.
I had a public function before one of my commands and it didn't work because I screwed the function up.


Re: SERVER: UNKNOWN COMMAND - FTLOG - 29.12.2011

I think that the string is too big for dialog - Try to put just one \n for each new line.


Re: SERVER: UNKNOWN COMMAND - iTorran - 29.12.2011

It is the ratio that is causing it not to work.
I have tried printing the ratio etc, none of it works.


Re: SERVER: UNKNOWN COMMAND - Stigg - 29.12.2011

How are you defining the ratio ?

Eg:
pawn Код:
new Float:ratio = floatdiv(your kills variable),(your deaths variable);
Outputs kills and death ratio %.2f


Re: SERVER: UNKNOWN COMMAND - iTorran - 29.12.2011

Dosent work