Jump to content
  • 0

Problema /selltods


opy

Question

Uneori cand folosesc comanda /selltods (sellcar) imi spune ca nu am nicio masina, alteori le pot vinde pe toate fara probleme, nu stiu unde este problema. Sa pun si publiul InsertCar?

Comanda /selltods:

Citat

CMD:selltods(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(IsPlayerConnected(playerid))
    {
        if(PlayerInfo[playerid][pPcarkey] == 0 && PlayerInfo[playerid][pmotokey] == 0 && PlayerInfo[playerid][phelikey] == 0 && PlayerInfo[playerid][pprcarkey] == 0) return SendClientMessage(playerid,COLOR_WHITE,"{FFB870}You do not have a vehicle.");
        if(!IsPlayerInRangeOfPoint(playerid, 10.0, 328.3534,-1513.1687,36.0391)) return SCM(playerid,COLOR_WHITE,"{FFB870}You're at the place where you can sell your car.");
        new vehh = GetPlayerVehicleID(playerid);
        if(vehh == personalcar[0][playerid])
        {
            new idc = OwnedVeh(personalcar[0][playerid]);
            if(CarInfo[idc][cModel] == 539 || CarInfo[idc][cModel] == 502 || CarInfo[idc][cModel] == 503 || CarInfo[idc][cModel] == 494 || CarInfo[idc][cModel] == 487 || CarInfo[idc][cModel] == 447) return SendClientMessage(playerid, COLOR_WHITE, "This car can't be sold to the DealerShip.");
            new cashveh,string[80];
            CarID[playerid] = personalcar[0][playerid];
             cashveh = floatround(floatmul(CarInfo[OwnedVeh(personalcar[0][playerid])][cValue],0.60),floatround_ceil);
            format(string,sizeof(string),"Are you sure you sell your car for $%s?",FormatNumber(cashveh));
            ShowPlayerDialog(playerid, DIALOG_CARSELL, DIALOG_STYLE_MSGBOX, "Sellcar:", string, "Yes", "No");
        }
        if(vehh == personalcar[1][playerid])
        {
            new idc = OwnedVeh(personalcar[1][playerid]);
            if(CarInfo[idc][cModel] == 539 || CarInfo[idc][cModel] == 502 || CarInfo[idc][cModel] == 503 || CarInfo[idc][cModel] == 494 || CarInfo[idc][cModel] == 487 || CarInfo[idc][cModel] == 447) return SendClientMessage(playerid, COLOR_WHITE, "This car can't be sold to the DealerShip.");
            new cashveh,string[80];
            CarID[playerid] = personalcar[1][playerid];
             cashveh = floatround(floatmul(CarInfo[OwnedVeh(personalcar[1][playerid])][cValue],0.60),floatround_ceil);
            format(string,sizeof(string),"Are you sure you sell your car for $%s?",FormatNumber(cashveh));
            ShowPlayerDialog(playerid, DIALOG_CARSELL, DIALOG_STYLE_MSGBOX, "Sellcar:", string, "Yes", "No");
        }
        if(vehh == personalcar[2][playerid])
        {
            new idc = OwnedVeh(personalcar[2][playerid]);
            if(CarInfo[idc][cModel] == 539 || CarInfo[idc][cModel] == 502 || CarInfo[idc][cModel] == 503 || CarInfo[idc][cModel] == 494 || CarInfo[idc][cModel] == 487 || CarInfo[idc][cModel] == 447) return SendClientMessage(playerid, COLOR_WHITE, "This car can't be sold to the DealerShip.");
            new cashveh,string[80];
            CarID[playerid] = personalcar[2][playerid];
             cashveh = floatround(floatmul(CarInfo[OwnedVeh(personalcar[2][playerid])][cValue],0.60),floatround_ceil);
            format(string,sizeof(string),"Are you sure you sell your car for $%s?",FormatNumber(cashveh));
            ShowPlayerDialog(playerid, DIALOG_CARSELL, DIALOG_STYLE_MSGBOX, "Sellcar:", string, "Yes", "No");
        }
        if(vehh == personalcar[3][playerid])
        {
            new idc = OwnedVeh(personalcar[3][playerid]);
            if(CarInfo[idc][cModel] == 539 || CarInfo[idc][cModel] == 502 || CarInfo[idc][cModel] == 503 || CarInfo[idc][cModel] == 494 || CarInfo[idc][cModel] == 487 || CarInfo[idc][cModel] == 447) return SendClientMessage(playerid, COLOR_WHITE, "This car can't be sold to the DealerShip.");
            new cashveh,string[80];
            CarID[playerid] = personalcar[3][playerid];
             cashveh = floatround(floatmul(CarInfo[OwnedVeh(personalcar[3][playerid])][cValue],0.60),floatround_ceil);
            format(string,sizeof(string),"Are you sure you sell your car for $%s?",FormatNumber(cashveh));
            ShowPlayerDialog(playerid, DIALOG_CARSELL, DIALOG_STYLE_MSGBOX, "Sellcar:", string, "Yes", "No");
        }
        if(vehh == personalcar[4][playerid])
        {
            new idc = OwnedVeh(personalcar[4][playerid]);
            if(CarInfo[idc][cModel] == 539 || CarInfo[idc][cModel] == 502 || CarInfo[idc][cModel] == 503 || CarInfo[idc][cModel] == 494 || CarInfo[idc][cModel] == 487 || CarInfo[idc][cModel] == 447) return SendClientMessage(playerid, COLOR_WHITE, "This car can't be sold to the DealerShip.");
            new cashveh,string[80];
            CarID[playerid] = personalcar[4][playerid];
             cashveh = floatround(floatmul(CarInfo[OwnedVeh(personalcar[4][playerid])][cValue],0.60),floatround_ceil);
            format(string,sizeof(string),"Are you sure you sell your car for $%s?",FormatNumber(cashveh));
            ShowPlayerDialog(playerid, DIALOG_CARSELL, DIALOG_STYLE_MSGBOX, "Sellcar:", string, "Yes", "No");
        }
        if(vehh == personalcar[5][playerid])
        {
            new idc = OwnedVeh(personalcar[5][playerid]);
            if(CarInfo[idc][cModel] == 539 || CarInfo[idc][cModel] == 502 || CarInfo[idc][cModel] == 503 || CarInfo[idc][cModel] == 494 || CarInfo[idc][cModel] == 487 || CarInfo[idc][cModel] == 447) return SendClientMessage(playerid, COLOR_WHITE, "This car can't be sold to the DealerShip.");
            new cashveh,string[80];
            CarID[playerid] = personalcar[5][playerid];
             cashveh = floatround(floatmul(CarInfo[OwnedVeh(personalcar[5][playerid])][cValue],0.60),floatround_ceil);
            format(string,sizeof(string),"Are you sure you sell your car for $%s?",FormatNumber(cashveh));
            ShowPlayerDialog(playerid, DIALOG_CARSELL, DIALOG_STYLE_MSGBOX, "Sellcar:", string, "Yes", "No");
        }
        else if(vehh != personalcar[0][playerid] && vehh != personalcar[1][playerid] && vehh != personalcar[2][playerid] && vehh != personalcar[3][playerid] && vehh != personalcar[4][playerid] && vehh != personalcar[5][playerid])
            return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}You have to sit at your own car to sell it.");
    }
    return 1;
}

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.