04.04.2016, 18:12
Hey guys,
So I was working on my plate check system for LEO factions and I stumbled upon a problem, sure the system complies correctly but the only problem I have with it is that I made some test vehicles to test it, but when I type in the plate I want to check, it comes up with the first vehicle that was spawned with its plate and owner information and won't find the plate that matches to the text someone had typed into the command, I don't know what the problem is so I was wondering if any of you experts know whats wrong with the command.
Here is the code:
So I was working on my plate check system for LEO factions and I stumbled upon a problem, sure the system complies correctly but the only problem I have with it is that I made some test vehicles to test it, but when I type in the plate I want to check, it comes up with the first vehicle that was spawned with its plate and owner information and won't find the plate that matches to the text someone had typed into the command, I don't know what the problem is so I was wondering if any of you experts know whats wrong with the command.
Here is the code:
Код:
CMD:sdpc(playerid, params[]) { new string[128]; if(isnull(params)) return SendClientMessage(playerid, COLOUR_WHITE, "SYNTAX: /sdpc [Plate]"); new vehid = FindVehicleByPlate(params); if(vehid == 0) return SendClientMessage(playerid, COLOUR_WHITE, "Invaild Plate"); SendClientMessage(playerid, COLOUR_WHITE, "Bone County Dept. of Motor Vehicles"); format(string, sizeof(string), "Owner: %s", CarInfo[vehid][cOwner]); SendClientMessage(playerid, COLOUR_WHITE, string); format(string, sizeof(string), "Plate: %s", CarInfo[vehid][cPlate]); SendClientMessage(playerid, COLOUR_WHITE, string); return 1; } stock FindVehicleByPlate(plate[]) { for(new i = 1; i < MAX_VEHICLES; i++) { if(strcmp(CarInfo[i][cPlate], plate, true)) { return i; } } return 0; }