[HELP]Annoying warning(nb. of arguments does not match def)
#1

pawn Код:
stock LoadVehicles(vehicleid)
{
  new playerid;
  new vstring[10];
  new pName[MAX_PLAYER_NAME];
  GetPlayerName(playerid,pName,sizeof(pName));
  format(vstring,sizeof(vstring),"/VehicleOwnership/%s.txt",pName);
  if(!dini_Exists(vstring))
  {
     dini_Create(vstring);
  }
  VehicleInfo[vehicleid][vPrice] = dini_Int(vstring,"VehPrice");
  VehicleInfo[vehicleid][vModel] = dini_Int(vstring,"VehModel");
  VehicleInfo[vehicleid][vOwned] = dini_Bool(vstring,"VehOwned") ? true : false;
  VehicleInfo[vehicleid][vSell] = dini_Bool(vstring,"VehForSell") ? true : false;
  VehicleInfo[vehicleid][vFloatY] = dini_Float(vstring,"VehFloatY");
  VehicleInfo[vehicleid][vFloatZ] = dini_Float(vstring,"VehFloatZ");
  VehicleInfo[vehicleid][vFloatX] = dini_Float(vstring,"VehFloatX");
  strmid(VehicleInfo[vehicleid][vOwner], dini_Get(vstring, "VehOwner"), 0, false, strlen(dini_Get("VehOwner"))); // number of arguments does not match definition??(they DO?)
  return 1;
}
Help the warning says the arguments doesn't match definition,but I don't see error,and it's very annoying :P
Reply
#2

pawn Код:
stock LoadVehicles(vehicleid)
{
  new playerid;
  new vstring[24];
  new pName[MAX_PLAYER_NAME];
  GetPlayerName(playerid,pName,sizeof(pName));
  format(vstring,sizeof(vstring),"/VehicleOwnership/%s.txt",pName);
  if(!dini_Exists(vstring))
  {
     dini_Create(vstring);
  }
  VehicleInfo[vehicleid][vPrice] = dini_Int(vstring,"VehPrice");
  VehicleInfo[vehicleid][vModel] = dini_Int(vstring,"VehModel");
  VehicleInfo[vehicleid][vOwned] = dini_Bool(vstring,"VehOwned") ? true : false;
  VehicleInfo[vehicleid][vSell] = dini_Bool(vstring,"VehForSell") ? true : false;
  VehicleInfo[vehicleid][vFloatY] = dini_Float(vstring,"VehFloatY");
  VehicleInfo[vehicleid][vFloatZ] = dini_Float(vstring,"VehFloatZ");
  VehicleInfo[vehicleid][vFloatX] = dini_Float(vstring,"VehFloatX");
  strmid(VehicleInfo[vehicleid][vOwner], dini_Get(vstring, "VehOwner"), 0, false, strlen(dini_Get("VehOwner"))); // number of arguments does not match definition??(they DO?)
  return 1;
}
Reply
#3

still same and I see no difference what did you change?
Reply
#4

on the vehicle info enum you put
vOwner[24] or some other number here?
Reply
#5

vOwner[MAX_PLAYER_NAME];l
Reply
#6

Post the line on which the error occurs, and show the line that calls the stock function.
Reply
#7

pawn Код:
//try
format(VehicleInfo[vehicleid][vOwner], 24, "%s",dini_Get(vstring, "VehOwner"));
//or
format(VehicleInfo[vehicleid][vOwner], 24, dini_Get(vstring, "VehOwner"));
i'm almost sleeping so i'm not sure about what i'm doing :/
Reply
#8

the error line:
pawn Код:
strmid(VehicleInfo[vehicleid][vOwner], dini_Get(vstring, "VehOwner"), 0, false, strlen(dini_Get("VehOwner"))); // number of arguments does not match definition??(they DO?)
I call the stock function:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid==DIALOG_CFS)
    {
      new vehicleid=GetPlayerVehicleID(playerid);
      if(response==0)
      {
        SendClientMessage(playerid,COLOR_RED,"Operation aborted");
        RemovePlayerFromVehicle(playerid);
        TogglePlayerControllable(playerid,1);
      }
      if(response==1 && GetPlayerMoney(playerid) < VehicleInfo[vehicleid][vPrice]) return SendClientMessage(playerid,COLOR_RED,"You don't have enough money to buy thi car");
      else if(response==1 && GetPlayerMoney(playerid) >= VehicleInfo[vehicleid][vPrice])
      {
         new modelid=GetVehicleModel(vehicleid);
         new pName[MAX_PLAYER_NAME];
         GetPlayerName(playerid,pName,sizeof(pName));
         GivePlayerMoney(playerid,-VehicleInfo[vehicleid][vPrice]);
         new bveh;
         bveh = CreateVehicle(modelid,-2001.2502,288.5811,33.7657,0,0,0,0);
         PutPlayerInVehicle(playerid,bveh,0);
         SendClientMessage(playerid,COLOR_GREEN,"Car bhought");
         VehicleInfo[vehicleid][vOwned] = true;
         strmid(VehicleInfo[vehicleid][vOwner], pName, 0, false, strlen(pName));
         LoadVehicles(vehicleid);
         SaveVehicle(vehicleid);
         TogglePlayerControllable(playerid,1);
         SetVehicleParamsEx(vehicleid,0,0,0,0,0,0,0);
      }
    }
 return 1;
}
Reply
#9

strmid(VehicleInfo[vehicleid][vOwner], dini_Get(vstring, "VehOwner"), 0, false, strlen(dini_Get("VehOwner"))); // number of arguments does not match definition??(they DO?)

to

strmid(VehicleInfo[vehicleid][vOwner], dini_Get(vstring, "VehOwner"), 0, false, strlen(dini_Get(vstring,"VehOwner"))); // number of arguments does not match definition??(they DO?)
Reply
#10

thx the known
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)