Warning 202.
#1

I'm getting this warning when I try and make an IRC setscore command (I made the standard ingame one fine)
C:\Users\TrueCoppa\pawno\SFCRRPG.pwn(1347 : warning 202: number of arguments does not match definition

pawn Код:
SendClientMessage(setid,COLOR_ADMIN,"[SCORE SET] Your score has been set to %d by an administrator.",score);
Is the line in question
Reply
#2

you need use a string for a text no const
try this
pawn Код:
new string[256];
format(string,sizeof(string),"[SCORE SET] Your score has been set to %d by an administrator.",score);
SendClientMessage(setid,COLOR_ADMIN,string);
Reply
#3

Quote:
Originally Posted by mineralo
Посмотреть сообщение
you need use a string for a text no const
try this
pawn Код:
new string[256];
format(string,sizeof(string),"[SCORE SET] Your score has been set to %d by an administrator.",score);
SendClientMessage(setid,COLOR_ADMIN,string);
Of course!
Thanks for the help.
Reply
#4

Its only a Warning It doesnt Really Matters
Reply
#5

Ahah but now I have another issue. The script compiles fine but
06:56:21] <~[TT]TrueCoppa> !setscore 1 1
[06:56:22] <&TTCNR2> 2ERROR: 48 is not an active ID.
[06:56:25] <~[TT]TrueCoppa> wat
[06:56:33] <~[TT]TrueCoppa> !setscore 0 1
[06:56:34] <&TTCNR1> 2ERROR: 48 is not an active ID.
No matter what I do it just does ID 48.

pawn Код:
IRCCMD:setscore(botid, channel[], user[], host[], params[])
{
    if (IRC_IsOp(botid, channel, user))
    {
        new setid;
        new score;
        new string[128];
        if(sscanf(params, "us[100]", setid, score))
        {
            format(string, sizeof(string), "USAGE: !setscore (ID) (Score)");
            Say(channel,string);
            return 1;
        }
        if(!IsPlayerConnected(setid))
        {
            format(string, sizeof(string), "2ERROR: \2;%d\2; is not an active ID.", setid);
            Say(channel,string);
            return 1;
        }
        format(string, sizeof(string), "You have successfully set %s(%d)'s score to %s",PlayerName(setid),setid,score);
        Say(channel,string);
        SetPlayerScore(setid,score);
        dUserSetINT(PlayerName(setid)).("Score", score);
        format(string, sizeof(string), "[SCORE SET] Your score has been set to %d by an administrator.",score);
        SendClientMessage(setid,COLOR_ADMIN,string);
        return 1;
    }
    return 1;
}
Reply
#6

Quote:
Originally Posted by Mario™
Посмотреть сообщение
Its only a Warning It doesnt Really Matters




Do you have the latest sscanf version?
Reply
#7

Quote:
Originally Posted by MP2
Посмотреть сообщение




Do you have the latest sscanf version?
Yes I do
Reply
#8

Shouldn't it be "ui"? Score isn't a string.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)