print("CHECK_TWOPAIRS - START");
for (new _card=1; _card<=13; _card++) {
if (countC[_card-1]==2) {
for (new _subCard=1; _subCard<=13; _subCard++) {
if (_subCard != _card) {
if (countC[_subCard-1]==2) {
return CHECK_TWOPAIRS;
}
}
}
}
}
print("CHECK_TWOPAIRS - END");
[00:48:21] CHECK_TWOPAIRS - START
[00:48:21] CHECK_TWOPAIRS - END
//print("CHECK_TWOPAIRS - START");
for (new _card=1; _card<=13; _card++) {
if (countC[_card-1]==2) {
for (new _subCard=1; _subCard<=13; _subCard++) {
if (_subCard != _card) {
if (countC[_subCard-1]==2) {
return CHECK_TWOPAIRS;
}
}
}
}
}
//print("CHECK_TWOPAIRS - END");
[00:50:55] [debug] Run time error 4: "Array index out of bounds"
[00:50:55] [debug] Accessing element at index 8685052 past array upper bound 4
[00:50:55] [debug] AMX backtrace:
[00:50:55] [debug] #0 00047c28 in ?? () from grimrandomerRoleplay.amx
[00:50:55] [debug] #1 000b81e4 in public OnGameModeInit () from grimrandomerRoleplay.amx
index 8685052 |
Run time error 4: "Array index out of bounds" |
new countC[3];
// in a public
for(new countCs = 1; countCs < 99; countCs++) { printf("%d", countC[countCs]); }
new countC[14]; // 0 - 13 is used. 14 is a null cell.
for(new _card=0; _card<14; _card++)
{ // starts from 0 and then reaches 13. Not going over to 14 due to '< 14'
if(countC[_card] == 2)
{ // if countC[cell] would equal to integer 2.
for(new _subCard=0; _subCard<14; _subCard++)
{ // starts from 0 and then reaches 13. Not going over to 14 due to '< 14'
if(_subCard != _card)
{ // if #loop2 does NOT equal to #loop1 then continue. (integers of course)
if(countC[_subCard] == 2) return CHECK_TWOPAIRS; // quick way to wrap-up the whole thingy.
}
}
}
}
OnGameModeInit()
{
// Stuff here before the for loop.
// --> countC loop with the 'return CHECK_TWOPAIRS;'
// More stuff here after loop.
}
new countC[14]; // 0 - 13 is used. 14 is a null cell.
for(new _card=0; _card<14; _card++)
{ // starts from 0 and then reaches 13. Not going over to 14 due to '< 14'
if(countC[_card] == 2)
{ // if countC[cell] would equal to integer 2.
for(new _subCard=0; _subCard<14; _subCard++)
{ // starts from 0 and then reaches 13. Not going over to 14 due to '< 14'
if(_subCard != _card)
{ // if #loop2 does NOT equal to #loop1 then continue. (integers of course)
if(countC[_subCard] == 2)
{
// Send this over to another checkup script, example: OnFoundTwoPairs(_card, _subCard);
continue; // <== This isn't really needed, cause there is no return.
// or just return continue; // Same as above ^
// break; // If we don't want anything else going on here, let's just stop with break;
// or just return break; // Same as above ^ (not sure about this tho, never tried it out)
}
}
}
}
}
print("CHECK_TWOPAIRS - START");
for (new _card=1; _card<=13; _card++) {
if (countC[_card-1]==2) {
for (new _subCard=1; _subCard<=13; _subCard++) {
if (_subCard != _card) {
if (countC[_subCard-1]==2) {
return CHECK_TWOPAIRS;
}
}
}
}
}
print("CHECK_TWOPAIRS - END");
print("CHECK_JACKORBETTER - START");
for (new _c=0; _c<5; _c++) {
new _c = cPokerGame[playerid][_c][1]; //My error was here, I re-defined _c
if (_c >= CARD_JACK) {
return CHECK_JACKORBETTER;
}
}
print("CHECK_TWOPAIRS - END");
print("CHECK_JACKORBETTER - START");