31.10.2018, 20:05
Quote:
Entгo o problema estar no CarData, que й a funзгo que vocк define o nome e a placa do veнculo que serб carregada.
Tente anexar aqui o CarData e onde a placa e o nome do carro й setado dentro das respectivas variбveis. |
Code:
enum carData { carID, carExists, carModel, carOwner, Float:carPos[4], carColor1, carColor2, carSpawn, carPaintjob, carLocked, carMods[14], carImpounded, carImpoundPrice, carFaction, carSiren, carWeapons[5], carAmmo[5], carPlate, carVehicle }; stock GetCar_Plate(plate) { for (new i = 0; i != MAX_DYNAMIC_CARS; i ++) if(CarData[i][carExists] && CarData[i][carPlate] == plate){ return i; } return -1; } stock SetVehiclePlaca(id) { const len = 7; new plate[len+1]; for (new i = 0; i < len; i++) { if (random(1)) { plate[i] = '0' + random(10); } else if (random(3)) // letter or number? { // letter plate[i] = 'A' + random(26); } else { // number plate[i] = '0' + random(10); } } format(CarData[id][carPlaca], 8, plate); SetVehicleNumberPlate(CarData[id][carVehicle], plate); CarData[id][carPlaca] = plate; Car_Save(id); printf("Placa: %d - %s", id, plate); }
Code:
CMD:checarplaca(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid); if (GetFactionType(playerid) != FACTION_POLICE) return SendErrorMessage(playerid, "Vocк nгo й um policial."); if (Car_Nearest(playerid) != vehicleid) return SendErrorMessage(playerid, "Vocк nгo estб perto de um veнculo."); SendClientMessageEx(playerid, COLOR_WHITE, "%s (Placa: %d)", ReturnVehicleModelName(CarData[vehicleid][carModel]), CarData[vehicleid][carPlate]); return 1; }