enum rouletteHands_Enum { RNumber, RCard[12], } new RouletteHands[][rouletteHands_Enum] = { {0, "Green"}, {32, "Red"}, {15, "Black"}, {19, "Red"}, {4, "Black"}, {21, "Red"}, {2, "Black"}, {25, "Red"}, {17, "Black"}, {34, "Red"}, {6, "Black"}, {27, "Red"}, {13, "Black"}, {36, "Red"}, {11, "Black"}, {30, "Red"}, {8, "Black"}, {23, "Red"}, {10, "Black"}, {5, "Red"}, {24, "Black"}, {16, "Red"}, {33, "Black"}, {1, "Red"}, {20, "Black"}, {14, "Red"}, {31, "Black"}, {9, "Red"}, {22, "Black"}, {18, "Red"}, {29, "Black"}, {7, "Red"}, {28, "Black"}, {12, "Red"}, {35, "Black"}, {3, "Red"}, {26, "Black"} };
function:RouletteTimer(playerid) { new rouletteID = minrand(0, sizeof(RouletteHands)); new iFormat[128]; if(!strcmp(RouletteHands[rouletteID][RCard], "Black")) { format(iFormat, sizeof(iFormat), "** The wheel lands on %d (%s) ** (( %s ))", RouletteHands[rouletteID][RNumber], RouletteHands[rouletteID][RCard], MaskedName(playerid)); NearMessage(playerid, iFormat, 0x282828FF); } else if(!strcmp(RouletteHands[rouletteID][RCard], "Red")) { format(iFormat, sizeof(iFormat), "** The wheel lands on %d (%s) ** (( %s ))", RouletteHands[rouletteID][RNumber], RouletteHands[rouletteID][RCard], MaskedName(playerid)); NearMessage(playerid, iFormat, 0xFF1A1AFF); } else { format(iFormat, sizeof(iFormat), "** The wheel lands on %d (%s) ** (( %s ))", RouletteHands[rouletteID][RNumber], RouletteHands[rouletteID][RCard], MaskedName(playerid)); NearMessage(playerid, iFormat, COLOR_GREEN); } }
static const RedNums[] =
{
// All Red Numbers
};
static const BlueNums[] =
{
// Blue Numbers
};
static const GreenNums[] =
{
// Green Nums
};
function:RouletteTimer(playerid)
{
new rouletteID = random(3), randomnum;
new iFormat[128];
switch(rouletteID)
{
case 0: // red
{
randomnum = random(sizeof(RedNums));
format(iFormat, sizeof(iFormat), "** The wheel lands on %d (Red) ** (( %s ))", RedNums[randomnum], MaskedName(playerid));
NearMessage(playerid, iFormat, 0x282828FF);
}
case 1: // blue
{
randomnum = random(sizeof(BlueNums));
format(iFormat, sizeof(iFormat), "** The wheel lands on %d (Blue) ** (( %s ))", BlueNums[randomnum], MaskedName(playerid));
NearMessage(playerid, iFormat, 0x282828FF);
}
case 2: // green
{
randomnum = random(sizeof(GreenNums));
format(iFormat, sizeof(iFormat), "** The wheel lands on %d (Green) ** (( %s ))", GreenNums[randomnum], MaskedName(playerid));
NearMessage(playerid, iFormat, 0x282828FF);
}
}
return 1;
}
Well my question was , can a player know what number will fall not how to script xD
but for ur effor ill give u a rep cuz u deserv it ty. |
The result is chosen directly before it is shown to the players, so its impossible that they know it earlier, even if they had access to all the server variables somehow.
@NeXoR Nice attempt to get cleaner code, but yours actually messes up the probabilities of the game. Theres just one or two green numbers, 0 and 00 (depending on the play style). With your code, those two number would have a 33% chance to appear. I know, its all about maximizing then casinos profits, but this is too obvious and players will complain about it |