Creating pickups on a new island
#1

Hi,

I've got a problem.
When I create my pickups over land (standard gta sa map), the pickups stay there.

When I create exactly the same pickup on a new island (coordinates: x = 3760.00, y = 573.00, z = 7.00), and we drive to that island, the pickup isn't shown.
I'm using type 1 for the pickup.

When I create a pickup ingame with the exact same command, the new one shows up.

How can I fix this?

This is the function where I create my pickups for refueling a vehicle:

pawn Код:
// This function is used to add refuelling pickups to the map
stock AddRefuelPickup(Float:x, Float:y, Float:z)
{
    // Add the refuel-pickup to the world (type 1: exists always, cannot be picked up)
    new puID = CreatePickup(1244, 1, x, y, z, 0);

    // Add the pickup-id to the ARefuelPickups array
    for (new i; i < sizeof(ARefuelPickups); i++)
    {
        // If an empty array-index is found
        if (ARefuelPickups[i][PickupID] == 0)
        {
            // Store the pickup-id in this empty slot
            ARefuelPickups[i][PickupID] = puID;
            ARefuelPickups[i][pux] = x;
            ARefuelPickups[i][puy] = y;
            ARefuelPickups[i][puz] = z;

            // Stop browsing through the array
            break;
        }
    }
}
This is how I use the function (the first 8 works normally):
pawn Код:
// Add all refuel-pickups to the world
    AddRefuelPickup(-1471.5, 1863.75, 32.7);
    AddRefuelPickup(-1326.5, 2677.5, 50.1);
    AddRefuelPickup(611.5, 1694.5, 7.0);
    AddRefuelPickup(-2249.25, -2559.0, 32.0);
    AddRefuelPickup(-1606.5, -2714.0, 48.6);
    AddRefuelPickup(-93.5, -1175.0, 2.3);
    AddRefuelPickup(1377.5, 457.0, 19.9);
    AddRefuelPickup(651.5, -565.5, 16.4);

    AddRefuelPickup(3760, 573.25, 7.1); // This one doesn't show up, all the others do
And yes, the array ARefuelPickups is large enough to hold 50 of these pickups (only 9 are created and added to this array).

This is all done during OnGameModeInit().

Could it be because they are spawned outside the normal limits of the map?
It's the only reason I can think off why it won't work.



The island's models are defined in a filterscript.
Reply
#2

iam afraid it has something to do with the coordinates. 3760 is the east ocean at los santos, its not too far away form the regular map, but i bet, R* coded a limit for pickup coordinates. some users encountered similar problems where pickups disappear when you go away and back to them again - like in the cityhall, its in the sky, out of boundaries, you create a pickup, its fine, go up to the 2nd floor, go back to the pickup at the entrance hall, it wont show up again.
if nobody else finds a better solution, i have to tell you: try to spawn the pickup as far away from the beach as long as its not bugging out, then you will need to modify your map...
Reply
#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
#4

I tried adding a huge row of pickups from x = 2900 to x = 3900.
When I crossed the x = 3020 line, all the pickup-models got stretched, they looked like wooden boards, spinning around.

So I guess, creating pickups outside the world-limit bugs several things.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)