error 035
#1

pawn Код:
command(checkinactivehouses, playerid, params[])
{
    new string[128], Day, Month, Year;
    if(sscanf(params, "ddd", Day, Month, Year))
    {
        if(Player[playerid][AdminLevel] >= 6)
        {
            SendClientMessage(playerid, WHITE, "SYNTAX: /checkinactivehouses [day] [month] [year]");
        }
    }
    else
    {
        if(Player[playerid][AdminLevel] >= 6)
        {
            SCM(playerid, COLOR_ORANGE, ".: Inactive Houses :.");
            new CheckDate;
            format(CheckDate, sizeof(CheckDate), "%02d/%02d/%d", Day, Month, Year);
            new FileName[128];
            for(new i = 0; i < MAX_HOUSES; i++)
            {
                format(FileName, sizeof(FileName), "Houses/House_%d.ini", i);
                if(fexist(FileName))
                {
                    Houses[i][OwnerLastLogin] = dini_Int(FileName, "OwnerLastLogin");
                    if(CheckDate < Houses[i][OwnerLastLogin])
                    {
                        format(string, sizeof(string), "House id: %d", i);
                        SCM(playerid, SERVERCOLOR, string);
                    }
               }
            }
            SCM(playerid, ADMINBLUE, "Use /asellproperty [id], to asell them, use /autoasell to sell them all.");
        }
    }
    return 1;
}

command(asellinactivehouses, playerid, params[])
{
    new string[128], string1[128], Day, Month, Year, CountHouses, OwnerName[255];
    if(sscanf(params, "ddd", Day, Month, Year))
    {
        if(Player[playerid][AdminLevel] >= 6)
        {
            SendClientMessage(playerid, WHITE, "SYNTAX: /asellinactivehouses [day] [month] [year]");
        }
    }
    else
    {
        if(Player[playerid][AdminLevel] >= 6)
        {
            SCM(playerid, COLOR_ORANGE, ".: Inactive Houses :.");
            new CheckDate;
            format(CheckDate, sizeof(CheckDate), "%02d/%02d/%d", Day, Month, Year);
            new FileName[128];
            for(new i = 0; i < MAX_HOUSES; i++)
            {
                format(FileName, sizeof(FileName), "Houses/House_%d.ini", i);
                if(fexist(FileName))
                {
                    Houses[i][OwnerLastLogin] = dini_Int(FileName, "OwnerLastLogin");
                    if(CheckDate < Houses[i][OwnerLastLogin])
                    {
                        CountHouses++;
                       
                        format(OwnerName, sizeof(OwnerName), Houses[i][Owner]);
                       
                        format(string1, sizeof(string1), "Accounts/%s.ini", OwnerName);
                        if(fexist(string1))
                        {
                                dini_IntSet(string1, "House", -1);
                        }
                    }
                }
            }
            format(string, sizeof(string), "All inactive houses from %d have been cleared. (Total: %d)", CheckDate, CountHouses);
            SCM(playerid, YELLOW, string);
            CountHouses = 0;
        }
    }
    return 1;
}
gives these errors:

Код:
C:\Users\User\Desktop\GTA SA\Scratch RolePlay\gamemodes\RP.pwn(2775) : error 035: argument type mismatch (argument 1)
C:\Users\User\Desktop\GTA SA\Scratch RolePlay\gamemodes\RP.pwn(2775) : error 035: argument type mismatch (argument 1)
C:\Users\User\Desktop\GTA SA\Scratch RolePlay\gamemodes\RP.pwn(2812) : error 035: argument type mismatch (argument 1)
C:\Users\User\Desktop\GTA SA\Scratch RolePlay\gamemodes\RP.pwn(2812) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
The error lines:
pawn Код:
Line 2775:
            format(CheckDate, sizeof(CheckDate), "%02d/%02d/%d", Day, Month, Year);

Line 2812:
            format(CheckDate, sizeof(CheckDate), "%02d/%02d/%d", Day, Month, Year);
Reply
#2

You're trying to format CheckDate, which you have defined as an integer.

To fix this, you easily have to make CheckDate into an array for it to be used as a string:
pawn Код:
new CheckDate[14]; //12 will probably be enough, but I put 14 just to be sure.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)