05.02.2015, 20:10
Okay, So I want it to search for a house thats within 2500..
But it just keeps giving the same house...... Literally 35 attempts it gives the same place.
But it just keeps giving the same house...... Literally 35 attempts it gives the same place.
Код:
getClosestPizzaDelivery(playerid) { new Float:pDistance; new index; for(new i=0;i<sizeof(Houses);i++) { pDistance = GetPlayerDistanceFromPoint(playerid, Houses[i][EHouseX], Houses[i][EHouseY], Houses[i][EHouseZ]); if(pDistance > random(2500)) { continue; } index = i; } SetPVarFloat(playerid, "PizzaTravelDistance", pDistance); return index; }