Math Help - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Math Help (
/showthread.php?tid=128862)
Math Help -
Grim_ - 20.02.2010
Hey, I need some help with math simply because I'm terrible at it. I need a way to make this system work out so the outcome with work somewhat according to the precentages, ect.
So, lets say I had a number (num_a). It has a 25% chance of doing a task (task_a). Now, we have a second number (num_b) that increases the chances of making that thing happen by 15%. Then, you have a number c (num_c) that is between 0 and 100. And depending on where that number is, it'll make the chances of task_a raise by x% depending on the value of num_c.
So, I'm wondering how this could all work together. Please respond if you have any input what so ever on the matter. If you need me to explain more I will be happy to do so.
Thanks.
Re: Math Help -
[HiC]TheKiller - 20.02.2010
Cant you just use randoms?
Code:
new Random = random(3);
if(Random == 2)
{
//25%
new R2 = random(5);
if(R2 == 4)
{
//20%
new r3 = random(100);
new r4 = random(100);
if(r4 >= r3)//Chooses a random percentage chance then a random #
{
//Done
}
}
}
Not sure if this would work (Just guessing from what you said).