SA-MP Forums Archive
Annoying Warnings with DCMD - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Annoying Warnings with DCMD (/showthread.php?tid=200315)



[Unsovled] Annoying Warnings with DCMD - Sledge - 18.12.2010

Код:
dcmd_help(playerid, params[])
There is my code.
Under OnPlayerCommandText
Код:
dcmd(help,0,cmdtext);
This is the warning I get when I compile.
Код:
warning 203: symbol is never used: "params"

This is my DCMD:
Код:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

I hate warnings, and I know what they are. Just help me fix them. I got like 10 of them because of this.


Re: Annoying Warnings with DCMD - Gustavob - 18.12.2010

put this under dcmd_help(playerid, params[]):

pawn Код:
#pragma unused params
+ dcmd(help, 0, cmdtext)
that 0 should be 4:

Код:
h  e  l  p
1  2  3  4



Re: Annoying Warnings with DCMD - Sledge - 18.12.2010

oooooooooo okay i see, so the numbers are how many characters are in the word? okay, thanks man


Re: Annoying Warnings with DCMD - Lorenc_ - 18.12.2010

Help has 4 characters.

Код:
dcmd(help,4,cmdtext);
and use

Код:
 #pragma unused params



Re: Annoying Warnings with DCMD - Sledge - 18.12.2010

#pragma unused params
doesn't work ^^
it says params is an unidentified symbol. i put it right below the DCMD function define.


Re: Annoying Warnings with DCMD - Gustavob - 18.12.2010

Dont put it under the define, do it like this:

pawn Код:
dcmd_help(playerid, params[])
{
    #pragma unused params
    //etc
}



Re: Annoying Warnings with DCMD - Sledge - 18.12.2010

Well, that's lame. Now I have to do that to all of my commands? isn't there a better way?


Re: Annoying Warnings with DCMD - Gustavob - 18.12.2010

do that only in commands where you dont use parameters, like /healall or /help, but theres no other easier way to do it IIRC


Re: Annoying Warnings with DCMD - Sledge - 18.12.2010

now im getting these errors:
pawn Код:
dcmd_help(playerid, params[])
{
    #pragma unused params[]
    if(IsPlayerConnected(playerid))
    {
        SendClientMessage(playerid, COLOR_RED, "|_______________________________________________|");
        SendClientMessage(playerid, COLOR_LIGHTGREEN, "'Blacks Ops - The Final Fight' is a TDM server. You must kill the other teams to rank up.");
        SendClientMessage(playerid, COLOR_LIGHTGREEN, "The script was made by xKNiiVeS. It uses DCMD, and professional efficient methods to echant your game");
        SendClientMessage(playerid, COLOR_LIGHTGREEN, "Our forum URL is: ");
        SendClientMessage(playerid, COLOR_LIGHTGREEN, "Commands:: /cmds - /ranks - /stats - /forum");
        SendClientMessage(playerid, COLOR_RED, "|___________________________________________________________|");
    }
    return 1;
}
look at the blue text^^ it gives me this error:
error 038: extra characters on line


Re: Annoying Warnings with DCMD - Gustavob - 18.12.2010

Код:
#pragma unused params[] //<-- [] = bad
#pragma unused params //<-- no [] = good
i.e. dont use [] in #pragma unused params