LVPlayground / playground

The Las Venturas Playground gamemode
Other
33 stars 23 forks source link

Adding Condition to identify airport pickup #787

Closed Specifer closed 4 years ago

Specifer commented 4 years ago

Solving #786 error from occurring.

This compiled well, But Is this good?

RussellLVP commented 4 years ago

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 commented 4 years ago

Thank you Russell.

RussellLVP commented 4 years ago

Thank you!