if(strcmp(cmd, "/savecar", true) == 0)
{
if(!IsPlayerInVehicle(playerid, GetPVarInt(playerid,"Create_Car"))) return SendClientMessage(playerid, -1, "Вы должны быть в специально созданном авто!");
if(PlayerInfo[playerid][pAdmin] <= 9)
{
new carid = GetPlayerVehicleID(playerid);
new model = GetVehicleModel(carid);
if(IsARpavto3(model))
{
if(!GetPVarInt(playerid,"Create_Car")) return SendClientMessage(playerid, -1, "Вы не создавали авто /addcar!");
if(zakazavtoid[playerid] >= 400){return 1;}
if(PlayerInfo[playerid][pAdmin] < 9) return SendClientMessage(playerid, -1, "У вас нет прав на использование этой команды!");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /savecar [Сумма]");
new money = strval(tmp);
AllCars++;
GetVehiclePos(GetPVarInt(playerid,"Create_Car"), CarInfo[AllCars][cAx],CarInfo[AllCars][cAy],CarInfo[AllCars][cAz]);
GetVehiclePos(GetPVarInt(playerid,"Create_Car"), CarInfo[AllCars][cPx],CarInfo[AllCars][cPy],CarInfo[AllCars][cPz]);
GetVehicleZAngle(GetPVarInt(playerid,"Create_Car"), CarInfo[AllCars][cAa]);
GetVehicleZAngle(GetPVarInt(playerid,"Create_Car"), CarInfo[AllCars][cPa]);
CarInfo[AllCars][cID] = GetPVarInt(playerid,"Create_Car");
CarInfo[AllCars][cMod] = GetVehicleModel(GetPVarInt(playerid,"Create_Car"));
CarInfo[AllCars][cCol1] = -1;
CarInfo[AllCars][cCol2] = -1;
format(CarInfo[AllCars][cOwner],24,"Nones");
format(CarInfo[AllCars][cOwnerm],24,"Nones");
CarInfo[AllCars][cLock] = 0;
CarInfo[AllCars][cPrice] = money;
CarInfo[AllCars][cSport] = 0;
CarInfo[AllCars][cLocke] = 0;
CarInfo[AllCars][cAntiradar] = 0;
CarInfo[AllCars][cDatam] = 0;
CarInfo[AllCars][cDatad] = 0;
CarInfo[AllCars][cNitros] = 0;
CarInfo[AllCars][cProbeg] = 0;
CarInfo[AllCars][cArest] = 0;
CarInfo[AllCars][cType] = 1;
new cars = GetPlayerVehicleID(playerid);
CarInfo[cars][cPaintJob] = -1;
CarInfo[AllCars][cPaintJob] = -1;
CarInfo[cars][cType] = 1;
format(CarInfo[AllCars][cPArest],32,"Nones");
format(CarInfo[AllCars][cNumber],64,"None");
new iniOpen = ini_openFile("cars.cfg");
ini_setInteger(iniOpen, "AllCars", AllCars);
ini_closeFile(iniOpen);
DeletePVar(playerid,"Create_Car");
CarLabel[CarInfo[AllCars][cID]] = Create3DTextLabel("Транзитка\nПродаётся",0xFFFF00FF, 0.0, 0.0, 0.0,40.0,0,0);
Attach3DTextLabelToVehicle(CarLabel[CarInfo[AllCars][cID]] , CarInfo[AllCars][cID], 0.0, 0.0, 1.1);
CreateCar(AllCars);
SendClientMessage(playerid, COLOR_GRAD2, "Авто успешно создано");
}
}
else
{
if(PlayerInfo[playerid][pAdmin] == 10)
{
if(!GetPVarInt(playerid,"Create_Car")) return SendClientMessage(playerid, -1, "Вы не создавали авто /addcar!");
if(zakazavtoid[playerid] >= 400){return 1;}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /savecar [Сумма]");
new money = strval(tmp);
AllCars++;
GetVehiclePos(GetPVarInt(playerid,"Create_Car"), CarInfo[AllCars][cAx],CarInfo[AllCars][cAy],CarInfo[AllCars][cAz]);
GetVehiclePos(GetPVarInt(playerid,"Create_Car"), CarInfo[AllCars][cPx],CarInfo[AllCars][cPy],CarInfo[AllCars][cPz]);
GetVehicleZAngle(GetPVarInt(playerid,"Create_Car"), CarInfo[AllCars][cAa]);
GetVehicleZAngle(GetPVarInt(playerid,"Create_Car"), CarInfo[AllCars][cPa]);
CarInfo[AllCars][cID] = GetPVarInt(playerid,"Create_Car");
CarInfo[AllCars][cMod] = GetVehicleModel(GetPVarInt(playerid,"Create_Car"));
CarInfo[AllCars][cCol1] = -1;
CarInfo[AllCars][cCol2] = -1;
format(CarInfo[AllCars][cOwnerm],32,"Nones");
format(CarInfo[AllCars][cOwner],24,"Nones");
CarInfo[AllCars][cLock] = 0;
CarInfo[AllCars][cPrice] = money;
CarInfo[AllCars][cSport] = 0;
CarInfo[AllCars][cLocke] = 0;
CarInfo[AllCars][cAntiradar] = 0;
CarInfo[AllCars][cDatam] = 0;
CarInfo[AllCars][cDatad] = 0;
CarInfo[AllCars][cNitros] = 0;
CarInfo[AllCars][cProbeg] = 0;
CarInfo[AllCars][cArest] = 0;
CarInfo[AllCars][cType] = 1;
new cars = GetPlayerVehicleID(playerid);
CarInfo[cars][cPaintJob] = -1;
CarInfo[AllCars][cPaintJob] = -1;
CarInfo[cars][cType] = 1;
format(CarInfo[AllCars][cPArest],32,"Nones");
format(CarInfo[AllCars][cNumber],64,"None");
new iniOpen = ini_openFile("cars.cfg");
ini_setInteger(iniOpen, "AllCars", AllCars);
ini_closeFile(iniOpen);
DeletePVar(playerid,"Create_Car");
CarLabel[CarInfo[AllCars][cID]] = Create3DTextLabel("Транзитка\nПродаётся",0xFFFF00FF, 0.0, 0.0, 0.0,40.0,0,0);
Attach3DTextLabelToVehicle(CarLabel[CarInfo[AllCars][cID]] , CarInfo[AllCars][cID], 0.0, 0.0, 1.1);
CreateCar(AllCars);
SendClientMessage(playerid, COLOR_GRAD2, "Авто успешно создано");
}
}
return true;
}