error 035: argument type mismatch (argument 1) -
Riwerry - 15.11.2013
Hello guys, what's wrong here? I'm using y_ini.
Getting this error error 035: argument type mismatch (argument 1)
pawn Код:
new INI:file = INI_Open (VehiclePath(vehicleid));//ERROR LINE
/*Stock for VehiclePath*/
stock VehiclePath (vehicleid)
{
new string[128];
format(string,sizeof(string),VEHICLE_PATH,vehicleid);
return string;
}
/*Path*/
#define VEHICLE_PATH "%i.ini"
Re: error 035: argument type mismatch (argument 1) -
Konstantinos - 15.11.2013
Make sure that vehicleid is an integer. The code seems fine and it compiles fine as well.
pawn Код:
#define VEHICLE_PATH "%i.ini"
public OnFilterScriptInit( )
{
new INI:file = INI_Open (VehiclePath(1));//ERROR LINE
return 1;
}
stock VehiclePath (vehicleid)
{
new string[128];
format(string,sizeof(string),VEHICLE_PATH,vehicleid);
return string;
}
Re: error 035: argument type mismatch (argument 1) -
Riwerry - 15.11.2013
I am creating new ini file in dialog response..
Re: error 035: argument type mismatch (argument 1) -
Konstantinos - 15.11.2013
Quote:
Originally Posted by Riwerry
I am creating new ini file in dialog response..
|
What I posted was just an example to see that it compiles fine by adding an integer value in VehiclePath; therebefore the error caused from vehicleid. Post the code that you get the vehicleid.
Re: error 035: argument type mismatch (argument 1) -
Riwerry - 15.11.2013
Nah, same line errors..
error 035: argument type mismatch (argument 1)
pawn Код:
new INI:file = INI_Open (vehiclepath(1));
Re: error 035: argument type mismatch (argument 1) -
XStormiest - 15.11.2013
1. When you create a file you have to : oepn -> close
2. Creating a variable inside a callback will make that variable local so you can use that only in OnDialogResponse
3. For me it compiles , depend on what you did. i'm sure you did something bad that's make the code unreadable by the compiler.
Re: error 035: argument type mismatch (argument 1) -
Riwerry - 15.11.2013
I have file closed, I just posted error line. And I made just this, look to it
pawn Код:
public OnDialogResponse (playerid, dialogid, response, listitem, inputtext [])
{
switch (dialogid)
{
case DIALOG_VOZIDLO:
{
if (!response) return true;
{
if (listitem == 0)
{
if (SlotZabraty [playerid] == 1)
{
return SendClientMessage (playerid, -1, "V tomto slote uz je uloћenб zbran!");
}
new wSlot1[MAX_PLAYERS], wSlot1Ammo[MAX_PLAYERS];
wSlot1 [playerid] = GetPlayerWeapon(playerid);
wSlot1Ammo [playerid] = GetPlayerAmmo(playerid);
new INI:Subor = INI_Open (Umiestnenie(1));
INI_WriteInt (Subor, "Slot1Weapon", wSlot1 [playerid]);
INI_WriteInt (Subor, "Slot1WeaponAmmo", wSlot1Ammo [playerid]);
INI_Close (Subor);
SendClientMessage (playerid, -1, "Ъspeљne si uloћil zbran do slotu 1!");
SlotZabraty [playerid] = 1;
}
else if (listitem == 1)
{
SendClientMessage (playerid, -1, "Ъspeљne si uloћil zbran do slotu 2!");
}
else if(listitem == 2)
{
SendClientMessage (playerid, -1, "Ъspeљne si uloћil zbran do slotu 3!");
}
}
}
return true;
}
This tabs are okay dont know why on web is it broken. :D