SA:MP Function - Something between random and probability?
#4

You enter % chance of from 1 to 99
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;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)