SA-MP Forums Archive
What is wrong? :) - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: What is wrong? :) (/showthread.php?tid=231057)



What is wrong? :) - Parrot - 24.02.2011

Hi. I don't understand what's wrong...

Quote:
Originally Posted by PAWN Compiler
(1327) : warning 202: number of arguments does not match definition
(1332) : warning 202: number of arguments does not match definition
(1333) : warning 202: number of arguments does not match definition
pawn Код:
Line 1327: dini_Get(fstring, "Owner", HouseInfo[houseid][hOwner]); //No, not "GetSet"! :P
Line 1332: dini_Float(fstring, "HV_PosZ", HouseInfo[houseid][hVecZ]);
Line 1333: dini_Float(fstring, "HV_PosA", HouseInfo[houseid][hVecA]);
Full code where all the errors occure:
pawn Код:
stock SaveHouse(houseid)
{
    new fstring[10]; //The string for the file [format]
    format(fstring, 10, "Houses/%d", houseid); //Format the filename
    if(!dini_Exists(fstring)) return 0; //"If Houses/{houseid} not exists then return False (0)"
    dini_FloatSet(fstring, "EnterX", HouseInfo[houseid][hEnterX]);
    dini_FloatSet(fstring, "EnterY", HouseInfo[houseid][hEnterY]);
    dini_FloatSet(fstring, "EnterZ", HouseInfo[houseid][hEnterZ]);
    dini_FloatSet(fstring, "ExitX", HouseInfo[houseid][hExitX]);
    dini_FloatSet(fstring, "ExitY", HouseInfo[houseid][hExitY]);
    dini_FloatSet(fstring, "ExitZ", HouseInfo[houseid][hExitZ]);
    dini_IntSet(fstring, "hInsideInt", HouseInfo[houseid][hInsideInt]);
    dini_IntSet(fstring, "hInsideVir", HouseInfo[houseid][hInsideVir]);
    dini_IntSet(fstring, "hOutsideInt", HouseInfo[houseid][hOutsideInt]);
    dini_IntSet(fstring, "hOutsideVir", HouseInfo[houseid][hOutsideVir]);
    dini_BoolSet(fstring, "Owned", HouseInfo[houseid][hOwned]);
    dini_Get(fstring, "Owner", HouseInfo[houseid][hOwner]); //No, not "GetSet"! :P
    dini_IntSet(fstring, "Price", HouseInfo[houseid][hPrice]);
    dini_IntSet(fstring, "HV_Model", HouseInfo[houseid][hVecModel]);
    dini_FloatSet(fstring, "HV_PosX", HouseInfo[houseid][hVecX]);
    dini_FloatSet(fstring, "HV_PosZ", HouseInfo[houseid][hVecY]);
    dini_Float(fstring, "HV_PosZ", HouseInfo[houseid][hVecZ]);
    dini_Float(fstring, "HV_PosA", HouseInfo[houseid][hVecA]);
    return 1;
}
If I should guess it's something with the "format(fstring, 10, "Houses/%d", houseid); //Format the filename"-line seeing as it says it doesn't match the number of arguments, but uh, I don't know really.

Thank you.


Re: What is wrong? :) - Voldemort - 24.02.2011

pawn Код:
dini_IntSet(fstring, "Owner", HouseInfo[houseid][hOwner]); //No, not "GetSet"! :P
dini_FloatSet(fstring, "HV_PosZ", HouseInfo[houseid][hVecZ]);
dini_FloatSet(fstring, "HV_PosA", HouseInfo[houseid][hVecA]);
try now


Re: What is wrong? :) - Krx17 - 24.02.2011

Your using the wrong functions for what your trying to do.
Fixed:
pawn Код:
Line 1327: dini_Get(fstring, "Owner", HouseInfo[houseid][hOwner]);
//should be
Line 1327: dini_Set(fstring, "Owner", HouseInfo[houseid][hOwner]);
pawn Код:
Line 1332: dini_Float(fstring, "HV_PosZ", HouseInfo[houseid][hVecZ]);
Line 1333: dini_Float(fstring, "HV_PosA", HouseInfo[houseid][hVecA]);
//should be
Line 1332: dini_FloatSet(fstring, "HV_PosZ", HouseInfo[houseid][hVecZ]);
Line 1333: dini_FloatSet(fstring, "HV_PosA", HouseInfo[houseid][hVecA]);