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;
}