SA-MP Forums Archive
I need minor help! - 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: I need minor help! (/showthread.php?tid=455298)



I need minor help! - itsCody - 01.08.2013

Today I am making my first IRC Command, and I'm getting warnings that I'm unsure of..

pawn Code:
IRCCMD:playerinfo(botid, channel[], user[], host[], params[])
{
    if(IRC_IsHalfop(botid, channel, user))
    {
       new string[128];
       new endid;
       if(sscanf(params, "u", endid))
       {
            format(string, sizeof(string),"USAGE: !playerinfo [Player ID]");
            Say(channel,string);
            return 1;
       }
       if(endid == INVALID_PLAYER_ID) endid = strval(params);
       if(!IsPlayerConnected(endid))
        {
            format(string, sizeof(string),"2ERROR: \2;%d\2; is not an active ID.", endid);
            Say(channel,string);
            return 1;
        }
        IRC_Notice(botid, user,"2PLAYER INFO:");
        IRC_Notice(botid, user,"2Name: %s",PlayerName(endid)); // This line
        IRC_Notice(botid, user,"2Score: %d",GetPlayerScore(endid)); // This line
        IRC_Notice(botid, user,"2Money: %d",GetPlayerMoney(endid)); // This line
    }
        return 1;
}
The warnings are:
warning 202: number of arguments does not match definition
warning 202: number of arguments does not match definition
warning 202: number of arguments does not match definition

I've marked where the warnings are coming from with "// This line"


Re: I need minor help! - wumpyc - 01.08.2013

I believe you will have to use format. Here's an example:
Code:
format(string,sizeof(string),"2Name: %s",PlayerName(endid));
IRC_Notice(botid,user,string);
And just repeat this with all lines


Re: I need minor help! - Aerotactics - 01.08.2013

too slow