Jump to content

SA-MP comanda /carplate bug


MrRaresss
 Share

Recommended Posts

am si eu o problema la comanda /carplate de pe gamemode-ul hpq123 

cand folosesc aceasta comanda imi spune ca Numarul de inmatriculare a fost salvat. Acesta se va pune automat la urmatorul respawn al vehiculului, totul bine pana aici , dar daca folosesc comanda /park imi spune ca nu sunt intr-un vehicul personal 

Mai jos aveti comanda 

YCMD:carplate(playerid, params[], help) {
    new string[128], plate[10];
    new car = GetPlayerVehicleID(playerid);
    if(Iter_Count(MyVehicle[playerid]) == 0) 
        return SendClientMessage(playerid, COLOR_ERROR, "Eroare: {FFFFFF}Nu ai un vehicul personal!");

    if(sscanf(params, "s[10]", plate)) 
        return SendClientMessage(playerid, COLOR_GREY, "Syntax: {FFFFFF}/carplate <Car Plate>");

    if(GetPersonalCar(playerid, car) == -1) 
        return SendClientMessage(playerid, COLOR_ERROR, "Eroare: {FFFFFF}Nu esti in unul dintre vehiculele tale personale!");

    new idd = PersonalCar(playerid);
    if(strfind(plate, "'", true) != -1 || strfind(plate, "Model", true) != -1 || strfind(plate, "`", true) != -1) 
        return SendClientMessage(playerid, -1, "Caractere invalide!");

    if(strlen(plate) > 10) 
        return SendClientMessage(playerid, -1, "Numarul de inmatriculare poate avea maxim 10 caractere!");

    if(idd == 0) 
        return SendClientMessage(playerid, -1, "Acest vehicul nu iti apartine!");

    if(CarInfo[idd][Spawned] == 0) 
        return SendClientMessage(playerid, COLOR_LGREEN, "Eroare: Vehiculul tau nu este spawnat!");

    if(PlayerMoney(playerid, 5000)) 
        return SendClientMessage(playerid, COLOR_GREY, "Nu ai $5,000!");

    SetVehicleNumberPlate(CarInfo[idd][Spawned], plate);
    GivePlayerCash(playerid, 0, 5000);
    BizzInfo[16][bBalance] += 5000;
    format(string, sizeof(string), "Numarul de inmatriculare a fost salvat. Acesta se va pune automat la urmatorul respawn al vehiculului");
    SendClientMessage(playerid, COLOR_LGREEN, string);
    format(string, sizeof(string), "%s", plate);
    if(PlayerInfo[playerid][pPremiumAccount] != 0) format(CarInfo[idd][cLicense], 100, "{FF0000}%s", plate);
    if(PlayerInfo[playerid][pVip] != 0) format(CarInfo[idd][cLicense], 100, "{F0B548}%s", plate);
    else format(CarInfo[idd][cLicense], 100, "%s", plate);
    mysql_format(SQL, string, sizeof(string), "UPDATE cars SET License='%s' WHERE ID=%d", plate, CarInfo[idd][cID]);
    mysql_tquery(SQL, string, "", "");
    mysql_format(SQL, string, sizeof(string), "UPDATE bizz SET Till = %d WHERE ID = %d",BizzInfo[16][bBalance],5);
    mysql_tquery(SQL, string, "", "");
    return true;
}

Edited by MrRaresss
Link to comment
Share on other sites

YCMD:carplate(playerid, params[], help) {
    new string[128], plate[10];
    new car = GetPlayerVehicleID(playerid);
    new idd = PersonalCar(playerid);

    if(Iter_Count(MyVehicle[playerid]) == 0) {
        SendClientMessage(playerid, COLOR_ERROR, "Eroare: Nu ai un vehicul personal!");
        return 0;
    }

    if(sscanf(params, "s[10]", plate) != 1) {
        SendClientMessage(playerid, COLOR_GREY, "Syntax: /carplate <Car Plate>");
        return 0;
    }

    if(GetPersonalCar(playerid, car) == -1) {
        SendClientMessage(playerid, COLOR_ERROR, "Eroare: Nu esti in unul dintre vehiculele tale personale!");
        return 0;
    }

    if(idd == 0) {
        SendClientMessage(playerid, -1, "Acest vehicul nu iti apartine!");
        return 0;
    }

    if(strfind(plate, "'", true) != -1 || strfind(plate, "Model", true) != -1 || strfind(plate, "`", true) != -1) {
        SendClientMessage(playerid, -1, "Caractere invalide!");
        return 0;
    }

    if(strlen(plate) > 10) {
        SendClientMessage(playerid, -1, "Numarul de inmatriculare poate avea maxim 10 caractere!");
        return 0;
    }

    if(CarInfo[idd][Spawned] == 0) {
        SendClientMessage(playerid, COLOR_LGREEN, "Eroare: Vehiculul tau nu este spawnat!");
        return 0;
    }

    if(PlayerMoney(playerid, 5000) == 0) {
        SendClientMessage(playerid, COLOR_GREY, "Nu ai $5,000!");
        return 0;
    }

    SetVehicleNumberPlate(CarInfo[idd][Spawned], plate);
    GivePlayerCash(playerid, 0, 5000);
    BizzInfo[16][bBalance] += 5000;
    SendClientMessage(playerid, COLOR_LGREEN, "Numarul de inmatriculare a fost salvat. Acesta se va pune automat la urmatorul respawn al vehiculului.");
    if(PlayerInfo[playerid][pPremiumAccount] != 0) {
        format(CarInfo[idd][cLicense], 100, "{FF0000}%s", plate);
    } else if(PlayerInfo[playerid][pVip] != 0) {
        format(CarInfo[idd][cLicense], 100, "{F0B548}%s", plate);
    } else {
        format(CarInfo[idd][cLicense], 100, "%s", plate);
    }
    mysql_format(SQL, string, sizeof(string), "UPDATE cars SET License='%s'
    where ID=%d", plate, CarInfo[idd][cID]);
    mysql_tquery(SQL, string, "", "");
    mysql_format(SQL, string, sizeof(string), "UPDATE bizz SET Till = %d WHERE ID = %d", BizzInfo[16][bBalance], 5);
    mysql_tquery(SQL, string, "", "");
    return 1;
}

 

Link to comment
Share on other sites

15 hours ago, Cosmin1996 said:

YCMD:carplate(playerid, params[], help) {
    new string[128], plate[10];
    new car = GetPlayerVehicleID(playerid);
    new idd = PersonalCar(playerid);

    if(Iter_Count(MyVehicle[playerid]) == 0) {
        SendClientMessage(playerid, COLOR_ERROR, "Eroare: Nu ai un vehicul personal!");
        return 0;
    }

    if(sscanf(params, "s[10]", plate) != 1) {
        SendClientMessage(playerid, COLOR_GREY, "Syntax: /carplate <Car Plate>");
        return 0;
    }

    if(GetPersonalCar(playerid, car) == -1) {
        SendClientMessage(playerid, COLOR_ERROR, "Eroare: Nu esti in unul dintre vehiculele tale personale!");
        return 0;
    }

    if(idd == 0) {
        SendClientMessage(playerid, -1, "Acest vehicul nu iti apartine!");
        return 0;
    }

    if(strfind(plate, "'", true) != -1 || strfind(plate, "Model", true) != -1 || strfind(plate, "`", true) != -1) {
        SendClientMessage(playerid, -1, "Caractere invalide!");
        return 0;
    }

    if(strlen(plate) > 10) {
        SendClientMessage(playerid, -1, "Numarul de inmatriculare poate avea maxim 10 caractere!");
        return 0;
    }

    if(CarInfo[idd][Spawned] == 0) {
        SendClientMessage(playerid, COLOR_LGREEN, "Eroare: Vehiculul tau nu este spawnat!");
        return 0;
    }

    if(PlayerMoney(playerid, 5000) == 0) {
        SendClientMessage(playerid, COLOR_GREY, "Nu ai $5,000!");
        return 0;
    }

    SetVehicleNumberPlate(CarInfo[idd][Spawned], plate);
    GivePlayerCash(playerid, 0, 5000);
    BizzInfo[16][bBalance] += 5000;
    SendClientMessage(playerid, COLOR_LGREEN, "Numarul de inmatriculare a fost salvat. Acesta se va pune automat la urmatorul respawn al vehiculului.");
    if(PlayerInfo[playerid][pPremiumAccount] != 0) {
        format(CarInfo[idd][cLicense], 100, "{FF0000}%s", plate);
    } else if(PlayerInfo[playerid][pVip] != 0) {
        format(CarInfo[idd][cLicense], 100, "{F0B548}%s", plate);
    } else {
        format(CarInfo[idd][cLicense], 100, "%s", plate);
    }
    mysql_format(SQL, string, sizeof(string), "UPDATE cars SET License='%s'
    where ID=%d", plate, CarInfo[idd][cID]);
    mysql_tquery(SQL, string, "", "");
    mysql_format(SQL, string, sizeof(string), "UPDATE bizz SET Till = %d WHERE ID = %d", BizzInfo[16][bBalance], 5);
    mysql_tquery(SQL, string, "", "");
    return 1;
}

 

pai ce ai modificat tu aici?

Edited by MrRaresss
e fix aceasi comanda defapt mai proasta nici nu mai merge iti zice ca nu ai 5k chiar daca eu am, bine nu e asta problema dar nu e scrisa bine
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...