Skip to content

Adding Condition to identify airport pickup#787

Merged
RussellLVP merged 3 commits intoLVPlayground:masterfrom
Specifer:pickup-fix
Jul 22, 2020
Merged

Adding Condition to identify airport pickup#787
RussellLVP merged 3 commits intoLVPlayground:masterfrom
Specifer:pickup-fix

Conversation

@Specifer
Copy link
Collaborator

Solving #786 error from occurring.

This compiled well, But Is this good?

@RussellLVP
Copy link
Member

No. Just using the variable without comparing it to something means this test passes if the value is non-zero, which is always the case because the pickups were created.

I think you'll want something like:

if (Time->currentTime() - AirTime[playerid] < 60) {
    if (pickupid == g_AirportPickup[0] || pickupid == g_AirportPickup[1] ||
            pickupid == g_AirportPickup[2] || pickupid == g_AirportPickup[3]) {
        SendClientMessage(playerid,Color::Red,"There are no flights departing right now! Try again later.");
        return 1;
    }
}

@Specifer
Copy link
Collaborator Author

Thank you Russell.

@RussellLVP
Copy link
Member

Thank you!

@RussellLVP RussellLVP merged commit 5a8a3e6 into LVPlayground:master Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants