// Four of a Kind Check
// Three of a Kind Check
for(new i = 0; i < 4; i++) {
for(new j = 0; j < 13; j++) {
if(suitArray[i][j] == 1) {
for(new c = 0; c < 4; c++) {
if(suitArray[c][j] == 1) {
tmp++;
}
}
if(tmp == 4) {
isFour = true;
}
else if(tmp >= 3) {
isThree = true;
} else {
tmp = 0;
}
}
}
}
// Four of a Kind Check
// Three of a Kind Check
for(new j = 0; j < 13; j++)
{
for(new c = 0; c < 4; c++)
{
if(suitArray[c][j] == 1) tmp++;
}
if(tmp == 4) isFour = true;
if(tmp == 3) isThree = true;
else tmp = 0;
}
pawn Код:
|
// Four of a Kind Check
// Three of a Kind Check
// Two Pair & Pair Check
for(new j = 0; j < 13; j++) {
for(new i = 0; i < 4; i++) {
if(suitArray[i][j] == 1) tmp++;
}
switch(tmp) {
case 4: {
isFour = true;
break;
}
case 3: {
isThree = true;
}
case 2: {
if(++pairs == 2) {
isTwoPair = true;
}
isPair = true;
}
}
tmp = 0;
}
// Straight Check
for(new j = 0; j < 13; j++) {
if((suitArray[0][j] | suitArray[1][j] | suitArray[2][j] | suitArray[3][j]) == 1) {
if(++tmp == 5) {
isStraight = true;
break;
}
} else {
tmp = 0;
}
}
if((tmp == 4) && ((suitArray[0][0] | suitArray[1][0] | suitArray[2][0] | suitArray[3][0]) == 1)) {
isStraight = true;
}
tmp = 0;
// Convert Hand to Singles
pokerArray[0] %= 13;
pokerArray[1] %= 13;
// Convert Aces to worth 13.
if(pokerArray[0] == 0) pokerArray[0] = 13;
if(pokerArray[1] == 0) pokerArray[1] = 13;
// 7) POKER_RESULT_FULL_HOUSE - Three of a kind combined with a pair. * THREE KIND + PAIR *
if(isThree && isPair /* instead of isTwoPair */) {
SetPVarString(playerid, "pkrResultString", "Full House");
return 700 + pokerArray[0] + pokerArray[1];
}