20.11.2016, 00:56
Alright so seems I am doing something wrong that I cant seem to find
So this is the code
And this is the gateEmptyValid
What should it do? Return ID of a slot where we can create a gate, but it seems it always returns -1
These are the cases in which it should return -1 instead of the actual id ID
EDIT: The problem is, it always returns -1
EDIT V2:
Resolved, It was a synthax problem. I used
Instead of
So this is the code
pawn Code:
new sqlID = gateEmptyValid();
if(sqlID == -1) return SendClientMessage(playerid,COLOR_RED,"Server cannot handle any more gates at the moment");
And this is the gateEmptyValid
pawn Code:
stock gateEmptyValid() {
for(new i=0; i < MAX_GATES; i++) {
if(gateInfo[i][gValid] != 1 && gateInfo[i][gID] != 0) {
return i;
}
}
return -1;
}
These are the cases in which it should return -1 instead of the actual id ID
- If gate is valid (valid == 1)
- If gate is ID 0
EDIT: The problem is, it always returns -1
EDIT V2:
Resolved, It was a synthax problem. I used
pawn Code:
if(gateInfo[i][gValid] != 1 && gateInfo[i][gID] != 0)
pawn Code:
if(gateInfo[i][gValid] != 1 && i != 0)