if(strcmp(cmd, "/buycar", true) == 0)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GRAD2, "Âû äîëæíû áûòü â àâòîìîáèëå");
new cars = GetPlayerVehicleID(playerid);
if(GetRealID(cars) == -1) return SendClientMessage(playerid, COLOR_GRAD2, "Âû äîëæíû áûòü â àâòîìîáèëå äëÿ ïðîäàæ");
if(!strcmp(CarInfo[GetRealID(cars)][cOwner],"ÒÐÀÍÇÈÒ",true))
{
if(GetPlayerMoney(playerid) < CarInfo[GetRealID(cars)][cPrice])
{
TogglePlayerControllable(playerid,1);
RemovePlayerFromVehicle(playerid);
return SendClientMessage(playerid, COLOR_GRAD2, "Ó âàñ íåò äåíåã íà ïîêóïêó");
}
if(PlayerInfo[playerid][pLevel] < 2)
{
SendClientMessage(playerid, COLOR_GRAD2, " Òåáå íóæíî áûòü õîòÿ áû 2 ëåâåëîì ÷òîáû êóïèòü àâòî!");
RemovePlayerFromVehicle(playerid);
return 1;
}
new carpla = 0;
for(new i = 1; i <= AllCars; i++)
{
if(!strcmp(CarInfo
[cOwner],Name(playerid),false,24)) carpla++;
}
if(PlayerInfo[playerid][pDonateRank] == 4)
{
if(carpla >= 3) return SendClientMessage(playerid, COLOR_GRAD2, "Ó âàñ ñëèøêîì ìíîãî ìàøèí");
}
else if(carpla >= 1) return SendClientMessage(playerid, COLOR_GRAD2, "Ó âàñ ñëèøêîì ìíîãî ìàøèí");
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GiveMoneyAntiCheat(playerid,-CarInfo[GetRealID(cars)][cPrice]);
format(CarInfo[GetRealID(cars)][cOwner],24,"%s",Name(playerid));
SaveCar(GetRealID(cars));
Update3DTextLabelText(CarLabel[CarInfo[GetRealID(cars)][cID]], 0xFFFF00FF, "ÒÐÀÍÇÈÒ ");
TogglePlayerControllable(playerid,1);
SendClientMessage(playerid, COLOR_GRAD2, "Âû óñïåøíî êóïèëè ñåáå ìàøèíó");
return 1;
}
else SendClientMessage(playerid, COLOR_GRAD2, "Ýòîò òðàíñïîðò èìååò âëàäåëüöà");
}