Doesn't match definition;Differs from prototype
#1

I updated sscanf plugin to the latest and now I have a warning and an error to a FS, this is where I take the warning:

Код:
    if(dialogid == CreateC_D)
    {
    	if(response)
        {
            if(strlen(inputtext) < 3 && strlen(inputtext) > 16)
            {
                SendClientMessage(playerid, red, "ERROR: Clan Name must bee betwen 3 and 15 characters!");
				ShowPlayerDialog(playerid, CreateC_D, DIALOG_STYLE_INPUT, "{0066CC}R{FFFF00}S{FF0000}M{AFAFAF} - Create Clan", "{FF0000}Hi!\n{FF9900}Follow the next steps to Successfully Create your Own Clan!\n\n{FF0000}1st Step:{FF9900} Please Insert below the name of your clan:","Next","Cancel");
            }
            else if(strlen(inputtext) >= 3 && strlen(inputtext) < 16)
            {
                CreateClan(playerid, inputtext, "", "", "");
            }
        }
    }
Lines: 218 to 232

This is where I take the error:

Код:
    if(dialogid == Clan_SkinL)
    {
    	if(response)
        {
            new SkinID = strval(inputtext);
            if ((SkinID < 0) || (SkinID > 299) || IsInvalidSkin(SkinID))
            {
      	 		SendClientMessage(playerid, -1, "{FF0000}ERROR: Clan Skin Leader is invalid");
				ShowPlayerDialog(playerid,Clan_SkinL,DIALOG_STYLE_INPUT,"{0066CC}R{FFFF00}S{FF0000}M{AFAFAF} - Clan Leader Skin","{FF9900}Sorry but the Clan Skin Leader is {FF0000}invalid{FF9900}!\n\n{FF9900}Please Insert Skin Leader of the Clan","Next","Cancel");
				return 0;
			}
		 	new CQuery[300];
			format(CQuery, sizeof(CQuery), "UPDATE clans SET lskin = %d WHERE clanname = '%s'", SkinID, GetPlayerClan(playerid));
   			db_query( Database, CQuery );
			SetPlayerSkin(playerid,SkinID);
			ShowPlayerDialog(playerid,Clan_SkinM,DIALOG_STYLE_INPUT,"{0066CC}R{FFFF00}S{FF0000}M{AFAFAF} - Clan Member Skin","{FF9900}Please Insert Member Skin of the Clan","Next","");
        }
        if(!response)
        {
        	//DisbandClan(playerid);
        }
    }
Lines: 234 to 255.

Warning/Error:

Код:
C:\Users\\pawno\include\sscanf2.inc(227) : warning 202: number of arguments does not match definition
C:\Users\\pawno\include\sscanf2.inc(240) : error 025: function heading differs from prototype
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
I tryed to find the new definiton but I didn't found it, anyone know how to solve it ?
I'm using sscanf 2.8.1 includes.
Reply
#2

The warning and error are from the sscanf2 include file, not the script.

From what I see, the problem is about OnPlayerDisconnect.

From sscanf2.inc:
pawn Код:
// lines 224-241:
    public OnPlayerDisconnect(playerid, reason)
    {
        #if defined SSCANF_OnPlayerDisconnect
            SSCANF_OnPlayerDisconnect(playerid, reason);
        #endif
        SSCANF_Leave(playerid);
        return 1;
    }

    #if defined _ALS_OnPlayerDisconnect
        #undef OnPlayerDisconnect
    #else
        #define _ALS_OnPlayerDisconnect
    #endif
    #define OnPlayerDisconnect SSCANF_OnPlayerDisconnect
    #if defined SSCANF_OnPlayerDisconnect
        forward SSCANF_OnPlayerDisconnect(playerid, reason);
    #endif
Is it different on your include or in the script OnPlayerDisconnect does not have 2 parameters?
Reply
#3

Yes, I know it's from sscanf2 include because when I used the previous version it worked fine, now, when I updated sscanf2 I take this two errors.

That lines was from my filterscript, not from sscanf2 and that lines was from OnDialogResponse, I tryed to look in another FS and take a model from DialogResponse from another script but I didn't succeed.

Your sscanf code isn't different from mine.

What I use on OnPlayerDisconnect it's only this:

Код:
public OnPlayerDisconnect(playerid)
{
	new oquery[100];
	//--------------------------------------------------------------------------
	format(oquery, 100, "UPDATE `members` SET `IsOnline` = '0' WHERE `playername` = '%s'", GetPlayerNameEx(playerid));
	db_query(Database, oquery);
	//--------------------------------------------------------------------------
	format(oquery, 100, "UPDATE `clans` SET `clantag` = '%d' WHERE `clanname` = '%s'", GetTotalMembers(GetPlayerClan(playerid)), GetPlayerClan(playerid));
	db_query(Database, oquery);
	//--------------------------------------------------------------------------
	return 1;
}
Reply
#4

Change to:
pawn Код:
public OnPlayerDisconnect(playerid, reason)
Reply
#5

Only some errors ):
Код:
C:\Users\Adrian\Desktop\Romania Stunt Madness\pawno\include\sscanf2.inc(227) : warning 202: number of arguments does not match definition
C:\Users\Adrian\Desktop\Romania Stunt Madness\pawno\include\sscanf2.inc(240) : error 025: function heading differs from prototype
C:\Users\Adrian\Desktop\Romania Stunt Madness\filterscripts\createclan.pwn(215) : error 025: function heading differs from prototype
C:\Users\Adrian\Desktop\Romania Stunt Madness\filterscripts\createclan.pwn(216) : error 021: symbol already defined: "SSCANF_OnPlayerDisconnect"
C:\Users\Adrian\Desktop\Romania Stunt Madness\filterscripts\createclan.pwn(220) : error 017: undefined symbol "dialogid"
C:\Users\Adrian\Desktop\Romania Stunt Madness\filterscripts\createclan.pwn(222) : error 017: undefined symbol "response"
C:\Users\Adrian\Desktop\Romania Stunt Madness\filterscripts\createclan.pwn(224) : error 017: undefined symbol "inputtext"
C:\Users\Adrian\Desktop\Romania Stunt Madness\filterscripts\createclan.pwn(229) : error 017: undefined symbol "inputtext"
C:\Users\Adrian\Desktop\Romania Stunt Madness\filterscripts\createclan.pwn(231) : error 017: undefined symbol "inputtext"
C:\Users\Adrian\Desktop\Romania Stunt Madness\filterscripts\createclan.pwn(236) : error 017: undefined symbol "dialogid"
C:\Users\Adrian\Desktop\Romania Stunt Madness\filterscripts\createclan.pwn(238) : error 017: undefined symbol "response"
C:\Users\Adrian\Desktop\Romania Stunt Madness\filterscripts\createclan.pwn(240) : error 017: undefined symbol "inputtext"
C:\Users\Adrian\Desktop\Romania Stunt Madness\filterscripts\createclan.pwn(253) : error 017: undefined symbol "response"
C:\Users\Adrian\Desktop\Romania Stunt Madness\filterscripts\createclan.pwn(259) : error 017: undefined symbol "dialogid"
C:\Users\Adrian\Desktop\Romania Stunt Madness\filterscripts\createclan.pwn(261) : error 017: undefined symbol "response"
C:\Users\Adrian\Desktop\Romania Stunt Madness\filterscripts\createclan.pwn(263) : error 017: undefined symbol "inputtext"
C:\Users\Adrian\Desktop\Romania Stunt Madness\filterscripts\createclan.pwn(278) : error 017: undefined symbol "dialogid"
C:\Users\Adrian\Desktop\Romania Stunt Madness\filterscripts\createclan.pwn(280) : error 017: undefined symbol "response"
C:\Users\Adrian\Desktop\Romania Stunt Madness\filterscripts\createclan.pwn(282) : error 017: undefined symbol "inputtext"
C:\Users\Adrian\Desktop\Romania Stunt Madness\filterscripts\createclan.pwn(296) : error 017: undefined symbol "dialogid"
C:\Users\Adrian\Desktop\Romania Stunt Madness\filterscripts\createclan.pwn(298) : error 017: undefined symbol "response"
C:\Users\Adrian\Desktop\Romania Stunt Madness\filterscripts\createclan.pwn(300) : error 017: undefined symbol "inputtext"
C:\Users\Adrian\Desktop\Romania Stunt Madness\filterscripts\createclan.pwn(315) : error 017: undefined symbol "dialogid"
C:\Users\Adrian\Desktop\Romania Stunt Madness\filterscripts\createclan.pwn(318) : error 017: undefined symbol "response"
C:\Users\Adrian\Desktop\Romania Stunt Madness\filterscripts\createclan.pwn(320) : error 017: undefined symbol "listitem"
C:\Users\Adrian\Desktop\Romania Stunt Madness\filterscripts\createclan.pwn(326) : error 017: undefined symbol "listitem"
C:\Users\Adrian\Desktop\Romania Stunt Madness\filterscripts\createclan.pwn(332) : error 017: undefined symbol "listitem"

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.
Reply
#6

dialogid, response and inputtext are parameters of the callback OnDialogResponse so in the line 10885, it should be:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
and not OnPlayerDisconnect (there's already that callback in the script).
Reply
#7

I don't have line 10885 in FS with the errors. I have that line on 213 line, exactly same, in LuxAdmin I have that on line 10882 and it looks like your's too.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)