Creating pickups on a new island
#3

Damn, I was afraid of this.

But even when the pickup doesn't show, the distance check isn't working either.

pawn Код:
// Refuel a vehicle when driving a vehicle and presseing the HORN key
    // Check if the player presses the HORN key
    if ((newkeys & KEY_CROUCH) && !(oldkeys & KEY_CROUCH))
    {
        // Check if the player is driving a vehicle
        if (GetPlayerVehicleSeat(playerid) == 0)
        {
            // Loop through all ARefuelPickups
            for (new i; i < sizeof(ARefuelPickups); i++)
            {
                // Check if the player is in range of a refuelpickup
                if(IsPlayerInRangeOfPoint(playerid, 2.5, ARefuelPickups[i][pux], ARefuelPickups[i][puy], ARefuelPickups[i][puz]))
                {
                    // Show a message that the player's vehicle is refuelling
                    GameTextForPlayer(playerid, "~g~Refuelling...", 3000, 4);
                    // Don't allow the player to move again (the timer will allow it after refuelling)
                    TogglePlayerControllable(playerid, 0);
                       // Start a timer (let the player wait until the vehicle is refuelled)
                    SetTimerEx("RefuelVehicle", 5000, false, "i", playerid);
                    // Stop the search
                    break;
                }
            }
        }
    }
I'm using this code in "OnPlayerKeyStateChange" to check if the player is honking the horn when in range of a refuel pickup.
This works everywhere, but not on that island.

As you see, it only calculates the distance to the presetted coordinates in the array.
So, even if the pickup won't show up, the distance-calculation should work and the vehicle should refuel, but it doesn't.

I'll add some debug-messages to check if the player's location is calculated correctly.
Reply


Messages In This Thread
Creating pickups on a new island - by PowerPC603 - 11.01.2011, 19:03
Re: Creating pickups on a new island - by Babul - 11.01.2011, 19:44
Re: Creating pickups on a new island - by PowerPC603 - 11.01.2011, 20:09
Re: Creating pickups on a new island - by PowerPC603 - 13.01.2011, 14:21

Forum Jump:


Users browsing this thread: 4 Guest(s)