Argument type mismatch help.
#1

pawn Код:
stock SaveHouse(i)
{
    new FileName[128];
    format(FileName, sizeof(FileName), "Houses/House_%d.ini", i);
    if(!fexist(FileName))
    {
        ERROR Line959INI_SetTag(FileName, "house");
        ERROR Line960INI_WriteString(FileName, "InteriorID", HouseVar[i][hInteriorID]);
        ERROR Line961INI_WriteFloat(FileName, "InteriorX", HouseVar[i][hInteriorX]);
        ERROR Line962INI_WriteFloat(FileName, "InteriorY", HouseVar[i][hInteriorY]);
        ERROR Line963INI_WriteFloat(FileName, "InteriorZ", HouseVar[i][hInteriorZ]);
        ERROR Line964INI_WriteInt(FileName, "HousePrice", 0);
        ERROR Line965INI_WriteInt(FileName, "ExteriorID", 0);
        ERROR Line966INI_WriteFloat(FileName, "ExteriorX", HouseVar[i][hExteriorX]);
        ERROR Line967INI_WriteFloat(FileName, "ExteriorY", HouseVar[i][hExteriorY]);
        ERROR Line968INI_WriteFloat(FileName, "ExteriorZ", HouseVar[i][hExteriorZ]);
        ERROR Line969INI_WriteString(FileName, "Owner", "Nobody");
        ERROR Line970INI_WriteInt(FileName, "LockStatus", HouseVar[i][LockStatus]);
        ERROR Line971INI_Close(FileName);
        printf("[system] House %d saved.", i);
    }
    return 1;
}
That's the code, and here are the errors.

pawn Код:
C:\Users\Aidan\Desktop\Gamemode from scratch\gamemodes\RP.pwn(959) : error 035: argument type mismatch (argument 1)
C:\Users\Aidan\Desktop\Gamemode from scratch\gamemodes\RP.pwn(960) : error 035: argument type mismatch (argument 1)
C:\Users\Aidan\Desktop\Gamemode from scratch\gamemodes\RP.pwn(961) : error 035: argument type mismatch (argument 1)
C:\Users\Aidan\Desktop\Gamemode from scratch\gamemodes\RP.pwn(962) : error 035: argument type mismatch (argument 1)
C:\Users\Aidan\Desktop\Gamemode from scratch\gamemodes\RP.pwn(963) : error 035: argument type mismatch (argument 1)
C:\Users\Aidan\Desktop\Gamemode from scratch\gamemodes\RP.pwn(964) : error 035: argument type mismatch (argument 1)
C:\Users\Aidan\Desktop\Gamemode from scratch\gamemodes\RP.pwn(965) : error 035: argument type mismatch (argument 1)
C:\Users\Aidan\Desktop\Gamemode from scratch\gamemodes\RP.pwn(966) : error 035: argument type mismatch (argument 1)
C:\Users\Aidan\Desktop\Gamemode from scratch\gamemodes\RP.pwn(967) : error 035: argument type mismatch (argument 1)
C:\Users\Aidan\Desktop\Gamemode from scratch\gamemodes\RP.pwn(968) : error 035: argument type mismatch (argument 1)
C:\Users\Aidan\Desktop\Gamemode from scratch\gamemodes\RP.pwn(969) : error 035: argument type mismatch (argument 1)
C:\Users\Aidan\Desktop\Gamemode from scratch\gamemodes\RP.pwn(970) : error 035: argument type mismatch (argument 1)
C:\Users\Aidan\Desktop\Gamemode from scratch\gamemodes\RP.pwn(971) : error 035: argument type mismatch (argument 1)
13 errors.

And all those errors are on my stock, please help, thanks
Reply
#2

"InteriorID" is a string?
Reply
#3

Quote:
Originally Posted by newbienoob
Посмотреть сообщение
"InteriorID" is a string?
Yes it is
Reply
#4

show me your enum
Reply
#5

pawn Код:
new INI:FileName[128];
I'm not sure if that's the correct syntax.
Reply
#6

he want to see enum of HouseVar.
Reply
#7

Код:
new FileName[128];
format(FileName, sizeof(FileName), "Houses/House_%d.ini", i);
new INI:handle = INI_Open(FileName);
    if(!fexist(handle))
    {
        ERROR Line959INI_SetTag(handle , "house");
        ERROR Line960INI_WriteString(handle , "InteriorID", HouseVar[i][hInteriorID]);
        ERROR Line961INI_WriteFloat(handle , "InteriorX", HouseVar[i][hInteriorX]);
        ERROR Line962INI_WriteFloat(handle , "InteriorY", HouseVar[i][hInteriorY]);
        ERROR Line963INI_WriteFloat(handle , "InteriorZ", HouseVar[i][hInteriorZ]);
        ERROR Line964INI_WriteInt(handle , "HousePrice", 0);
        ERROR Line965INI_WriteInt(handle , "ExteriorID", 0);
        ERROR Line966INI_WriteFloat(handle , "ExteriorX", HouseVar[i][hExteriorX]);
        ERROR Line967INI_WriteFloat(handle , "ExteriorY", HouseVar[i][hExteriorY]);
        ERROR Line968INI_WriteFloat(handle , "ExteriorZ", HouseVar[i][hExteriorZ]);
        ERROR Line969INI_WriteString(handle , "Owner", "Nobody");
        ERROR Line970INI_WriteInt(handle , "LockStatus", HouseVar[i][LockStatus]);
        ERROR Line971INI_Close(handle);
        printf("[system] House %d saved.", i);
    }
Reply
#8

Thanks, I have one error left now which is:
pawn Код:
error 035: argument type mismatch (argument 1)
CODE:
pawn Код:
if(!fexist(handle))
{
Reply
#9

Yeah, my bad, replace it with
Код:
if(!fexist(FileName))
Reply
#10

edit king_hual's code
[pwn]format(FileName, sizeof(FileName), "Houses/House_%d.ini", i);
if(!fexist(FileName))
{
new INI:handle = INI_Open(FileName);[/pwn]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)