else if(strcmp(x_nr,"buy",true) == 0)
{
new car = 340;
new model = GetVehicleModel(idcar);
if(IsASalesVehicle(idcar))
{
if(PlayerInfo < 5)
{
SendClientMessage(playerid, COLOR_GREY, "You need to be level 5 to buy a vehicle!");
return 1;
}
if(PlayerInfo == 9999 || PlayerInfo == 9999 || PlayerInfo == 9999) { }
else return SendClientMessage(playerid, COLOR_GREY,"* You already own Three cars!");
if(GetPlayerMoney(playerid) >= GetVehiclePrice(idcar))
{
if(PlayerInfo == 1)
{
for(new h = 340; h < sizeof(CarInfo); h++)
{
if(CarInfo == 0)
{
car = h;
h = 9999;
}
}
format(string, sizeof(string),"LARP/Vehicles/%d.ini",car)
dini_Create(string);
if(PlayerInfo == 9999) { PlayerInfo = car; }
else if(PlayerInfo == 9999) { PlayerInfo = car; }
else if(PlayerInfo == 9999) { PlayerInfo = car; }
else { return 1; }
CarInfo = 1;
strmid(CarInfo, sendername, 0, strlen(sendername), 999);
SafeGivePlayerMoney(playerid,-GetVehiclePrice(idcar));
if(IsModelAPlane(idcar) || IsModelAHeli(idcar))
{
CarInfo = 1432.6451;
CarInfo = 1378.7216;
CarInfo = 11.5507;
CarInfo = 359.2072;
SendClientMessage(playerid, COLOR_YELLOW2, "Your Aircraft has been deliveried to Las Venturas Airport, you can get it there!");
SendClientMessage(playerid, COLOR_YELLOW2, "Your vehicle is unlocked so you can pay someone to deliver it to your new spawn point!");
SendClientMessage(playerid, COLOR_NICERED, "REMEMBER: Leaving your car in the deliver point can get your car SOLD by an administration without refund!");
GameTextForPlayer(playerid, "~p~Congratulations~n~~w~Don't forget to pickup your car at the ~b~Las Venturas Airport!", 5000, 3);
}
else if(IsModelABoat(idcar))
{
CarInfo = -1568.9614;
CarInfo = 169.0118;
CarInfo = -0.6016;
CarInfo = 208.7506;
SendClientMessage(playerid, COLOR_YELLOW2, "Your Boat has been deliveried to San Fierro Docks, you can get it there!");
SendClientMessage(playerid, COLOR_YELLOW2, "Your vehicle is unlocked so you can pay someone to deliver it to your new spawn point!");
SendClientMessage(playerid, COLOR_NICERED, "REMEMBER: Leaving your car in the deliver point can get your car SOLD by an administration without refund!");
GameTextForPlayer(playerid, "~p~Congratulations~n~~w~Don't forget to pickup your car at the ~b~San Fierro Docks!", 5000, 3);
}
else
{
CarInfo = -1589.2644;
CarInfo = 106.9119;
CarInfo = 3.5495;
CarInfo = 317.1649;
SendClientMessage(playerid, COLOR_YELLOW2, "Your vehicle has been deliveried to San Fierro Docks, you can get it there!");
SendClientMessage(playerid, COLOR_YELLOW2, "Your vehicle is unlocked so you can pay someone to deliver it to your new spawn point!");
SendClientMessage(playerid, COLOR_NICERED, "REMEMBER: Leaving your car in the deliver point can get your car SOLD by an administration without refund!");
GameTextForPlayer(playerid, "~p~Congratulations~n~~w~Don't forget to pickup your car at the ~b~San Fierro Docks!", 5000, 3);
}
CarInfo = model;
CarInfo = 0;
CarInfo = 999;
CarInfo = 1;
CarInfo = 1;
CarInfo = 0;
CarInfo = 0;
CarInfo = 0;
CarInfo = 0;
CarInfo = 0;
CarInfo = 0;
CarInfo = 0;
CarInfo = 0;
CarInfo = 0;
CarInfo = 0;
CarInfo = 0;
CarInfo = 0;
CarInfo = 0;
CarInfo = 0;
//DestroyVehicle(car);
ownedcar = CreateVehicle(CarInfo,CarInfo,CarInfo,CarInfo,90.0,1,1,30000);
PlayerPlayMusic(playerid);
SendClientMessage(playerid, COLOR_GRAD2, "Congratulations on your new purchase!");
SendClientMessage(playerid, COLOR_GRAD2, "Type /vehiclehelp to view the vehicle manual!");
gEngine = 0;
engineOn[GetPlayerVehicleID(playerid)] = false;
SendClientMessage(playerid, COLOR_GREY, "Remember to set the new Security Code of the Car (/v setcode)!");
new pass;
format(pass, sizeof(pass),"%d%d%d",random(9),random(9),random(9));
CarInfo = strval(pass);
OnPropUpdate(4,car);
OnPlayerUpdateEx(playerid);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "* For security reasons, a Driving License is needed to buy a car!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You don't have enough cash with you ! ");
return 1;
}
}
}