28.07.2012, 04:01
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
//OnPlayerPickupPickUp
{
new Float:fHealth;
GetPlayerHealth(playerid, fHealth);
SetPlayerHealth(playerid, fHealth - 10);
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == THE_ID_OF_YOUR_PICKUP)
{
new Float: playersHealth;
GetPlayerHealth(playerid, playersHealth);
SetPlayerHealth(playerid, playersHealth - 10);
}
return 1;
}