18.10.2010, 22:17
I just wanted to test some stuff before do something with this code, but for some reason it allways returns ID -1 and the distance its like 11600(and then numbers that changes) even when im inside the car it gives a really long number, isnt supossed when im very closer to the car it must have distance 0 or something?....
if (strcmp(cmdtext, "/test", true)==0)
{
new carids = GetClosestCar(playerid);
new Float:dist= GetDistanceFromPlayerToVehicle(playerid,carids);
new stringa[256];
format(stringa, sizeof stringa, "Distancia a vehiculo mas cercano: %i Id:[%i]", dist,carids);
SendClientMessage(playerid, 0xCCFFDD56, stringa);
return 1;
}
if (strcmp(cmdtext, "/test", true)==0)
{
new carids = GetClosestCar(playerid);
new Float:dist= GetDistanceFromPlayerToVehicle(playerid,carids);
new stringa[256];
format(stringa, sizeof stringa, "Distancia a vehiculo mas cercano: %i Id:[%i]", dist,carids);
SendClientMessage(playerid, 0xCCFFDD56, stringa);
return 1;
}