Chance of something to occur - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Chance of something to occur (
/showthread.php?tid=496693)
Chance of something to occur -
CriticalRP - 23.02.2014
I'm currently working on a looting system and I want to limit the chance of rare items to be spawned. Can someone give me an idea of how to do so?
Re: Chance of something to occur -
Vince - 23.02.2014
pawn Код:
if(random(10) == 1)
{
// 10% chance
}
Re: Chance of something to occur -
CriticalRP - 23.02.2014
Thank you Vince! I already thought of using random just wasn't sure about it.