Solved
#1

Solved
Reply
#2

It's complaining about that because you actually do have a return value in certain cases, but not in all cases. It's complaining because you should have a return value in all cases if you're going to have any at all.

So consider adding:

pawn Код:
return -1;
To the end. You could use it to specify when there are no empty passenger slots, for example:

pawn Код:
new slot = GetNextEmptyDoorSlot();

if(slot != -1) PutPlayerInVehicle(playerid, vehicleid, slot);
I hope that makes sense.
Reply
#3

Код:
At the top: #define INVALID_DOOR -1

stock GetNextEmptyDoorSlot()
{
    for(new i=0; i<MAX_DOORS; i++)
    {
        if(DoorInfo[i][dTaken] == 0)
        {
            return i;
        }
    }
    return INVALID_DOOR;
}
Edit: Grr, beat by mere seconds.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)