MDC wont find vehicle plates! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MDC wont find vehicle plates! (
/showthread.php?tid=446471)
MDC wont find vehicle plates! -
OpticKiller - 26.06.2013
Well a friend of mine called vyper who scripted this. anyways its a police MDC System that can track vehicle speed and the vehicle plates etc the issue am having is am using the AVS dynamic dealership system and this AVS as a plate system witch is good. everything is fine with the vehicle speed it finds but the issue is it will not find the number plate on the dash cam here is the video below
Код:
forward UpdateDashCam(playerid);
public UpdateDashCam(playerid)
{
new i;
if(!IsPlayerInAnyVehicle(playerid)) return 0x1;
if(IsACopCar(playerid))
{
new pcv = GetNearestVehicle(playerid, dcam_Distance);
new pvid = GetPlayerVehicleID(playerid);
new Float:vPos[3];
GetVehiclePos(pvid, vPos[0], vPos[1], vPos[2]);
new Float:distance = GetVehicleDistanceFromPoint(pcv, vPos[0], vPos[1], vPos[2]);
new Float:speed = GetVehicleSpeed(pcv, 0);
new string[40];
if(floatround(distance) <= dcam_Distance - 5.0)
{
format(string, sizeof(string), "P %s~n~S %d kmph~n~D %d m", VehicleNumberPlate[i], floatround(speed), floatround(distance));
}
else format(string, sizeof(string), "P N/A~n~S N/A kmph~n~D N/A m");
PlayerTextDrawSetString(playerid, pDashCam[playerid], string);
}
return 0x1;
}
i think this is the issue with it not finding i dont know what to change it to.
Код:
VehicleNumberPlate[i]
[ame="http://www.youtube.com/watch?v=a3q2voEmDKk"]http://www.youtube.com/watch?v=a3q2voEmDKk[/ame]
Re: MDC wont find vehicle plates! -
OpticKiller - 26.06.2013
Bump!
Re: MDC wont find vehicle plates! -
Cjgogo - 26.06.2013
I think this should do it:
pawn Код:
forward UpdateDashCam(playerid);
public UpdateDashCam(playerid)
{
if(!IsPlayerInAnyVehicle(playerid)) return 0x1;
if(IsACopCar(playerid))
{
new pcv = GetNearestVehicle(playerid, dcam_Distance);
new pvid = GetPlayerVehicleID(playerid);
new Float:vPos[3];
GetVehiclePos(pvid, vPos[0], vPos[1], vPos[2]);
new Float:distance = GetVehicleDistanceFromPoint(pcv, vPos[0], vPos[1], vPos[2]);
new Float:speed = GetVehicleSpeed(pcv, 0);
new string[40];
if(floatround(distance) <= dcam_Distance - 5.0)
{
format(string, sizeof(string), "P %s~n~S %d kmph~n~D %d m", VehicleNumberPlate[pcv], floatround(speed), floatround(distance));
}
else format(string, sizeof(string), "P N/A~n~S N/A kmph~n~D N/A m");
PlayerTextDrawSetString(playerid, pDashCam[playerid], string);
}
return 0x1;
}
The thing is you didn't use "i" at all, only in "VehicleNumberPlate[i]", but as far as I am concerned, the vehicle's ID the code is looking for is "pcv", so try it now.
Re: MDC wont find vehicle plates! -
OpticKiller - 26.06.2013
thanks ill give it try if not work i will edit this post.