Help sscanf
#1

guys i tried to create a vehicle but when i typeit with the params sscanf still show me the right way to write.

pawn Код:
CMD:createveh(playerid, vehicleid, params[])
{
  if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "No puedes usar este comando!");
  new Model, Cor1, Cor2, Precio;
  if(sscanf(params, "iiii", Model, Cor1, Cor2, Precio)) return SendClientMessage(playerid, -1, "/createveh [Model] [Color1] [Color2] [Price]");
  new Float:Pos[4], Query[256];
  GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  GetPlayerFacingAngle(playerid, Pos[3]);
  CreateVehicle(Model, Pos[0], Pos[1], Pos[2], Pos[3], Cor1, Cor2, 15*60);
  VehicleHasOwner[vehicleid] = 0;
  CarKeys++;
  veh_created++;
  CarInfo[playerid][CarKey] = CarKeys;
  CarInfo[playerid][Color1] = Cor1;
  CarInfo[playerid][Color2] = Cor2;
  CarInfo[playerid][Price] = Precio;
  CarInfo[playerid][PosX] = Pos[0];
  CarInfo[playerid][PosY] = Pos[1];
  CarInfo[playerid][PosZ] = Pos[2];
  CarInfo[playerid][Angle] = Pos[3];
  strmid(CarInfo[veh_created][Owner], "Unbought", 0, 20, 20);
  format(Query, sizeof(Query), "INSERT INTO `privateveh` (`vID`, `vModel`, `vColor1`, `vColor2`, `vPrice`, `vOwner`, `vPosX`, `vPosY`, `vPosZ`, `vPosA`, `vPlate`, `vPaintJ`) VALUES (%d, %d, %d, %d, %d, 'Unbought', %f, %f, %f, %f, 'ChangeME', 0)",
    veh_created,
    Model,
    Cor1,
    Cor2,
    Precio,
    Pos[0],
    Pos[1],
    Pos[2],
    Pos[3]);
  mysql_query(Query);
  SendClientMessage(playerid, COLOR_LIGHTBLUE, "Veh Created SucessFully");
  return 1;
}
Reply


Messages In This Thread
Help sscanf - by ttloko2 - 21.02.2012, 19:23
Re: Help sscanf - by MP2 - 21.02.2012, 19:35
Re: Help sscanf - by Vince - 21.02.2012, 19:40
Re: Help sscanf - by ttloko2 - 21.02.2012, 19:49
Re: Help sscanf - by MP2 - 21.02.2012, 20:06
Re: Help sscanf - by ttloko2 - 21.02.2012, 20:49

Forum Jump:


Users browsing this thread: 1 Guest(s)