I need a little help it says on the last else line it need to be assumed zero but im not so good with it and i dont want to mess it up.
Код:
if(strcmp(cmd, "/vipbuy", true) == 0)
{
new car = 1;
new model = GetVehicleModel(idcar);
new carid;
carid = PlayerInfo[playerid][pPcarkey];
if(IsASalesVehicle(idcar))
{
if(PlayerInfo[playerid][pLevel] < 2)
{
SendClientMessage(playerid, COLOR_GREY, "You need to be level 2 to buy a vehicle!");
return 1;
}
if(PlayerInfo[playerid][pPcarkey] == 9999 || PlayerInfo[playerid][pPcarkey2] == 9999) { }
else return SendClientMessage(playerid, COLOR_GREY,"* You already own Two cars!");
if(GetPlayerMoney(playerid) >= GetVehiclePrice(idcar))
{
if(PlayerInfo[playerid][pCarLic] == 1)
{
for(new h = 1; h < sizeof(CarInfo); h++)
{
if(CarInfo[h][cOwned] == 0)
{
car = h;
h = 9999;
}
}
format(string, sizeof(string),"LARP/Vehicles/%d.ini",car)
dini_Create(string);
if(PlayerInfo[playerid][pPcarkey] != 9999) { PlayerInfo[playerid][pPcarkey2] = car; }
else { PlayerInfo[playerid][pPcarkey] = car; }
CarInfo[car][cOwned] = 1;
strmid(CarInfo[car][cOwner], sendername, 0, strlen(sendername), 999);
SafeGivePlayerMoney(playerid,-GetVehiclePrice(idcar));
if(IsModelAPlane(idcar) || IsModelAHeli(idcar))
{
new Float:x, Float:y, Float:z; // float variables x, y and z to use them in GetPlayerPos
GetPlayerPos(playerid, x, y, z); // gets the player's position and stores it into the variables we made
CarInfo[car][cLocationx] = x; // you can put x + 4 here if you want
CarInfo[car][cLocationy] = y;
CarInfo[car][cLocationz] = z;
CarInfo[car][cAngle] = 359.2072; // no need to change this
PutPlayerInVehicle(playerid, carid, 0);
SendClientMessage(playerid, COLOR_YELLOW2, "Good luck with your new Aircraft !");
}
else if(IsModelABoat(idcar))
{
new Float:x, Float:y, Float:z; // float variables x, y and z to use them in GetPlayerPos
GetPlayerPos(playerid, x, y, z); // gets the player's position and stores it into the variables we made
CarInfo[car][cLocationx] = x; // you can put x + 4 here if you want
CarInfo[car][cLocationy] = y;
CarInfo[car][cLocationz] = z;
CarInfo[car][cAngle] = 359.2072; // no need to change this
PutPlayerInVehicle(playerid, carid, 0);
SendClientMessage(playerid, COLOR_YELLOW2, "Good luck with your new Boat !");
}
else
{
new Float:x, Float:y, Float:z; // float variables x, y and z to use them in GetPlayerPos
GetPlayerPos(playerid, x, y, z); // gets the player's position and stores it into the variables we made
CarInfo[car][cLocationx] = x; // you can put x + 4 here if you want
CarInfo[car][cLocationy] = y;
CarInfo[car][cLocationz] = z;
CarInfo[car][cAngle] = 359.2072; // no need to change this
PutPlayerInVehicle(playerid, carid, 0);
SendClientMessage(playerid, COLOR_YELLOW2, "Good luck with your new Car !");
}
CarInfo[car][cModel] = model;
CarInfo[car][cVirWorld] = 0;
CarInfo[car][cPaintjob] = 999;
CarInfo[car][cColorOne] = 1;
CarInfo[car][cColorTwo] = 1;
CarInfo[car][cComponent0] = 0;
CarInfo[car][cComponent1] = 0;
CarInfo[car][cComponent2] = 0;
CarInfo[car][cComponent3] = 0;
CarInfo[car][cComponent4] = 0;
CarInfo[car][cComponent5] = 0;
CarInfo[car][cComponent6] = 0;
CarInfo[car][cComponent7] = 0;
CarInfo[car][cComponent8] = 0;
CarInfo[car][cComponent9] = 0;
CarInfo[car][cComponent10] = 0;
CarInfo[car][cComponent11] = 0;
CarInfo[car][cComponent12] = 0;
CarInfo[car][cComponent13] = 0;
DestroyVehicle(car);
ownedcar[car] = CreateVehicle(CarInfo[car][cModel],CarInfo[car][cLocationx],CarInfo[car][cLocationy],CarInfo[car][cLocationz],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[playerid] = 0;
engineOn[GetPlayerVehicleID(playerid)] = true;
new pass[24];
format(pass, sizeof(pass),"%d%d%d",random(9),random(9),random(9));
CarInfo[car][cCode] = 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;
}
}
}
return 1;
}