How to make players health decrease by 10
#1

I dont want to setplayers health to 10 i want it to reduce by 10 if they pickup a pickup. How could i do that
Reply
#2

pawn Код:
//OnPlayerPickupPickUp
{
    new Float:fHealth;
    GetPlayerHealth(playerid, fHealth);
    SetPlayerHealth(playerid, fHealth - 10);
}
Reply
#3

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == THE_ID_OF_YOUR_PICKUP)
    {
        new Float: playersHealth;
        GetPlayerHealth(playerid, playersHealth);
        SetPlayerHealth(playerid, playersHealth - 10);
    }

    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)