Annoying Warnings with DCMD
#1

Код:
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.
Reply
#2

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
Reply
#3

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

Help has 4 characters.

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

Код:
 #pragma unused params
Reply
#5

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

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

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

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

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

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
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)