Code help?
#1

Help me with this code, It is for a friend, He needs pPcarkey3 adding.
pawn Код:
else if(strcmp(x_nr,"buy",true) == 0)
            {
                new car = 184;
                new model = GetVehicleModel(idcar);
                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] == 999 || PlayerInfo[playerid][pPcarkey2] == 999) { }
                    else return SendClientMessage(playerid, COLOR_GREY,"* You already own Two cars!");
                    if(GetPlayerMoney(playerid) >= GetVehiclePrice(idcar))
                    {
                        if(PlayerInfo[playerid][pCarLic] == 1)
                        {
                            for(new h = 184; h < sizeof(CarInfo); h++)
                            {
                                if(CarInfo[h][cOwned] == 1)
                                {
                                    car = h + 1;
                                }
                            }
                            if(PlayerInfo[playerid][pPcarkey] != 999) { 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))
                            {
                                CarInfo[car][cLocationx] = 1432.6451;
                                CarInfo[car][cLocationy] = 1378.7216;
                                CarInfo[car][cLocationz] = 11.5507;
                                CarInfo[car][cAngle] = 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!");
                            }
                            else if(IsModelABoat(idcar))
                            {
                                CarInfo[car][cLocationx] = -1568.9614;
                                CarInfo[car][cLocationy] = 169.0118;
                                CarInfo[car][cLocationz] = -0.6016;
                                CarInfo[car][cAngle] = 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!");
                            }
                            else
                            {
                                CarInfo[car][cLocationx] = -1589.2644;
                                CarInfo[car][cLocationy] = 106.9119;
                                CarInfo[car][cLocationz] = 3.5495;
                                CarInfo[car][cAngle] = 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!");
                            }
                            CarInfo[car][cModel] = model;
                            CarInfo[car][cVirWorld] = 0;
                            DestroyVehicle(car);
                            CreateVehicle(CarInfo[car][cModel],CarInfo[car][cLocationx],CarInfo[car][cLocationy],CarInfo[car][cLocationz],90.0,1,1,30000);
                            PlayerPlayMusic(playerid);
                            GameTextForPlayer(playerid, "~w~Congratulations~n~Don't forget to /v park it!", 5000, 3);
                            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)] = false;
                            DateProp(playerid);
                            OnPropUpdate(4);
                            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;
                    }
                }
Please help
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)