03.10.2015, 17:17
You enter % chance of from 1 to 99
If you give more, it returns true or if you give less, it returns false
If you give more, it returns true or if you give less, it returns false
Код:
bool:IsDropAllow(chance){ if(chance <= 0) return false; if(chance >= 100) return true; new los = random(100), drop = (0); for(new i = 0;i <= chance-1;i++){ if(los == i){ drop = (1); break; } } if(drop == 1) return true; return false; }