25.01.2015, 14:45
Hi guys, I have some mismatches on codes I recently found on this website.
pawn Код:
NajblizaBenzinskaPumpa(playerid) // closest gas station
{
new benzaid, Float:distance = 99999.0, Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
for(new i = 0; i <MAX_FIRMI; i++)
{
if(FirmaInfo[i][Vrsta] == 1)
{
new Float:tempdist;
tempdist = GetDistanceBetween(x, y, z, FirmaInfo[i][EXTX], FirmaInfo[i][EXTY], FirmaInfo[i][EXTZ]); // I have 6 mismatches at this line
if(tempdist < distance)
{
distance = tempdist;
benzaid = i;
}
}
}
return benzaid;
}
GetDistanceBetween(x1, y1, z1, x2, y2, z2)
{
new Float:dist;
dist = floatsqroot(floatpower(floatsub(x2, x1), 2) + floatpower(floatsub( y2, y1), 2) + floatpower(floatsub( z2, z1), 2));
return dist; // mismatch
}