Pickups.
#3

Somewhere:
Code:
new healthpickups[4];
In OnGameModeInit (change the x, y, z):
Code:
healthpickups[0] = CreatePickup(1240, 1, x, y, z);
healthpickups[1] = CreatePickup(1240, 1, x, y, z);
healthpickups[2] = CreatePickup(1240, 1, x, y, z);
healthpickups[3] = CreatePickup(1240, 1, x, y, z);
}
In OnPlayerPickUpPickup:
Code:
for (new p = 0; p < sizeof(healthpickups); p++)
{
    if (healthpickups[p] != pickupid) continue;
    if (GetPlayerMoney(playerid) >= 1200)
    {
        new Float:health;
        GetPlayerHealth(playerid, health);
        if (health < 100.0)
        {
            GivePlayerMoney(playerid, -1200);
            SetPlayerHealth(playerid, 100.0);
        }
    }
    return 1;
}
Reply


Messages In This Thread
Pickups. - by Saman22 - 06.05.2020, 12:02
Re: Pickups. - by Mike861 - 06.05.2020, 12:13
Re: Pickups. - by beckzy - 06.05.2020, 18:58

Forum Jump:


Users browsing this thread: 1 Guest(s)