Selling a Car
#10

Ohhhhhhh I only pasted the necessary part of the /sellcar command.
And after I added the suggestion.

LIKE THIS:
pawn Код:
public IsAMAXerCar(vehicleid)
{
    new maxcar = GetVehicleModel(vehicleid);
    if(maxcar == 400 || maxcar == 404 || maxcar == 413 || maxcar == 418 || maxcar == 479 || maxcar == 482 || maxcar == 491 || maxcar == 518,
    maxcar == 543 || maxcar == 547 || maxcar == 554 || maxcar == 561 || maxcar == 600 || maxcar == 421 || maxcar == 422 || maxcar == 458,
    maxcar == 474 || maxcar == 483 || maxcar == 489 || maxcar == 500 || maxcar == 507 || maxcar == 516 || maxcar == 527 || maxcar == 533,
    maxcar == 549 || maxcar == 551 || maxcar == 402 || maxcar == 409 || maxcar == 424 || maxcar == 434 || maxcar == 445 || maxcar == 447,
    maxcar == 453 || maxcar == 463 || maxcar == 484 || maxcar == 545 || maxcar == 555 || maxcar == 595 || maxcar == 568 || maxcar == 519,
    maxcar == 423 || maxcar == 580)
    {
         return 1;
    }
    return 0;
}
It's still allowing the sales of the VIP Vehicles.

ENTIRE /sellcar COMMAND
pawn Код:
if(strcmp(cmd, "/sellcar", true) == 0)
    {
        //if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You must be in a vehicle to use this command!");

        new
            ivID = GetPlayerVehicleID(playerid),
            Float:Pos[4];

        GetVehiclePos(ivID, Pos[0], Pos[1], Pos[2]);
        GetVehicleZAngle(ivID, Pos[3]);

        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            return SendClientMessage(playerid, COLOR_WHITE, "{00FF00}Usage:{FFFFFF} /sellcar <playerid/PartOfName> <price>");
        }
        giveplayerid = ReturnUser(tmp);
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            return SendClientMessage(playerid, COLOR_WHITE, "{00FF00}Usage:{FFFFFF} /sellcar <playerid/PartOfName> <price>");
        }
        moneys = strvalEx(tmp);
        if(moneys >= 1) {} else return 1;
        if(IsAMAXerCar(ivID)) return SendClientMessage(playerid,-1,"You may not sell MAXer vehicles.");
        if(OwnedVeh(ivID) != 0)
        {
            if(strmatch(vInfo[OwnedVeh(ivID)][vOwner], pName(playerid)))
            {
                new sendernamen[MAX_PLAYER_NAME];
                GetPlayerName(giveplayerid, sendernamen, sizeof(sendernamen));
                /*new car1=0, car2=0, car3=0, carnr = 0;
                for(new i=0; i<MAX_VEHICLES; i++)
                {
                    if(strmatch(vInfo[OwnedVeh(i)][vOwner], sendernamen))
                    {
                        if(car1 == 0) { car1 = i; carnr ++; continue; }
                        else if(car2 == 0) { car2 = i; carnr ++; continue; }
                        else if(car3 == 0) { car3 = i; carnr ++; continue; }
                    }
                }
                if(PlayerInfo[giveplayerid][pAdmin] < 1)
                {
                    if(GetVehicleType(ivID) == 1 && GetVehicleType(car1) == 1 || GetVehicleType(ivID) == 1 && GetVehicleType(car2) == 1 || GetVehicleType(ivID) == 1 && GetVehicleType(car3) == 1) return SendClientMessage(playerid, COLOR_WHITE, "{DC0C0C}Car: {FFFFFF}That player already has a car!");

                    if(GetVehicleType(ivID) == 2 && GetVehicleType(car1) == 2 || GetVehicleType(ivID) == 2 && GetVehicleType(car2) == 2 || GetVehicleType(ivID) == 2 && GetVehicleType(car3) == 2 || GetVehicleType(ivID) == 3 && GetVehicleType(car1) == 3 || GetVehicleType(ivID) == 3 && GetVehicleType(car2) == 3
                    || GetVehicleType(ivID) == 3 && GetVehicleType(car3) == 3) return SendClientMessage(playerid, COLOR_WHITE, "{DC0C0C}Bike: {FFFFFF}That player already has a bike!");

                    if(GetVehicleType(ivID) == 4 && GetVehicleType(car1) == 4 || GetVehicleType(ivID) == 4 && GetVehicleType(car2) == 4 || GetVehicleType(ivID) == 4 && GetVehicleType(car3) == 4 || GetVehicleType(ivID) == 5 && GetVehicleType(car1) == 5 || GetVehicleType(ivID) == 5 && GetVehicleType(car2) == 5
                    || GetVehicleType(ivID) == 5 && GetVehicleType(car3) == 5 || GetVehicleType(ivID) == 9 && GetVehicleType(car1) == 9 || GetVehicleType(ivID) == 9 && GetVehicleType(car2) == 9 || GetVehicleType(ivID) == 9 && GetVehicleType(car3) == 9) return SendClientMessage(playerid, COLOR_WHITE, "{DC0C0C}Vehicle: {FFFFFF}That player already has a boat / plane!");
                }

                if(PlayerInfo[giveplayerid][pCar1] != 0 && PlayerInfo[giveplayerid][pCar2] != 0 && PlayerInfo[giveplayerid][pCar3] != 0) return SendClientMessage(playerid, COLOR_WHITE, "{DC0C0C}That player already has 3 cars!");*/

                if(PlayerInfo[playerid][pLevel] >= 3) {} else return SendClientMessage(playerid, COLOR_WHITE, "{DC0C0C}Masina: {FFFFFF}You need level 3 to sell a vehicle!");
                new sendername1[MAX_PLAYERS];
                GetPlayerName(giveplayerid, sendername1, sizeof(sendername1));
                GetPlayerName(playerid, sendername, sizeof(sendername));
                OwnableCarOffer[giveplayerid] = playerid;
                OwnableCarID[giveplayerid] = GetPlayerVehicleID(playerid);
                OwnableCarPrice[giveplayerid] = moneys;
                format(string, sizeof(string), "{DC0C0C}Personal Vehicle: {FFFFFF}%s wants to sell their vehicle for $%d. Type /accept vehicle to accept.", sendername, moneys);
                SendClientMessage(giveplayerid, COLOR_WHITE, string);
                format(string, sizeof(string), "{DC0C0C}Personal Vehicle: {FFFFFF}You asked %s to buy your car for $%d.", sendername1, moneys);
                SendClientMessage(playerid, COLOR_WHITE, string);
                return 1;
            }
            else return SendClientMessage(playerid, COLOR_RED, "{DC0C0C}Personal Vehicle: {FFFFFF}You don't own this vehicle!");
        }
        else return SendClientMessage(playerid, COLOR_RED, "{DC0C0C}Personal Vehicle: {FFFFFF}You can't sell this vehicle..");
    }
Reply


Messages In This Thread
Selling a Car Malfunction - by DJ_Shocker - 23.01.2013, 20:23
Re: Selling a Car - by DJ_Shocker - 23.01.2013, 21:52
Re: Selling a Car - by FUNExtreme - 23.01.2013, 22:19
Re: Selling a Car - by DJ_Shocker - 23.01.2013, 22:36
Re: Selling a Car - by DJ_Shocker - 23.01.2013, 23:05
Re: Selling a Car - by Shabi RoxX - 23.01.2013, 23:56
Re: Selling a Car Malfunction - by AphexCCFC - 24.01.2013, 00:06
Re: Selling a Car Malfunction - by DJ_Shocker - 24.01.2013, 00:08
Re: Selling a Car - by AphexCCFC - 24.01.2013, 00:15
Re: Selling a Car - by DJ_Shocker - 24.01.2013, 00:21

Forum Jump:


Users browsing this thread: 2 Guest(s)