31.12.2014, 14:32
I wanted to make a function that when called her, she calculated a random number of 100%
Ai would fall 1%, 10%, 40%, and always falling larger numbers, I do not know what I did wrong, but always falls 12:10!
Ai would fall 1%, 10%, 40%, and always falling larger numbers, I do not know what I did wrong, but always falls 12:10!
pawn Код:
public TestePCT(playerid) {
new Float: p = float(random(1000)/ 1000 * 100);
if(p <= 0.10)
{
SendClientMessage(playerid, -1, "0.10");
}
else if(p <= 1.90)
{
SendClientMessage(playerid, -1, "1.90");
}
else if(p <= 3.00)
{
SendClientMessage(playerid, -1, "3");
}
else if(p <= 5.00)
{
SendClientMessage(playerid, -1, "5");
}
else if(p <= 10.00)
{
SendClientMessage(playerid, -1, "10");
}
else if(p <= 15.00)
{
SendClientMessage(playerid, -1, "15");
}
else if(p <= 25.00)
{
SendClientMessage(playerid, -1, "25");
}
else if(p <= 40.00)
{
SendClientMessage(playerid, -1, "40");
}
return 1;
}