A Warning
#1

Why do i got this warning ?
Код:
E:\NERP\NERP.pwn(72983) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
here is the define
pawn Код:
(72982) : new string[128], giveplayerid;
and the line
pawn Код:
(72983) : if(sscanf(params, "i", giveplayerid)) return Syntax(playerid,"greet", "[playerid]");
and the whole command
pawn Код:
CMD:greet(playerid, params[])
{
    if(IsACop(playerid))
    {
        new string[128], giveplayerid;
        if(sscanf(params, "i", giveplayerid)) return Syntax(playerid,"greet", "[playerid]");

        if(IsPlayerConnected(giveplayerid))
        {
            if(PlayerInfo[playerid][pMember] == 7)
            {
                format(string, sizeof(string), " You have greeted %s ", GetPlayerNameEx(giveplayerid));
                SendClientMessageEx(playerid, COLOR_WHITE, string);
                format(string, sizeof(string), " Hello, I'm Deputy %s from the LS Sheriff's Office", GetPlayerNameEx(playerid));
                SendClientMessageEx(giveplayerid, COLOR_GRAD1, string);
                SendClientMessageEx(giveplayerid, COLOR_GRAD1, "Do you know why I am stopping you today?");
            }
            if(PlayerInfo[playerid][pMember] == 1)
            {
                format(string, sizeof(string), " You have greeted %s ", GetPlayerNameEx(giveplayerid));
                SendClientMessageEx(playerid, COLOR_WHITE, string);
                format(string, sizeof(string), " Hello, I'm Officer %s from the Los Santos Police Department ", GetPlayerNameEx(playerid));
                SendClientMessageEx(giveplayerid, COLOR_GRAD1, string);
                SendClientMessageEx(giveplayerid, COLOR_GRAD1, "Do you know why I am stopping you today?");
            }
            if(PlayerInfo[playerid][pMember] == 2)
            {
                format(string, sizeof(string), " You have greeted %s ", GetPlayerNameEx(giveplayerid));
                SendClientMessageEx(playerid, COLOR_WHITE, string);
                format(string, sizeof(string), " Hello, I'm %s from the National Guard ", GetPlayerNameEx(playerid));
                SendClientMessageEx(giveplayerid, COLOR_GRAD1, string);
                SendClientMessageEx(giveplayerid, COLOR_GRAD1, "Do you know why I am stopping you today?");
            }
        }
    }
    else
    {
            SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
    }
    return 1;
}
Post please if you know how to fix it ,Thanks
Reply
#2

Show us the Syntax function.
Reply
#3

The problem doesn't seem to be with the greet command but with the function 'Syntax'.

Post the code for Syntax.
Reply
#4

You mean this ?
pawn Код:
#define Syntax(%0,%1) SendClientMessage(%0, 0xFFFF00FF, %1)
Reply
#5

pawn Код:
CMD:greet(playerid, params[])
{
    if(IsACop(playerid))
    {
        new string[128], giveplayerid;
        if(sscanf(params, "i", giveplayerid)) return Syntax(playerid,"greet [playerid]");

        if(IsPlayerConnected(giveplayerid))
        {
            if(PlayerInfo[playerid][pMember] == 7)
            {
                format(string, sizeof(string), " You have greeted %s ", GetPlayerNameEx(giveplayerid));
                SendClientMessageEx(playerid, COLOR_WHITE, string);
                format(string, sizeof(string), " Hello, I'm Deputy %s from the LS Sheriff's Office", GetPlayerNameEx(playerid));
                SendClientMessageEx(giveplayerid, COLOR_GRAD1, string);
                SendClientMessageEx(giveplayerid, COLOR_GRAD1, "Do you know why I am stopping you today?");
            }
            if(PlayerInfo[playerid][pMember] == 1)
            {
                format(string, sizeof(string), " You have greeted %s ", GetPlayerNameEx(giveplayerid));
                SendClientMessageEx(playerid, COLOR_WHITE, string);
                format(string, sizeof(string), " Hello, I'm Officer %s from the Los Santos Police Department ", GetPlayerNameEx(playerid));
                SendClientMessageEx(giveplayerid, COLOR_GRAD1, string);
                SendClientMessageEx(giveplayerid, COLOR_GRAD1, "Do you know why I am stopping you today?");
            }
            if(PlayerInfo[playerid][pMember] == 2)
            {
                format(string, sizeof(string), " You have greeted %s ", GetPlayerNameEx(giveplayerid));
                SendClientMessageEx(playerid, COLOR_WHITE, string);
                format(string, sizeof(string), " Hello, I'm %s from the National Guard ", GetPlayerNameEx(playerid));
                SendClientMessageEx(giveplayerid, COLOR_GRAD1, string);
                SendClientMessageEx(giveplayerid, COLOR_GRAD1, "Do you know why I am stopping you today?");
            }
        }
    }
    else
    {
            SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
    }
    return 1;
}
Reply
#6

its working properly now ,thanks man
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)