Problem with buy able car and public.
#1

Well first my public.. I know why the error is comming but i dont remember what to put after.. The errors are
pawn Код:
C:\Users\new account\Desktop\Script\gamemodes\Script.pwn(2960) : warning 202: number of arguments does not match definition
C:\Users\new account\Desktop\Script\gamemodes\Script.pwn(2960) : warning 202: number of arguments does not match definition
C:\Users\new account\Desktop\Script\gamemodes\Script.pwn(2960) : warning 202: number of arguments does not match definition
C:\Users\new account\Desktop\Script\gamemodes\Script.pwn(2960) : warning 202: number of arguments does not match definition
C:\Users\new account\Desktop\Script\gamemodes\Script.pwn(2960) : warning 202: number of arguments does not match definition
C:\Users\new account\Desktop\Script\gamemodes\Script.pwn(2960) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


6 Warnings.
On this line
pawn Код:
CreateDynamicObject(objectid/*what to put here?*/);
And also when someone buy his second car it replaces his first one but i havent found a problem yet..
pawn Код:
else if(strcmp(x_nr,"buy",true) == 0)
            {
                new car = 1;
                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] == 9999 || PlayerInfo[playerid][pPcarkey2] == 9999 || PlayerInfo[playerid][pPcarkey3] == 9999) { }
                    else return SendClientMessage(playerid, COLOR_GREY,"* You already own three 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][pPcarkey] = car; }
                            else if(PlayerInfo[playerid][pPcarkey2] != 9999) { PlayerInfo[playerid][pPcarkey2] = car; }
                            else if(PlayerInfo[playerid][pPcarkey3] != 9999) { PlayerInfo[playerid][pPcarkey3] = 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] = 1775.156;
                                CarInfo[car][cLocationy] = -2488.442;
                                CarInfo[car][cLocationz] = 13.355;
                                CarInfo[car][cAngle] = 359.2072;
                                SendClientMessage(playerid, COLOR_YELLOW2, "Your Aircraft has been deliveried to Los Santos 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~Los Santos Airport!", 5000, 3);
                            }
                            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 Santos Unity Station, 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~Santos Unity Station!", 5000, 3);
                            }
                            else
                            {
                                CarInfo[car][cLocationx] = 1776.538;
                                CarInfo[car][cLocationy] = -1905.815;
                                CarInfo[car][cLocationz] = 13.212;
                                CarInfo[car][cAngle] = 317.1649;
                                SendClientMessage(playerid, COLOR_YELLOW2, "Your vehicle has been deliveried to Los Santos , Near The Taxi Company /findcar ID to find your car!");
                                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~Taxi Company!", 5000, 3);
                            }
                            CarInfo[car][cModel] = model;
                            CarInfo[car][cVirWorld] = 0;
                            CarInfo[car][cPaintjob] = 9999;

                            CarInfo[car][cColorOne] = 0;
                            CarInfo[car][cColorTwo] = 0;

                            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)] = false;
                            SendClientMessage(playerid, COLOR_GREY, "Remember to set the new Security Code of the Car!");
                            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;
                    }
                }
            }
Reply
#2

Quote:

modelid, Float, Float:y, Float:z, Float:rx, Float:ry, Float:rz

these arguments are obligatory
Reply
#3

Ah ok thanks, You know any solution on my buy car problem?
Reply
#4

pawn Код:
else if(PlayerInfo[playerid][pPcarkey2] != 9999) { PlayerInfo[playerid][pPcarkey2] = car; }
I'll assume that carkey equal 9999 is empty slot. So you need to check if
pawn Код:
else if(PlayerInfo[playerid][pPcarkey2] == 9999) { PlayerInfo[playerid][pPcarkey2] = car; }
(same for 1 and 3)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)